Partial authorize satisfied permits not determining if deny
Cedar.Thm.partial_authorize_satisfied_permits_not_determining_if_deny
Plain-language statement
If the result of concrete authorization is deny, then any permit policies satisfied after partial authorization cannot be determining policies.
Exact Lean statement
theorem partial_authorize_satisfied_permits_not_determining_if_deny
{schema : Schema}
{policies : List Policy}
{req : Request}
{es : Entities}
{preq : PartialRequest}
{pes : PartialEntities}
{response : TPE.Response} :
TPE.isAuthorized schema policies preq pes = Except.ok response →
isValidAndConsistent schema req es preq pes = Except.ok () →
(Spec.isAuthorized req es policies).decision = .deny →
PolicyIdsUnique policies →
(response.satisfiedPermits ∩ (Spec.isAuthorized req es policies).determiningPolicies).isEmptyFormal artifact
Lean source
theorem partial_authorize_satisfied_permits_not_determining_if_deny {schema : Schema} {policies : List Policy} {req : Request} {es : Entities} {preq : PartialRequest} {pes : PartialEntities} {response : TPE.Response} : TPE.isAuthorized schema policies preq pes = Except.ok response → isValidAndConsistent schema req es preq pes = Except.ok () → (Spec.isAuthorized req es policies).decision = .deny → PolicyIdsUnique policies → (response.satisfiedPermits ∩ (Spec.isAuthorized req es policies).determiningPolicies).isEmpty:= by intro h₁ h₂ h₃ h₄ simp only [Set.empty_iff_not_exists, Set.mem_inter_iff, not_exists, not_and] intro pid hp₁ hp₂ have hsatisfied : ∀ effect, (pid ∈ satisfiedPolicies effect policies req es ↔ (∃ policy, policy.id = pid ∧ policy ∈ policies ∧ policy.effect = effect ∧ satisfied policy req es)) := by simp only [satisfiedPolicies, satisfiedWithEffect, Set.mem_make] grind [PolicyIdsUnique] replace hp₂ : ∃ policy, policy.id = pid ∧ policy ∈ policies ∧ policy.effect = .forbid ∧ satisfied policy req es := by have hd := determiningPolicies_of req es policies simpa [hd, h₃, hsatisfied] using hp₂ have hp₃ : ∃ policy, policy.id = pid ∧ policy ∈ policies ∧ policy.effect = .permit ∧ satisfied policy req es := by have hpermits := partial_authorize_satisfied_permits_is_sound h₁ h₂ rw [Set.subset_def] at hpermits rw [←hsatisfied] exact hpermits pid hp₁ grind [PolicyIdsUnique]- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/TPE.lean:178-210
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.