Skip to content

adding support for linked policies in symcc#2338

Open
victornicolet wants to merge 1 commit into
mainfrom
victornicolet/symcc-template-linked-support
Open

adding support for linked policies in symcc#2338
victornicolet wants to merge 1 commit into
mainfrom
victornicolet/symcc-template-linked-support

Conversation

@victornicolet

@victornicolet victornicolet commented May 6, 2026

Copy link
Copy Markdown
Member

This adds support for templated-linked policies in symcc.

DRT changes: cedar-policy/cedar-spec#948

Issue #2288

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

  • 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: Victor Nicolet <victornl@amazon.com>
@victornicolet victornicolet requested a review from Copilot May 6, 2026 15:28
@victornicolet victornicolet changed the title adding support for linked policies in symcc [draft] adding support for linked policies in symcc May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Coverage Report

Head Commit: 746fe3cc72902525a4b873096e2259f088a3bee6

Base Commit: 844cdb54feb2875f3a9f958c4d78b514f08a327f

Download the full coverage report.

Coverage of Added or Modified Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 97.30%

Status: PASSED ✅

Details
File Status Covered Coverage Missed Lines
cedar-policy-cli/src/command/symcc.rs 🟢 8/9 88.89% 110
cedar-policy-symcc/src/symcc.rs 🟢 26/26 100.00%
cedar-policy-symcc/src/symcc/env.rs 🟢 2/2 100.00%

Coverage of All Lines of Rust Code

Required coverage: 80.00%

Actual coverage: 87.77%

Status: PASSED ✅

Details
Package Status Covered Coverage Base Coverage
cedar-language-server 🟢 4722/5102 92.55% --
cedar-policy 🟡 4452/5589 79.66% --
cedar-policy-cli 🟡 1228/1621 75.76% --
cedar-policy-core 🟢 24325/27627 88.05% --
cedar-policy-formatter 🟢 914/1088 84.01% --
cedar-policy-symcc 🟢 6785/7280 93.20% --
cedar-wasm 🔴 0/28 0.00% --

@victornicolet victornicolet changed the title [draft] adding support for linked policies in symcc adding support for linked policies in symcc May 6, 2026
@victornicolet victornicolet marked this pull request as ready for review May 6, 2026 19:15
pub policy_format: PolicyFormat,
/// File containing template-linked policies
#[arg(short = 'k', long = "template-linked", value_name = "FILE")]
pub template_linked_file: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need a separate SymccPoliciesArg now that it accepts templates links? I think I remember @katherine-hough duplicated in order to not accept templates here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

John is correct see: afae911

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, I should have remembered too.

env: &RequestEnv<'_>,
schema: &Schema,
) -> Result<Policy> {
// For linked policies, create a static equivalent by resolving slots in the

@john-h-kastner-aws john-h-kastner-aws May 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we change the model to match this? IIRC, the lean FFI layer currently does this, but it could make sense to handle this is the corresponding lean function

here, I think:

https://github.com/cedar-policy/cedar-spec/blob/92de50d691a8f59bc7bdfce37dd070e6d50a0b58/cedar-lean/Cedar/SymCC.lean#L58

might be a larger update than i'm thinking though

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes the Lean FFI layer is currently doing the slot replacement.
I attempted changing that function in Lean, but it would be a large update. We can decide that it's necessary though.

Another difference between the Rust and Lean is that the Lean env doesn't get the extra information that the linked env in Rust passes. However, trying to integrate that alone in Lean doesn't seem trivial either.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you have a decent idea of what would be needed, can you type up an issue on cedar-spec?

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