Skip to content

internal/schema/parser: support Path type in context decl#115

Merged
patjakdev merged 1 commit intocedar-policy:mainfrom
strongdm:patjak/add-path-to-context-decl
Oct 22, 2025
Merged

internal/schema/parser: support Path type in context decl#115
patjakdev merged 1 commit intocedar-policy:mainfrom
strongdm:patjak/add-path-to-context-decl

Conversation

@patjakdev
Copy link
Copy Markdown
Collaborator

Issue #, if available:

Description of changes:

Although not officially documented in the Cedar schema grammar, Paths are allowed to be specified for the type of the context for an action. For example:

type commonContext = {
    now: __cedar::datetime,
    origin: __cedar::ipaddr,
};

action edit appliesTo {
    principal: User,
    resource: Document,
    context: commonContext,
};

@patjakdev patjakdev force-pushed the patjak/add-path-to-context-decl branch from 17ad664 to ad84cc7 Compare October 21, 2025 21:34
Although not officially documented in the [Cedar schema grammar](https://docs.cedarpolicy.com/schema/human-readable-schema-grammar.html), `Path`s are allowed to be specified for the type of the context for an action. For example:

```
type commonContext = {
    now: __cedar::datetime,
    origin: __cedar::ipaddr,
};

action edit appliesTo {
    principal: User,
    resource: Document,
    context: commonContext,
};
```

Signed-off-by: Patrick Jakubowski <patrick.jakubowski@strongdm.com>
@patjakdev patjakdev force-pushed the patjak/add-path-to-context-decl branch from ad84cc7 to 5fdb1c7 Compare October 21, 2025 21:51
@patjakdev patjakdev requested a review from philhassey October 21, 2025 21:52
@patjakdev patjakdev marked this pull request as ready for review October 21, 2025 21:52
Copy link
Copy Markdown
Contributor

@philhassey philhassey left a comment

Choose a reason for hiding this comment

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

LGTM

@patjakdev patjakdev merged commit 0408738 into cedar-policy:main Oct 22, 2025
2 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.

2 participants