This file defines abstract syntax for Cedar policies.
- any : Scope
- eq (entity : EntityUID) : Scope
- mem (entity : EntityUID) : Scope
- is (ety : EntityType) : Scope
- isMem (ety : EntityType) (entity : EntityUID) : Scope
Instances For
- principalScope (scope : Scope) : PrincipalScope
Instances For
- resourceScope (scope : Scope) : ResourceScope
Instances For
This definition of the ActionScope is more liberal than what is allowed by
Cedar's concrete grammar. In particular, the concrete grammar doesn't allow is
constraints in action scopes (e.g., action is ety), while our abstract grammar
does. Restricting action scopes in this way is not necessary for proving any
properties of Cedar; it is done in the concrete grammar for usability (since
is constraints on actions can be expressed using groups instead). We're
choosing the more liberal modeling here for uniformity and simplicity.
- actionScope (scope : Scope) : ActionScope
- actionInAny (ls : List EntityUID) : ActionScope
Instances For
@[reducible, inline]
Equations
Instances For
- when : ConditionKind
- unless : ConditionKind
Instances For
@[reducible, inline]
Equations
Instances For
- id : PolicyID
- effect : Effect
- principalScope : PrincipalScope
- actionScope : ActionScope
- resourceScope : ResourceScope
- condition : Conditions
Instances For
@[reducible, inline]
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- v.isEntityType ety = Cedar.Spec.Expr.unaryApp (Cedar.Spec.UnaryOp.is ety) (Cedar.Spec.Expr.var v)
Instances For
Equations
- Cedar.Spec.Scope.any.toExpr v = Cedar.Spec.Expr.lit (Cedar.Spec.Prim.bool true)
- (Cedar.Spec.Scope.eq uid).toExpr v = v.eqEntityUID uid
- (Cedar.Spec.Scope.mem uid).toExpr v = v.inEntityUID uid
- (Cedar.Spec.Scope.is ety).toExpr v = v.isEntityType ety
- (Cedar.Spec.Scope.isMem ety uid).toExpr v = (v.isEntityType ety).and (v.inEntityUID uid)
Instances For
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
- (Cedar.Spec.ActionScope.actionScope s).toExpr = s.toExpr Cedar.Spec.Var.action
Instances For
Equations
- c.toExpr = match c.kind with | Cedar.Spec.ConditionKind.when => c.body | Cedar.Spec.ConditionKind.unless => Cedar.Spec.Expr.unaryApp Cedar.Spec.UnaryOp.not c.body
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- p.toExpr = p.principalScope.toExpr.and (p.actionScope.toExpr.and (p.resourceScope.toExpr.and p.condition.toExpr))
Instances For
Equations
- (Cedar.Spec.Scope.eq uid).bound = some uid
- (Cedar.Spec.Scope.mem uid).bound = some uid
- (Cedar.Spec.Scope.isMem ety uid).bound = some uid
- x✝.bound = none
Instances For
The trivial allow-all policy
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Spec.instReprEffect.repr Cedar.Spec.Effect.permit prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Cedar.Spec.Effect.permit")).group prec✝
- Cedar.Spec.instReprEffect.repr Cedar.Spec.Effect.forbid prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Cedar.Spec.Effect.forbid")).group prec✝
Instances For
Equations
- Cedar.Spec.instReprEffect = { reprPrec := Cedar.Spec.instReprEffect.repr }
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- Cedar.Spec.instReprCondition = { reprPrec := Cedar.Spec.instReprCondition.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Cedar.Spec.instReprScope = { reprPrec := Cedar.Spec.instReprScope.repr }
Equations
- One or more equations did not get rendered due to their size.
- Cedar.Spec.instReprScope.repr Cedar.Spec.Scope.any prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Cedar.Spec.Scope.any")).group prec✝
Instances For
Equations
- Cedar.Spec.instDecidableEqScope.decEq Cedar.Spec.Scope.any Cedar.Spec.Scope.any = isTrue ⋯
- Cedar.Spec.instDecidableEqScope.decEq Cedar.Spec.Scope.any (Cedar.Spec.Scope.eq entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq Cedar.Spec.Scope.any (Cedar.Spec.Scope.mem entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq Cedar.Spec.Scope.any (Cedar.Spec.Scope.is ety) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq Cedar.Spec.Scope.any (Cedar.Spec.Scope.isMem ety entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.eq entity) Cedar.Spec.Scope.any = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.eq a) (Cedar.Spec.Scope.eq b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.eq entity) (Cedar.Spec.Scope.mem entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.eq entity) (Cedar.Spec.Scope.is ety) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.eq entity) (Cedar.Spec.Scope.isMem ety entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.mem entity) Cedar.Spec.Scope.any = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.mem entity) (Cedar.Spec.Scope.eq entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.mem a) (Cedar.Spec.Scope.mem b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.mem entity) (Cedar.Spec.Scope.is ety) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.mem entity) (Cedar.Spec.Scope.isMem ety entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.is ety) Cedar.Spec.Scope.any = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.is ety) (Cedar.Spec.Scope.eq entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.is ety) (Cedar.Spec.Scope.mem entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.is a) (Cedar.Spec.Scope.is b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.is ety) (Cedar.Spec.Scope.isMem ety_1 entity) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.isMem ety entity) Cedar.Spec.Scope.any = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.isMem ety entity) (Cedar.Spec.Scope.eq entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.isMem ety entity) (Cedar.Spec.Scope.mem entity_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.isMem ety entity) (Cedar.Spec.Scope.is ety_1) = isFalse ⋯
- Cedar.Spec.instDecidableEqScope.decEq (Cedar.Spec.Scope.isMem a a_1) (Cedar.Spec.Scope.isMem b b_1) = if h : a = b then h ▸ if h : a_1 = b_1 then h ▸ isTrue ⋯ else isFalse ⋯ else isFalse ⋯
Instances For
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Spec.instDecidableEqPrincipalScope.decEq (Cedar.Spec.PrincipalScope.principalScope a) (Cedar.Spec.PrincipalScope.principalScope b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Spec.instDecidableEqResourceScope.decEq (Cedar.Spec.ResourceScope.resourceScope a) (Cedar.Spec.ResourceScope.resourceScope b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- Cedar.Spec.instDecidableEqActionScope.decEq (Cedar.Spec.ActionScope.actionScope a) (Cedar.Spec.ActionScope.actionScope b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- Cedar.Spec.instDecidableEqActionScope.decEq (Cedar.Spec.ActionScope.actionScope scope) (Cedar.Spec.ActionScope.actionInAny ls) = isFalse ⋯
- Cedar.Spec.instDecidableEqActionScope.decEq (Cedar.Spec.ActionScope.actionInAny ls) (Cedar.Spec.ActionScope.actionScope scope) = isFalse ⋯
- Cedar.Spec.instDecidableEqActionScope.decEq (Cedar.Spec.ActionScope.actionInAny a) (Cedar.Spec.ActionScope.actionInAny b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Spec.instReprPolicy = { reprPrec := Cedar.Spec.instReprPolicy.repr }
Equations
- One or more equations did not get rendered due to their size.