This file defines the Cedar validator.
Return every schema-defined environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return all the schema-defined environments for a particular action, or
none if this action is not declared in the schema.
Note that some ∅ means something different than none -- some ∅ means
that the action was declared in the schema, but there are no valid
environments for it
Equations
- One or more equations did not get rendered due to their size.
Instances For
Return the environment for the particular (p,a,r) tuple, or none if this
is not a valid tuple in this schema
Equations
- One or more equations did not get rendered due to their size.
Instances For
- typeError (pid : Spec.PolicyID) (error : TypeError) : ValidationError
- levelError (pid : Spec.PolicyID) : ValidationError
- impossiblePolicy (pid : Spec.PolicyID) : ValidationError
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Validation.instBEqValidationError.beq (Cedar.Validation.ValidationError.typeError a a_1) (Cedar.Validation.ValidationError.typeError b b_1) = (a == b && a_1 == b_1)
- Cedar.Validation.instBEqValidationError.beq (Cedar.Validation.ValidationError.levelError a) (Cedar.Validation.ValidationError.levelError b) = (a == b)
- Cedar.Validation.instBEqValidationError.beq (Cedar.Validation.ValidationError.impossiblePolicy a) (Cedar.Validation.ValidationError.impossiblePolicy b) = (a == b)
- Cedar.Validation.instBEqValidationError.beq x✝¹ x✝ = false
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check that all referenced entity types, actions, and enum entities are declared in the schema. The Lean model of typechecking also does this check, but Rust does it only as a separate pass. This means the Rust validator will report undefined entity types that the Lean typechecker ignores due to short-circuiting. We include this validation pass so that the validators behave exactly the same, but we don't need to prove anything about it for soundness.
Equations
- One or more equations did not get rendered due to their size.
- Cedar.Validation.checkEntities schema (Cedar.Spec.Expr.lit p) = Except.ok ()
- Cedar.Validation.checkEntities schema (Cedar.Spec.Expr.var v) = Except.ok ()
- Cedar.Validation.checkEntities schema (x₁.ite x₂ x₃) = do Cedar.Validation.checkEntities schema x₁ Cedar.Validation.checkEntities schema x₂ Cedar.Validation.checkEntities schema x₃
- Cedar.Validation.checkEntities schema (Cedar.Spec.Expr.binaryApp op x₁ x₂) = do Cedar.Validation.checkEntities schema x₁ Cedar.Validation.checkEntities schema x₂
- Cedar.Validation.checkEntities schema (x₁.and x₂) = do Cedar.Validation.checkEntities schema x₁ Cedar.Validation.checkEntities schema x₂
- Cedar.Validation.checkEntities schema (x₁.or x₂) = do Cedar.Validation.checkEntities schema x₁ Cedar.Validation.checkEntities schema x₂
- Cedar.Validation.checkEntities schema (x₁.getAttr attr) = Cedar.Validation.checkEntities schema x₁
- Cedar.Validation.checkEntities schema (x₁.hasAttr attr) = Cedar.Validation.checkEntities schema x₁
- Cedar.Validation.checkEntities schema (Cedar.Spec.Expr.unaryApp op x₁) = Cedar.Validation.checkEntities schema x₁
- Cedar.Validation.checkEntities schema (Cedar.Spec.Expr.set xs) = xs.attach.forM fun (x : { x : Cedar.Spec.Expr // x ∈ xs }) => have x_1 := ⋯; Cedar.Validation.checkEntities schema x.val
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Cedar.Validation.mapOnVars f (Cedar.Spec.Expr.lit l) = Cedar.Spec.Expr.lit l
- Cedar.Validation.mapOnVars f (Cedar.Spec.Expr.var var) = f var
- Cedar.Validation.mapOnVars f (x₁.ite x₂ x₃) = (Cedar.Validation.mapOnVars f x₁).ite (Cedar.Validation.mapOnVars f x₂) (Cedar.Validation.mapOnVars f x₃)
- Cedar.Validation.mapOnVars f (x₁.and x₂) = (Cedar.Validation.mapOnVars f x₁).and (Cedar.Validation.mapOnVars f x₂)
- Cedar.Validation.mapOnVars f (x₁.or x₂) = (Cedar.Validation.mapOnVars f x₁).or (Cedar.Validation.mapOnVars f x₂)
- Cedar.Validation.mapOnVars f (Cedar.Spec.Expr.unaryApp op₁ x₁) = Cedar.Spec.Expr.unaryApp op₁ (Cedar.Validation.mapOnVars f x₁)
- Cedar.Validation.mapOnVars f (Cedar.Spec.Expr.binaryApp op₂ x₁ x₂) = Cedar.Spec.Expr.binaryApp op₂ (Cedar.Validation.mapOnVars f x₁) (Cedar.Validation.mapOnVars f x₂)
- Cedar.Validation.mapOnVars f (x₁.hasAttr a) = (Cedar.Validation.mapOnVars f x₁).hasAttr a
- Cedar.Validation.mapOnVars f (x₁.getAttr a) = (Cedar.Validation.mapOnVars f x₁).getAttr a
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check that a policy is Boolean-typed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Check a policy under multiple environments.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Analyze a set of policies to check that all are boolean-typed, and that none are guaranteed to be false under all possible environments.
Equations
- Cedar.Validation.validate policies schema = List.forM policies fun (x : Cedar.Spec.Policy) => Cedar.Validation.typecheckPolicyWithEnvironments Cedar.Validation.typecheckPolicy x schema
Instances For
Analyze a set of policies to check that all are boolean-typed, and that none are guaranteed to be false under all possible environments.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.lubErr ty₁ ty₂)) = Lean.Json.str "lubErr"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.unexpectedType ty)) = Lean.Json.str "unexpectedType"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.attrNotFound ty attr)) = Lean.Json.str "attrNotFound"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.tagNotFound ety tag)) = Lean.Json.str "tagNotFound"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.unknownEntity ety)) = Lean.Json.str "unknownEntity"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.extensionErr xs)) = Lean.Json.str "extensionErr"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid Cedar.Validation.TypeError.emptySetErr) = Lean.Json.str "emptySetErr"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.typeError pid (Cedar.Validation.TypeError.incompatibleSetTypes ty)) = Lean.Json.str "incompatibleSetTypes"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.levelError pid) = Lean.Json.str "levelError"
- Cedar.Validation.validationErrorToJson (Cedar.Validation.ValidationError.impossiblePolicy pid) = Lean.Json.str "impossiblePolicy"
Instances For
Equations
Equations
Instances For
Equations
- Cedar.Validation.instToJsonUnit_cedar = { toJson := fun (x : Unit) => Lean.Json.null }