MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / fmt

Method fmt

crates/openshell-policy/src/lib.rs:1125–1187  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

1123
1124impl fmt::Display for PolicyViolation {
1125 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1126 match self {
1127 Self::InvalidProcessIdentity { field, value } => {
1128 write!(
1129 f,
1130 "{field} must be 'sandbox' or a numeric UID/GID in range [{MIN_SANDBOX_UID}, {MAX_SANDBOX_UID}], got '{value}'"
1131 )
1132 }
1133 Self::PathTraversal { path } => {
1134 write!(f, "path contains '..' traversal component: {path}")
1135 }
1136 Self::RelativePath { path } => {
1137 write!(f, "path must be absolute (start with '/'): {path}")
1138 }
1139 Self::OverlyBroadPath { path } => {
1140 write!(f, "read-write path is overly broad: {path}")
1141 }
1142 Self::FieldTooLong { path, length } => {
1143 write!(
1144 f,
1145 "path exceeds maximum length ({length} > {MAX_PATH_LENGTH}): {path}"
1146 )
1147 }
1148 Self::TooManyPaths { count } => {
1149 write!(
1150 f,
1151 "too many filesystem paths ({count} > {MAX_FILESYSTEM_PATHS})"
1152 )
1153 }
1154 Self::TldWildcard { policy_name, host } => {
1155 write!(
1156 f,
1157 "network policy '{policy_name}': TLD wildcard '{host}' is not allowed; \
1158 use subdomain wildcards like '*.example.com' instead"
1159 )
1160 }
1161 Self::MissingSigningService { policy_name, host } => {
1162 write!(
1163 f,
1164 "network policy '{policy_name}': endpoint '{host}' has credential_signing \
1165 set but signing_service is empty"
1166 )
1167 }
1168 Self::UnknownCredentialSigning {
1169 policy_name,
1170 host,
1171 value,
1172 } => {
1173 write!(
1174 f,
1175 "network policy '{policy_name}': endpoint '{host}' has unrecognized \
1176 credential_signing value '{value}' (expected sigv4, sigv4:body, or sigv4:no_body)"
1177 )
1178 }
1179 Self::CredentialSigningWithBodyRewrite { policy_name, host } => {
1180 write!(
1181 f,
1182 "network policy '{policy_name}': endpoint '{host}' has both credential_signing \

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected