pub enum ConditionError {
UnknownOperator(String),
TypeMismatch {
expected: String,
actual: String,
},
InvalidBooleanValue,
InvalidDate {
error: String,
},
MissingContextKey(String),
InvalidConditionStructure(String),
InvalidConditionValue {
operator: String,
key: String,
position: Option<usize>,
expected: String,
},
OperatorWithoutKey {
operator: String,
},
OperatorKeyMismatch {
operator: String,
key: String,
key_type: String,
},
}Expand description
Error types for condition evaluation
An error names what the policy’s author wrote and must fix — the operator, the key, the position of an element — and the KIND of a value, never the value itself, neither the policy’s nor the request’s: a caller logging the error must not echo text it has not checked (wami 001).
Variants§
UnknownOperator(String)
TypeMismatch
InvalidBooleanValue
A string that is neither true nor false where a boolean is read.
InvalidDate
A string that is not an RFC 3339 date where a date is read.
MissingContextKey(String)
InvalidConditionStructure(String)
InvalidConditionValue
A value its operator cannot read, refused when the condition is parsed.
It names where the value sits — operator, key, and the element when the value is a list — and what the operator reads, but never the value itself.
Fields
OperatorWithoutKey
An operator no key can feed: the ForAllValues/ForAnyValue forms of
Numeric*, Date* and IpAddress compare a LIST of numbers, dates or
addresses, and no declared key holds one (keys::KeyType has no such
type; custom keys are compared as strings). Refused at parse rather
than kept as a path no parsed policy reaches (wami 001).
OperatorKeyMismatch
An operator that cannot compare the type of the key it is given — a
string operator on the Boolean aws:SecureTransport, a numeric one on
a key nobody declared (compared as a string). Refused at parse: it used
to evaluate to false, so a Deny carrying it vanished.
Trait Implementations§
Source§impl Clone for ConditionError
impl Clone for ConditionError
Source§impl Debug for ConditionError
impl Debug for ConditionError
Source§impl Display for ConditionError
impl Display for ConditionError
impl Eq for ConditionError
Source§impl Error for ConditionError
impl Error for ConditionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()