-
Notifications
You must be signed in to change notification settings - Fork 103
Add 2.5.0 schema compatibility parsing functions #1600
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
Conversation
Signed-off-by: John Kastner <jkastner@amazon.com>
This comment was marked as outdated.
This comment was marked as outdated.
Might need to update CI scripts or make the new feature experimental. I didn't want to make it experimental since this isn't something we're experimenting with and looking to stabilize long-term, but our scripts use |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Signed-off-by: John Kastner <jkastner@amazon.com>
609c1d6
to
4f6b6f0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: John Kastner <jkastner@amazon.com>
#[serde(with = "::serde_with::rust::maps_duplicate_key_is_error")] | ||
#[serde(rename = "commonTypes")] | ||
pub common_types: HashMap<CommonTypeId, SchemaType>, | ||
// Key changed from `SmolStr` in 2.5.0 to `UnreserveId` to avoid excess code duplication |
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.
// Key changed from `SmolStr` in 2.5.0 to `UnreserveId` to avoid excess code duplication | |
// Key changed from `SmolStr` in 2.5.0 to `UnreservedId` to avoid excess code duplication |
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.
This is another change from the 2.5.x behavior I think? We will now reject some reserved words in this position which weren't rejected in 2.5.x
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.
yeah, probably slightly different
// Key changed from `SmolStr` in 2.5.0 to `RawName` to avoid excess code duplication | ||
#[serde(default)] | ||
#[serde(rename = "resourceTypes")] | ||
pub resource_types: Option<Vec<RawName>>, | ||
// Key changed from `SmolStr` in 2.5.0 to `RawName` to avoid excess code duplication | ||
#[serde(default)] | ||
#[serde(rename = "principalTypes")] | ||
pub principal_types: Option<Vec<RawName>>, |
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.
is that also a change from 2.5.x behavior? 2.5.x accepted any string, now we only accept RawName
(e.g. no interior whitespace)? I guess presumably 2.5.x was rejecting non-valid-names somewhere later in the pipeline?
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.
These shouldn't be since RFC 9 was released in 2.3.0
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: John Kastner <jkastner@amazon.com>
Co-authored-by: Craig Disselkoen <cdiss@amazon.com>
This comment was marked as duplicate.
This comment was marked as duplicate.
…a.rs Co-authored-by: Craig Disselkoen <cdiss@amazon.com>
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as outdated.
This comment was marked as outdated.
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 81.45% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 81.77% Status: PASSED ✅ Details
|
Description of changes
Tn the 3.0 and 4.0 release we made some breaking changes to the JSON schema format. One which is causing particular problems for customers is disallowing unrecognized attributes in some positions in type definitions where they previously were allowed. This PR copies the structures used to define the JSON schema format from 2.5.0 into
main
branch and uses them to implement a more compatible schema parsing mode.Note that this does not provide full backwards compatibility. Specifically:
appliesTo
specifications disallow unspecified entitiesIssue #, if available
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).cedar-policy
(e.g., addition of a new API).cedar-policy
.cedar-policy-core
,cedar-validator
, etc.)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.)cedar-spec
. (Post your PR anyways, and we'll discuss in the comments.)I confirm that
docs.cedarpolicy.com
(choose one, and delete the other options):cedar-docs
. PRs should be targeted at astaging-X.Y
branch, notmain
.)