jaredzhou/mooncedar/ast does not have a README file
pub(all) enum Expr {
Lit(Literal)
Var(VarKind)
If(Expr, Expr, Expr)
And(Expr, Expr)
Or(Expr, Expr)
UnaryApp(UnaryOp, Expr)
BinaryApp(BinaryOp, Expr, Expr)
GetAttr(Expr, String)
HasAttr(Expr, String)
GetTag(Expr, Expr)
HasTag(Expr, Expr)
Like(Expr, Pattern)
Is(Expr, EntityType)
Set(Array[Expr])
Record(Array[(String, Expr)])
ExtensionApp(Name, Array[Expr])
Slot(String)
Unknown(String, Type?)
} derive(Eq, Debug)pub(all) struct Policy {
id : String
effect : PolicyEffect
annotations : Array[Annotation]
principal : ScopeConstraint
action : ScopeConstraint
resource : ScopeConstraint
conditions : Array[Condition]
} derive(Eq, Debug)pub(all) enum ScopeConstraint {
All
Eq(EntityUID)
In(EntityUID)
InSet(Array[EntityUID])
Is(EntityType)
IsIn(EntityType, EntityUID)
} derive(Eq, Debug)pub(all) enum Type {
Bool
Long
String
Set
Record
Entity(EntityType)
Extension(Name)
} derive(Eq, Debug)| Position | Valid variants | Invalid |
|---|---|---|
| Principal | All, Eq, In, Is, IsIn | InSet |
| Action | All, Eq, In, InSet | Is, IsIn |
| Resource | All, Eq, In, Is, IsIn | InSet |
A Cedar policy engine — parser, evaluator, and authorizer in MoonBit.
Dependencies