Skip to content

Conversation

john-h-kastner-aws
Copy link
Contributor

Description of changes

The parser previously failed to lex invalid templates slots, so principal in ?princpl would fail with invalid token. Fix #451.

The error is now

  × failed to parse policy set
  ╰─▶ expected an entity uid or matching template slot, found ?principl instead of ?principal
   ╭─[<stdin>:1:1]
 1 │ permit(principal in ?principl, action, resource);
   ·                     ─────────
   ╰────

Issue #, if available

Checklist for requesting a review

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

  • A bug fix or other functionality change requiring a patch to cedar-policy.

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):

  • 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.

Co-authored-by: Craig Disselkoen <[email protected]>
@john-h-kastner-aws john-h-kastner-aws merged commit 5b49902 into main Dec 11, 2023
@john-h-kastner-aws john-h-kastner-aws deleted the err/jkastner/slots branch December 11, 2023 16:18
@sarahcec sarahcec added the 3.1 Features for 3.1 label Jan 23, 2024
shaobo-he-aws pushed a commit that referenced this pull request May 20, 2025
Signed-off-by: Craig Disselkoen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.1 Features for 3.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error messages for invalid template slots
5 participants