Skip to content

Conversation

khieta
Copy link
Contributor

@khieta khieta commented Jul 10, 2024

Description of changes

  • Changed the public Policy::parse and Template::parse APIs to use an Option<PolicyId> instead of Option<String> to set the policy id
  • Changed the internal parse_policy* APIs similarly
  • Updated tests to use PolicyId::new instead of PolicyId::from_str because it's prettier

The diff is largely just the result of updating test cases. The only interesting edits are in:

  • cedar-policy-core/src/parser.rs
  • cedar-policy/CHANGELOG.md
  • cedar-policy/src/api.rs
  • cedar-policy/src/api/id.rs
  • cedar-policy/src/ffi/utils.rs

Issue #, if available

Resolves #1049

Checklist for requesting a review

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

  • A breaking change requiring a major version bump to cedar-policy (e.g., changes to the signature of an existing 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.)

Copy link
Contributor

@cdisselkoen cdisselkoen left a comment

Choose a reason for hiding this comment

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

LGTM

@khieta khieta merged commit 51545d2 into main Jul 10, 2024
@khieta khieta deleted the khieta/cedar-1049 branch July 10, 2024 16:56
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.

Change Policy::parse to take a PolicyId
3 participants