pub enum Condition {
Comparison {
key: String,
op: CompareOp,
value: Literal,
},
IsTrue {
key: String,
},
IsFalse {
key: String,
},
Exists {
key: String,
},
InSet {
value_key: String,
set_key: String,
negate: bool,
},
}Expand description
Leaf predicate.
Comparison covers key op value. The truthiness checks are split out
(IsTrue / IsFalse) because they’re the most common form — authenticated,
role.hr, delegated.
The DSL’s require(...) keyword is not represented here — it’s a
rule-level shorthand for “deny when the condition fails,” and the parser
desugars it into Not / And / Or over IsFalse expressions plus
an Action::Deny. See DSL spec §8.1 desugarings.
Variants§
Comparison
IsTrue
IsFalse
Exists
DSL exists(key) — true iff the key is present in the
AttributeBag, regardless of its value. Distinct from IsTrue
(which only succeeds for truthy values). Per DSL §2.2.
InSet
DSL value_key in set_key (negate=false) / value_key not in set_key
(negate=true). Both operands are attribute keys, not literals — the
scalar at value_key is checked for membership in the StringSet at
set_key. Per DSL §2.4. Returns false if either key is missing or
the types don’t match (scalar must resolve to a string).