Closed shaobo-he-aws closed 3 months ago
All APIs and comments should be updated. The remaining work is to rename tests, which I will do once a preliminary review is done.
I like the proposed renaming.
Will this extend to renaming the policy format?
Good idea. Craig just did it.
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
andSchema
interfaces. ForPolicySet
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
andSchemaFragment
. So:
- the
FromStr
impl should parse the Cedar syntax, and we should have a separatefrom_json_str
to parse the JSON syntaxfrom_file
should be renamedfrom_json_file
from_file_cedar
should be renamed tofrom_file
- maybe rename
as_cedar
toto_cedar
How about using the file suffix (cedarschema
vs json
) to name these APIs? For instance,
Schema::from_str_cedar
to Schema::from_cedarschema_str
Schema::from_file_cedar
to Schema::from_cedarschema_file
SchemaFragment::as_cedar
to SchemaFragment::to_cedarschema
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.)