Skip to content

Conversation

@alanwang67
Copy link
Contributor

@alanwang67 alanwang67 commented Jun 23, 2025

Description of changes

Changes for Cedar Generalized Templates . Currently this this works for when a Schema is provided. The API end point that is exposed to end users are a function that allows for the creation of generalized slots and generalized_link which allows users to also provide values besides EntityUIDs.

Issue #, if available

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).
  • A backwards-compatible change requiring a minor version bump to cedar-policy (e.g., addition of a new API).
  • [] A bug fix or other functionality change requiring a patch to cedar-policy.
  • [] A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)
  • A change (breaking or otherwise) that only impacts unreleased or experimental code.

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).
  • [] 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 formal model or DRT infrastructure.
  • 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.)
  • [] Requires updates, but I do not plan to make them in the near future. (Make sure that your changes are hidden behind a feature flag to mark them as experimental.)
  • [] I'm not sure how my change impacts cedar-spec. (Post your PR anyways, and we'll discuss in the comments.)

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • [] Does not require updates because my change does not impact the Cedar language specification.
  • 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-docs. PRs should be targeted at a staging-X.Y branch, not main.)
  • I'm not sure how my change impacts the documentation. (Post your PR anyways, and we'll discuss in the comments.)

@github-actions
Copy link

Coverage Report

Head Commit: 6e439ceb35dbc20d0532cdeb2fb086c2e29052f2

Base Commit: 1d81204095e1c8d830b07555028e6a2dee301799

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 82.40%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/ast/expr.rs 🟢 1/1 100.00%
cedar-policy-core/src/ast/expr_visitor.rs 🔴 0/1 0.00% 58
cedar-policy-core/src/ast/name.rs 🔴 9/13 69.23% 317-319, 324
cedar-policy-core/src/ast/policy.rs 🟢 30/32 93.75% 1381, 1485
cedar-policy-core/src/est/policy_set.rs 🟢 5/5 100.00%
cedar-policy-core/src/est/scope_constraints.rs 🟡 35/48 72.92% 660, 672, 686, 715, 727, 741, 839, 841, 880-884
cedar-policy-core/src/evaluator.rs 🟢 3/3 100.00%
cedar-policy-core/src/parser/cst_to_ast.rs 🔴 0/1 0.00% 2131
cedar-policy-core/src/parser/cst_to_ast/to_ref_or_refs.rs 🟢 5/5 100.00%
cedar-policy-core/src/validator/rbac.rs 🔴 0/1 0.00% 405
cedar-policy-core/src/validator/typecheck.rs 🟢 1/1 100.00%
cedar-policy/src/api.rs 🟢 12/12 100.00%
cedar-policy/src/proto/policy.rs 🟢 2/2 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 83.04%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4806/5522 87.03% 87.03%
cedar-policy 🔴 3280/4728 69.37% 69.36%
cedar-policy-cli 🔴 571/972 58.74% 58.74%
cedar-policy-core 🟢 21281/24889 85.50% 85.53%
cedar-policy-formatter 🟢 1070/1203 88.94% 88.94%
cedar-wasm 🔴 0/29 0.00% 0.00%

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.

Looks good, just a couple minor comments.

I also wonder if we can write more tests for this functionality yet, or does that have to wait for a future PR that completes the CST-to-AST functionality?

@alanwang67
Copy link
Contributor Author

Looks good, just a couple minor comments.

I also wonder if we can write more tests for this functionality yet, or does that have to wait for a future PR that completes the CST-to-AST functionality?

I think tests for the EST portion of the changes will need to wait until the CST-to-AST function is completed.

@github-actions
Copy link

Coverage Report

Head Commit: 0a9a0003e6c60bce8e68f50f3d57b35ba22e38c1

Base Commit: 1d81204095e1c8d830b07555028e6a2dee301799

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.75%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/ast/expr.rs 🟢 1/1 100.00%
cedar-policy-core/src/ast/expr_visitor.rs 🔴 0/1 0.00% 58
cedar-policy-core/src/ast/name.rs 🔴 9/13 69.23% 317-319, 324
cedar-policy-core/src/ast/policy.rs 🟢 30/32 93.75% 1381, 1485
cedar-policy-core/src/est/policy_set.rs 🟢 5/5 100.00%
cedar-policy-core/src/est/scope_constraints.rs 🟡 44/60 73.33% 660, 672, 686, 715, 727, 741, 845, 847-850, 892-896
cedar-policy-core/src/evaluator.rs 🟢 3/3 100.00%
cedar-policy-core/src/parser/cst_to_ast.rs 🔴 0/1 0.00% 2131
cedar-policy-core/src/parser/cst_to_ast/to_ref_or_refs.rs 🟢 5/5 100.00%
cedar-policy-core/src/validator/rbac.rs 🔴 0/1 0.00% 405
cedar-policy-core/src/validator/typecheck.rs 🟢 1/1 100.00%
cedar-policy/src/api.rs 🟢 12/12 100.00%
cedar-policy/src/proto/policy.rs 🟢 2/2 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 83.03%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4806/5522 87.03% 87.03%
cedar-policy 🔴 3280/4728 69.37% 69.36%
cedar-policy-cli 🔴 571/972 58.74% 58.74%
cedar-policy-core 🟢 21290/24901 85.50% 85.53%
cedar-policy-formatter 🟢 1070/1203 88.94% 88.94%
cedar-wasm 🔴 0/29 0.00% 0.00%

Signed-off-by: Alan Wang <[email protected]>
@github-actions
Copy link

Coverage Report

Head Commit: 6dc4a832b24cadba4c4a81941217eafb4da7dbd7

Base Commit: 1d81204095e1c8d830b07555028e6a2dee301799

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.75%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-core/src/ast/expr.rs 🟢 1/1 100.00%
cedar-policy-core/src/ast/expr_visitor.rs 🔴 0/1 0.00% 58
cedar-policy-core/src/ast/name.rs 🔴 9/13 69.23% 317-319, 324
cedar-policy-core/src/ast/policy.rs 🟢 30/32 93.75% 1381, 1485
cedar-policy-core/src/est/policy_set.rs 🟢 5/5 100.00%
cedar-policy-core/src/est/scope_constraints.rs 🟡 44/60 73.33% 660, 672, 686, 715, 727, 741, 845, 847-850, 892-896
cedar-policy-core/src/evaluator.rs 🟢 3/3 100.00%
cedar-policy-core/src/parser/cst_to_ast.rs 🔴 0/1 0.00% 2131
cedar-policy-core/src/parser/cst_to_ast/to_ref_or_refs.rs 🟢 5/5 100.00%
cedar-policy-core/src/validator/rbac.rs 🔴 0/1 0.00% 405
cedar-policy-core/src/validator/typecheck.rs 🟢 1/1 100.00%
cedar-policy/src/api.rs 🟢 12/12 100.00%
cedar-policy/src/proto/policy.rs 🟢 2/2 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 83.03%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4806/5522 87.03% 87.03%
cedar-policy 🔴 3280/4728 69.37% 69.36%
cedar-policy-cli 🔴 571/972 58.74% 58.74%
cedar-policy-core 🟢 21290/24901 85.50% 85.53%
cedar-policy-formatter 🟢 1070/1203 88.94% 88.94%
cedar-wasm 🔴 0/29 0.00% 0.00%

@alanwang67 alanwang67 changed the title Updates for slot info Cedar Generalized Templates Jul 9, 2025
@alanwang67 alanwang67 closed this Aug 1, 2025
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