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

Document the JSON format used for DRT #125

Open
2 tasks
khieta opened this issue Sep 28, 2023 · 1 comment
Open
2 tasks

Document the JSON format used for DRT #125

khieta opened this issue Sep 28, 2023 · 1 comment
Labels
backlog We hope to work on this in the future documentation Improvements or additions to documentation feature-request Request for a new feature

Comments

@khieta
Copy link
Contributor

khieta commented Sep 28, 2023

Category

DRT infrastructure

Describe the feature you'd like to request

PR #124 makes it somewhat easier to customize DRT by abstracting away the details of our Dafny/Java implementation. This allows users to (with minimal work) provide their own implementation of Cedar to differentially test against the cedar-policy crate. However, users must figure out for themselves how to translate cedar-policy types like Request and Entities into appropriate format for their implementation.

In practice, we expect users to use JSON to pass data between Rust and their custom implementation, which is what we currently do for our Dafny/Java implementation. In particular, we rely on the generated serde_json JSON representation of the cedar-policy types. We should document this somewhere, and perhaps change the interfaces introduced in PR #124 to use JSON inputs/outputs rather than structured cedar-policy types.

Describe alternatives you've considered

No response

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@khieta khieta added documentation Improvements or additions to documentation feature-request Request for a new feature backlog We hope to work on this in the future labels Sep 28, 2023
@cdisselkoen
Copy link
Contributor

cdisselkoen commented Sep 28, 2023

A note that the code in #124 actually depends on the cedar-policy-core types like Request and Entities, not the cedar-policy ones. (In fact, the Request in cedar-policy doesn't implement Serialize or Deserialize, and that was intentional on our part.) This means that the JSON format used for DRT is not stable, and can change with internal implementation changes in Core. #75 proposes to change this, and should probably be done before we tackle this issue here, to avoid wasting work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to work on this in the future documentation Improvements or additions to documentation feature-request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants