Skip to content

pst api adjustments, additional doc#2316

Open
victornicolet wants to merge 2 commits intomainfrom
victornicolet/pst-refinements
Open

pst api adjustments, additional doc#2316
victornicolet wants to merge 2 commits intomainfrom
victornicolet/pst-refinements

Conversation

@victornicolet
Copy link
Copy Markdown
Contributor

Description of changes

This makes a few adjustments in the PST API:

  • try_into_pst now suceeds even if there is no lossless representation. This allows using try_into_pst for policies that are residuals from TPE (prior implementation would return an error). Eliminates an error type.
  • adds documentation and examples.
  • adds PartialEq and Eq to the PST types that were missing it,
  • re-exports some types from dependencies in the pst module, so that crates depending on Cedar don't have to add dependencies, or manage dependency version to match Cedar's.

The last change is probably the one most worth discussing, but I think it makes the API cleaner.

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

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

@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: f0f19dd1102a24a3187793d4e283d5089bbac864

Base Commit: 18cfa43f342371e0f694249c020b353728b56100

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy/src/api.rs 🟢 14/14 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 87.67%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 4255/5363 79.34% --
cedar-policy-cli 🟡 1210/1614 74.97% --
cedar-policy-core 🟢 23907/27178 87.96% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6752/7262 92.98% --
cedar-wasm 🔴 0/28 0.00% --

Signed-off-by: Victor Nicolet <victornl@amazon.com>
@victornicolet victornicolet force-pushed the victornicolet/pst-refinements branch from f0f19dd to 52af9a5 Compare April 15, 2026 18:51
@victornicolet victornicolet mentioned this pull request Apr 15, 2026
14 tasks
@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: 52af9a55c9b8900f51ac4166511eb56a3e0061a7

Base Commit: 18cfa43f342371e0f694249c020b353728b56100

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy/src/api.rs 🟢 14/14 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 87.67%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 4255/5363 79.34% --
cedar-policy-cli 🟡 1210/1614 74.97% --
cedar-policy-core 🟢 23907/27178 87.96% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6752/7262 92.98% --
cedar-wasm 🔴 0/28 0.00% --

@john-h-kastner-aws
Copy link
Copy Markdown
Contributor

I didn't make any changes to the existing TPE code, so you can just overwrite tpe.rs with your updated version of the module

@github-actions
Copy link
Copy Markdown

Coverage Report

Head Commit: 7bc7281d86956b8741309615d3e627ea2fc372c4

Base Commit: 63b79962b5f3b42d67b02df01e66b860b20fe539

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 100.00%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy/src/api.rs 🟢 14/14 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 87.66%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 4244/5352 79.30% --
cedar-policy-cli 🟡 1210/1614 74.97% --
cedar-policy-core 🟢 23907/27178 87.96% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6752/7262 92.98% --
cedar-wasm 🔴 0/28 0.00% --

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.

2 participants