-
Notifications
You must be signed in to change notification settings - Fork 89
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
Apply the Cedar schema terminology #1114
Apply the Cedar schema terminology #1114
Conversation
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
…tural-vs-cedar-terminology
Signed-off-by: Shaobo He <shaobohe@amazon.com>
All APIs and comments should be updated. The remaining work is to rename tests, which I will do once a preliminary review is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the proposed renaming.
Will this extend to renaming the policy format?
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the changes look good. The new names are more consistent.
But I'd prefer more symmetry between the public (aka defined in api.rs
) PolicySet
and Schema
interfaces. For PolicySet
we provide:
- a
FromStr
impl (which parses the Cedar syntax) from_json_str
from_json_value
from_json_file
to_json
I think we should provide the same sort of interface for Schema
and SchemaFragment
. So:
- the
FromStr
impl should parse the Cedar syntax, and we should have a separatefrom_json_str
to parse the JSON syntax from_file
should be renamedfrom_json_file
from_file_cedar
should be renamed tofrom_file
- maybe rename
as_cedar
toto_cedar
Good idea. Craig just did it. |
How about using the file suffix (
|
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Co-authored-by: Kesha Hietala <khieta@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
…hub.com:cedar-policy/cedar into 842-unify-human-vs-natural-vs-cedar-terminology
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
Co-authored-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, aside from a small typo.
cedar_policy_validator::json_schema::Fragment::from_cedarschema_str( | ||
src, | ||
Extensions::all_available(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was about to comment here that the lossless schema should be the input src
, but then realized that this is just an issue with the implementation, so I opened an issue instead #1118
Co-authored-by: Kesha Hietala <khieta@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com> Co-authored-by: John Kastner <130772734+john-h-kastner-aws@users.noreply.github.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Description of changes
Issue #, if available
#842
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy
(e.g., changes to the signature of an existing API).I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):cedar-spec
, and how you have tested that your updates are correct.)