Exposes policy effect for static policies and templates#275
Merged
shaobo-he-aws merged 5 commits intocedar-policy:mainfrom Jan 10, 2025
Merged
Exposes policy effect for static policies and templates#275shaobo-he-aws merged 5 commits intocedar-policy:mainfrom
shaobo-he-aws merged 5 commits intocedar-policy:mainfrom
Conversation
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
cdisselkoen
approved these changes
Jan 10, 2025
CedarJava/src/main/java/com/cedarpolicy/model/policy/Policy.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
CedarJava/src/main/java/com/cedarpolicy/model/policy/Policy.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
mark-creamer-amazon
approved these changes
Jan 10, 2025
shaobo-he-aws
approved these changes
Jan 10, 2025
muditchaudhary
added a commit
to muditchaudhary/cedar-java
that referenced
this pull request
Jan 13, 2025
…edar-policy#275) Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
muditchaudhary
added a commit
to muditchaudhary/cedar-java
that referenced
this pull request
Jan 13, 2025
…edar-policy#275) Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
This PR adds functionality to expose the
effectof Cedar policies, aligning with the capabilities available in Cedar Rust'sPolicyandTemplateimplementations.Changes
effect()method to determine if a policy is a"permit"or"forbid"policyeffectfor both static policies and templatesImplementation Note
Cedar Java currently uses a unified
Policyclass for both static policies and templates, unlike Cedar Rust which separates these concerns into distinctPolicyandTemplatestructs. To maintain compatibility while exposing this functionality:effect()method first attempts to parse the input as a static policy and gets the effectFuture Considerations
Refactor Cedar Java to mirror Cedar Rust's separation of
PolicyandTemplateinto distinct classes, allowing for better handling of each policy type.