Skip to content

Comments

Adding Policy toJson method#172

Merged
mark-creamer-amazon merged 5 commits intocedar-policy:mainfrom
mark-creamer-amazon:main
Jul 3, 2024
Merged

Adding Policy toJson method#172
mark-creamer-amazon merged 5 commits intocedar-policy:mainfrom
mark-creamer-amazon:main

Conversation

@mark-creamer-amazon
Copy link
Contributor

@mark-creamer-amazon mark-creamer-amazon commented Jul 3, 2024

#171

Policy.java

  • Adding toJson method that calls a new JNI method toJsonJni to return the JSON String for the Policy.

interface.rs

  • Added JNI method toJsonJni that takes policy source, constructs a rust Policy struct and returns the Json representation.

Signed-off-by: Mark Creamer <mjcream@amazon.com>
Signed-off-by: Mark Creamer <mjcream@amazon.com>
Copy link
Contributor

@khieta khieta left a comment

Choose a reason for hiding this comment

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

Looks fine. Approving for now, although I'd like to see the test cases added.

As discussed offline: I think it's fine to merge the current approach, even though we'll (likely) be adding support for this in the Json FFI in the future. Once the FFI is updated, we can file an issue to update this code as well.

Signed-off-by: Mark Creamer <mjcream@amazon.com>
Signed-off-by: Mark Creamer <mjcream@amazon.com>
@mark-creamer-amazon mark-creamer-amazon marked this pull request as ready for review July 3, 2024 16:53
@mark-creamer-amazon mark-creamer-amazon merged commit 4223ef2 into cedar-policy:main Jul 3, 2024
@khieta khieta mentioned this pull request Jul 23, 2024
2 tasks
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