Skip to content

Conversation

lucajone
Copy link
Contributor

Description of changes

This change adds Expression::new_duration, Expression::new_datetime, RestrictedExpression::new_duration and RestrictedExpression::new_datetime methods to the public API. These are analogous to the existing new_ip, etc. methods for constructing expressions with extension function values, but for the new datetime and duration types from RFC 80.

It also corrects some incorrect uses of assert_matches! in unit tests for the old new_ip and new_decimal functions.

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.

@lucajone lucajone force-pushed the main branch 2 times, most recently from e5f2734 to 9ee2d3a Compare May 14, 2025 16:56
…strictedExpression`

Signed-off-by: Lucas Jones <lucajone@amazon.com>
Copy link

Coverage Report

Head Commit: e5f27343e84d594ec23d9d0ed6f1b870496b1f9a

Base Commit: 11d01bb1f9570aee0e4bd1520696c338051e63f7

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 🟢 38/38 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.76%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3149/4566 68.97% --
cedar-policy-cli 🔴 571/972 58.74% --
cedar-policy-core 🟢 11979/14214 84.28% --
cedar-policy-formatter 🟢 914/1043 87.63% --
cedar-policy-validator 🟢 8841/10307 85.78% --
cedar-wasm 🔴 0/29 0.00% --

Copy link

Coverage Report

Head Commit: 9ee2d3a8a067c5ae52ef4826ca3b4980b4804042

Base Commit: 11d01bb1f9570aee0e4bd1520696c338051e63f7

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 🟢 38/38 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.76%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3149/4566 68.97% --
cedar-policy-cli 🔴 571/972 58.74% --
cedar-policy-core 🟢 11979/14214 84.28% --
cedar-policy-formatter 🟢 914/1043 87.63% --
cedar-policy-validator 🟢 8841/10307 85.78% --
cedar-wasm 🔴 0/29 0.00% --

Copy link

Coverage Report

Head Commit: 212ac80eeea32dd9dfb184673330c2fc804cf61d

Base Commit: 11d01bb1f9570aee0e4bd1520696c338051e63f7

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 🟢 38/38 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 81.76%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-policy 🔴 3149/4566 68.97% --
cedar-policy-cli 🔴 571/972 58.74% --
cedar-policy-core 🟢 11979/14214 84.28% --
cedar-policy-formatter 🟢 914/1043 87.63% --
cedar-policy-validator 🟢 8841/10307 85.78% --
cedar-wasm 🔴 0/29 0.00% --

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.

looks great

@cdisselkoen cdisselkoen merged commit 8931c9b into cedar-policy:main May 14, 2025
20 checks passed
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