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

Fix in typechecking #462

Merged
merged 5 commits into from
Dec 1, 2023
Merged

Fix in typechecking #462

merged 5 commits into from
Dec 1, 2023

Conversation

john-h-kastner-aws
Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws commented Dec 1, 2023

The partial schema PR (#79) inadvertently changed the behavior of, e.g., principal in Action::"view" to be an error, claiming that the Action entity type is not defined. It should instead recognize that actions may only be in other actions and give the expression type False. Our unit tests checked the User::"alice" in Action::"view" case, but did not test when the left side of the in was a var.

The change in this PR is (choose one, and delete the other options):

  • A change (breaking or otherwise) that only impacts unreleased or experimental code.

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar Dafny model or DRT infrastructure.

Disclaimer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The partial schema PR inadvertantly changed the behavior of, e.g.,
`princpal in Action::"view"` to be an error, claiming that the `Action`
entity type is not defined. It should instead recognize that actions may
only be `in` other actions and give the expression type `False`.

Our unit tests check the `User::"alice" in Action::"view"` case, but did
not test the case when the left side of the `in` was a var.
@john-h-kastner-aws john-h-kastner-aws changed the title Fix/jkastner/in Fix in typechecking Dec 1, 2023
Copy link
Contributor

@khieta khieta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments.

cedar-policy-validator/src/schema.rs Outdated Show resolved Hide resolved
@john-h-kastner-aws john-h-kastner-aws merged commit be410af into main Dec 1, 2023
7 checks passed
john-h-kastner-aws added a commit that referenced this pull request Dec 1, 2023
john-h-kastner-aws added a commit that referenced this pull request Dec 1, 2023
@john-h-kastner-aws john-h-kastner-aws deleted the fix/jkastner/in branch December 1, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants