Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getter for Schema to Validator #1524

Merged
merged 3 commits into from
Mar 12, 2025
Merged

Conversation

cdisselkoen
Copy link
Contributor

Description of changes

Allows callers who have already constructed a Validator, to take advantage of the getters on Schema (and its Protobuf trait implementation). This is necessary because constructing a Validator consumes the Schema.

Issue #, if available

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

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

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>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Copy link

github-actions bot commented Mar 7, 2025

Coverage Report

Head Commit: 58708367c0abc3ec1df097dd3cfa3ed86d63b757

Base Commit: 81ef1f5644d9a8be89f523339a1b1058f247560f

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 0.00%

Status: FAILED ❌

Details
File Status Covered Coverage Missed Lines
cedar-policy-validator/src/lib.rs 🔴 0/3 0.00% 108-110
cedar-policy/src/api.rs 🔴 0/3 0.00% 1322-1324

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 80.75%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3059/4395 69.60% 69.65%
cedar-policy-cli 🔴 539/927 58.14% 58.14%
cedar-policy-core 🟢 11328/13778 82.22% 82.23%
cedar-policy-formatter 🟢 914/1043 87.63% 87.63%
cedar-policy-validator 🟢 8242/9650 85.41% 85.44%
cedar-wasm 🔴 0/29 0.00% 0.00%

@cdisselkoen cdisselkoen merged commit e2da2ca into main Mar 12, 2025
19 of 20 checks passed
@cdisselkoen cdisselkoen deleted the cdisselkoen/schema-getter branch March 12, 2025 13:45
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