Skip to content

Conversation

@khieta
Copy link
Contributor

@khieta khieta commented Mar 11, 2024

Description of changes

  • Deprecated TypeErrorKind::ImpossiblePolicy
  • Added ValidationWarningKind::ImpossiblePolicy ⬅️ this requires a minor version bump
  • Moved the definition of ValidationWarning to validation_results.rs
  • Updated unit tests ⬅️ this accounts for most of the diff

As discussed in #539, ImpossiblePolicy is different from our other errors because it does not signal a potential authorization-time error. Instead, it indicates a policy that will not apply for any valid request.

As we increase the precision of the Cedar typechecker, ImpossiblePolicy errors will occur in more cases (a breaking change), while other types of errors will occur in fewer cases (a non-breaking change). So to make potential changes easier going forward, we've decided to demote ImpossiblePolicy to a warning. We consider this a non-breaking change because all policies that previously validated will continue to validate.

Issue #, if available

#539

Checklist for requesting a review

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

  • A backwards-compatible change requiring a minor version bump to cedar-policy (e.g., addition of a new API).

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

  • Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).

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

  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-spec, and how you have tested that your updates are correct.)

Disclaimer

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

@khieta khieta added the 3.2 Features for 3.2 label Mar 11, 2024
@khieta khieta force-pushed the khieta/impossible-policy branch from 5a45b0e to 0b22686 Compare March 11, 2024 21:57
@khieta khieta force-pushed the khieta/impossible-policy branch from 0b22686 to b2e34e8 Compare March 11, 2024 22:01
khieta added 2 commits March 11, 2024 18:03
Signed-off-by: Kesha Hietala <[email protected]>
Signed-off-by: Kesha Hietala <[email protected]>
@khieta
Copy link
Contributor Author

khieta commented Mar 11, 2024

Note: the corpus test failure is expected since the tests were generated when we expected "impossible policy" to be an error (and thus the test says that the policy should not validate)

Signed-off-by: Kesha Hietala <[email protected]>
@khieta khieta mentioned this pull request Mar 13, 2024
3 tasks
@khieta
Copy link
Contributor Author

khieta commented Mar 15, 2024

Fyi: this PR will be on hold temporarily since I'll be OOTO until next Wednesday. I'm holding off on merging for now because I don't want to leave the corpus tests in a broken state.

@khieta
Copy link
Contributor Author

khieta commented Mar 22, 2024

I've pulled in the latest changes from main, so this PR is ready to merge (pending re-approval). Other PRs should expect the Run cargo test --verbose --features "integration-testing" -- --ignored step of CI to fail until I can manually update the corpus tests. I expect to do this either this weekend or early next week.

@khieta khieta merged commit c16e932 into main Mar 22, 2024
@khieta khieta deleted the khieta/impossible-policy branch March 22, 2024 14:12
shaobo-he-aws pushed a commit that referenced this pull request May 3, 2024
john-h-kastner-aws pushed a commit that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.2 Features for 3.2

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants