(&self, f: &mut fmt::Formatter<'_>)
| 1123 | |
| 1124 | impl 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 \ |
nothing calls this directly
no outgoing calls
no test coverage detected