Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding toJson JNI method for Policy object #187

Conversation

mark-creamer-amazon
Copy link
Contributor

@mark-creamer-amazon mark-creamer-amazon commented Aug 13, 2024

#171

Backporting changes from #172

Tested these changes locally with the tip of cedar-java-hello-world 3.2.x

// permit(principal == User::"Alice", action == Action::"View_Photo", resource in Album::"Vacation");
Set<Policy> policySet = buildPolicySlice();
Policy policy = policySet.iterator().next();
System.out.println(policy.toJson());

{"effect":"permit","principal":{"op":"==","entity":{"type":"User","id":"Alice"}},"action":{"op":"==","entity":{"type":"Action","id":"View_Photo"}},"resource":{"op":"in","entity":{"type":"Album","id":"Vacation"}},"conditions":[]}

@mark-creamer-amazon mark-creamer-amazon merged commit d8ba863 into cedar-policy:release/3.2.x Aug 13, 2024
4 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