Validation is sound response
Cedar.Thm.validation_is_sound_response
Plain-language statement
Response-level form of validation_is_sound: for a validated policy set with unique policy ids, every policy in the authorizer's erroringPolicies errored with one of the three errors validation cannot rule out (entityDoesNotExist, extensionError, arithBoundsError). Uniqueness of ids (PolicyIdsUnique, as in `determining_erroring_disjoint_when_...
Exact Lean statement
theorem validation_is_sound_response (policies : Policies) (schema : Schema) (request : Request) (entities : Entities)
(huniq : PolicyIdsUnique policies)
(hwf : schema.validateWellFormed = .ok ())
(hv : validate policies schema = .ok ())
(hr : validateRequest schema request = .ok ())
(he : validateEntities schema entities = .ok ()) :
∀ p ∈ policies, p.id ∈ (isAuthorized request entities policies).erroringPolicies →
evaluate p.toExpr request entities = .error .entityDoesNotExist ∨
evaluate p.toExpr request entities = .error .extensionError ∨
evaluate p.toExpr request entities = .error .arithBoundsErrorFormal artifact
Lean source
theorem validation_is_sound_response (policies : Policies) (schema : Schema) (request : Request) (entities : Entities) (huniq : PolicyIdsUnique policies) (hwf : schema.validateWellFormed = .ok ()) (hv : validate policies schema = .ok ()) (hr : validateRequest schema request = .ok ()) (he : validateEntities schema entities = .ok ()) : ∀ p ∈ policies, p.id ∈ (isAuthorized request entities policies).erroringPolicies → evaluate p.toExpr request entities = .error .entityDoesNotExist ∨ evaluate p.toExpr request entities = .error .extensionError ∨ evaluate p.toExpr request entities = .error .arithBoundsError:= by intro p hp hmem obtain ⟨p', hp', hid, e, herr⟩ := error_of_mem_erroringPolicies hmem have hpeq : p' = p := huniq p' hp' p hp hid rw [hpeq] at herr have hsound : AllEvaluateToBool policies request entities := validation_is_sound policies schema request entities hwf hv hr he have hev : EvaluatesToBool p.toExpr request entities := hsound p hp obtain ⟨b, hev⟩ := hev unfold EvaluatesTo at hev rcases hev with h | h | h | h · exact Or.inl h · exact Or.inr (Or.inl h) · exact Or.inr (Or.inr h) · rw [herr] at h; exact absurd h (by simp)- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/Validation.lean:167-191
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Find? ext
Cedar.Data.Map.find?_ext
Plain-language statement
Two well-formed maps are equal if they have the same find? for every key.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
Find? some iff in values
Cedar.Data.Map.find?_some_iff_in_values
Plain-language statement
The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above
Source project: Cedar Specification
Person-level attribution pending.