-
Notifications
You must be signed in to change notification settings - Fork 90
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
Implement RFC 55 #983
Implement RFC 55 #983
Conversation
029038f
to
3536e78
Compare
Note: one integration test will need change |
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.
Added a couple comments -- more will come later. I've decided to work on this review in parts.
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.
A few more comments. I'll wait until Monday to look at the rest of the validator code 😅 Great to see all this special casing for unspecified entities disappear!
None, | ||
Some(resource.clone()), | ||
principal.clone(), | ||
r#"__cedar::"Default""#.parse().unwrap(), |
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 this going to work with RFC52?
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.
Why wouldn't it?
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.
It uses __cedar
?
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.
Did we decide the interactions of those RFCs? I.e., whether __cedar::Default
will be one of the allowed uses of the __cedar
namespace (like __cedar::Long
)?
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.
It has to be or we need to change the RFC. I was assuming it was because otherwise that part of the RFC doesn't make sense in the context of 52
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.
The __cedar
syntax if only mentioned in the Alternatives section of RFC 55, not in the main proposal. But the intention in the alternatives was that __cedar::Default
would be builtin the same way as __cedar::Long
.
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.
(Regardless, I think it should be removed from the tests here since we decided not to support it as part of RFC 55.)
@@ -219,11 +219,11 @@ fn authorize_custom_request() -> Result<(), Box<dyn Error>> { | |||
Decision::Allow | |||
); | |||
|
|||
// Requesting with an unspecified principal or resource will return Deny (but not fail) | |||
// Requesting with default principal or resource will return Deny (but not fail) |
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 test also makes it seem like __cedar::"Default"
is something special. Are these tests really testing something interesting? I suspect they could be removed in favor of existing tests.
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.
Eh, I think it's nice to have a confirmation our migration suggestion is breaking anything
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.
Final batch of comments from me! I'll approve once my comments are addressed & you have a draft of the corresponding cedar-spec
PR to fix DRT.
Draft pr for cedar-integration-tests: cedar-policy/cedar-integration-tests#6 |
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.
Tagging @shaobo-he-aws to review the changes to this file and other human-schema related files.
@@ -21,17 +21,17 @@ use cedar_policy_core::parser::{Node, Loc, unescape::to_unescaped_string, cst::R | |||
use cedar_policy_core::ast::Id; | |||
use smol_str::SmolStr; | |||
use smol_str::ToSmolStr; | |||
use crate::human_schema::ast::{ |
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.
Might be nice to split this white space fix into a separate PR.
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.
Uh I think my editor did that automatically
None, | ||
Some(resource.clone()), | ||
principal.clone(), | ||
r#"__cedar::"Default""#.parse().unwrap(), |
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.
It uses __cedar
?
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.
We should fold this in with the other schema parsing tests. It's doesn't test typechecking at all anymore
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.
There will be tests that do when I add the backwards compat methods
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.
Love this PR and RFC, from the implementation perspective. So many of these changes make things simpler.
None, | ||
Some(resource.clone()), | ||
principal.clone(), | ||
r#"__cedar::"Default""#.parse().unwrap(), |
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.
Did we decide the interactions of those RFCs? I.e., whether __cedar::Default
will be one of the allowed uses of the __cedar
namespace (like __cedar::Long
)?
DRT PR: cedar-policy/cedar-spec#366 |
810c5ad
to
c9cef68
Compare
Co-authored-by: Kesha Hietala <khieta@amazon.com> Co-authored-by: John Kastner <130772734+john-h-kastner-aws@users.noreply.github.com> Co-authored-by: Craig Disselkoen <cdiss@amazon.com> Signed-off-by: Aaron Eline <aeline+github@amazon.com>
c9cef68
to
1c91167
Compare
Only remaining comment from me is that you're using |
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.
LGTM
I think we can keep these tests. I'll add them to my PR implementing RFC 52 when I sync it with main. |
Signed-off-by: Aaron Eline <aeline+github@amazon.com>
Description of changes
(partially) Implements RFC 55
This does not implement the backwards compatibility functions, saving that for a second PR as this one is already large.
Issue #, if available
N/A
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):