Skip to content

Conversation

cdisselkoen
Copy link
Contributor

Description of changes

Makes two more changes to the protobuf format:

  1. changes the request context from Expr to map<string, Expr>, since it's required to be a record anyway. This aligns with the format for entity attributes which is also map<string, Expr>.
  2. in PolicySet, changes both templates and links from a (map from id to object) to (just a list of object), since the objects in question already contain the ids. This makes the encoding faster and more compact.

Issue #, if available

Checklist for requesting a review

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

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

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.

Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Copy link

Coverage Report

Head Commit: 8dede318393789b65d2a41c9b96bfd1dac481d77

Base Commit: d2ab99af3825f233991e8e68e4434c8996f4bcd0

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 84.78%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy/src/proto/ast.rs 🟡 25/32 78.12% 658-660, 667-670
cedar-policy/src/proto/policy.rs 🟢 14/14 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.49%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3052/4395 69.44% 69.60%
cedar-policy-cli 🔴 538/927 58.04% 58.04%
cedar-policy-core 🟢 11639/13881 83.85% 83.85%
cedar-policy-formatter 🟢 914/1043 87.63% 87.63%
cedar-policy-validator 🟢 8242/9650 85.41% 85.41%
cedar-wasm 🔴 0/29 0.00% 0.00%

Copy link

Coverage Report

Head Commit: 6ada363f3255c42a165f9a5ef8845cf37f9f8a66

Base Commit: 543a7331e2c10fc20c494ee9ec7177d1bfa86a08

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 84.78%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy/src/proto/ast.rs 🟡 25/32 78.12% 658-660, 667-670
cedar-policy/src/proto/policy.rs 🟢 14/14 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.49%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3055/4405 69.35% 69.51%
cedar-policy-cli 🔴 538/927 58.04% 58.04%
cedar-policy-core 🟢 11657/13899 83.87% 83.87%
cedar-policy-formatter 🟢 914/1043 87.63% 87.63%
cedar-policy-validator 🟢 8305/9724 85.41% 85.41%
cedar-wasm 🔴 0/29 0.00% 0.00%

@cdisselkoen cdisselkoen merged commit ea9b3af into main Mar 25, 2025
19 of 20 checks passed
@cdisselkoen cdisselkoen deleted the cdisselkoen/protobuf-tweaks branch March 25, 2025 18:20
cdisselkoen added a commit that referenced this pull request Mar 25, 2025
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
cdisselkoen added a commit that referenced this pull request Mar 25, 2025
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
jv-garcia pushed a commit to jv-garcia/cedar that referenced this pull request May 6, 2025
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
jv-garcia pushed a commit to jv-garcia/cedar that referenced this pull request May 6, 2025
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
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