Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove a redundant argument #552

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cedar-lean/Cedar/Thm/Validation/RequestEntityValidation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ theorem instance_of_action_schema_refl {entities : Entities} {acts : ActionSchem
simp only [h₀]


theorem request_and_entities_match_env {env : Environment} {request : Request} {entities : Entities} {schema: EntitySchema} :
requestMatchesEnvironment env request schema
theorem request_and_entities_match_env {env : Environment} {request : Request} {entities : Entities} :
requestMatchesEnvironment env request →
entitiesMatchEnvironment env entities = .ok () →
RequestAndEntitiesMatchEnvironment env request entities
:= by
Expand Down
4 changes: 2 additions & 2 deletions cedar-lean/Cedar/Validation/RequestEntityValidator.lean
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ where
else .error (.typeError "action ancestors inconsistent with type store information")
| _ => .error (.typeError s!"action type {uid.eid} not defined in type store")

def requestMatchesEnvironment (env : Environment) (request : Request) (schema : EntitySchema): Bool := instanceOfRequestType request env.reqty schema
def requestMatchesEnvironment (env : Environment) (request : Request): Bool := instanceOfRequestType request env.reqty env.ets

def validateRequest (schema : Schema) (request : Request) : RequestValidationResult :=
if ((schema.environments.any (requestMatchesEnvironment · request schema.ets)))
if ((schema.environments.any (requestMatchesEnvironment · request)))
then .ok ()
else .error (.typeError "request could not be validated in any environment")

Expand Down