Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Update TinyTodo to use templates #82
Update TinyTodo to use templates #82
Changes from 4 commits
1d82e5a
aa93024
2c196db
9cafeb5
09a5053
9923ff1
864956b
b7b2214
0374278
db07fa6
6163e3d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should this set
err = true;
?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 an internal error, which should never happen. I.e., you should not have
template_id()
returnSome(...)
but then havetemplate_links()
returnNone
. I'll change this to useexpect
and produce apanic!
if it ever happens.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.
Thought: We could change the
Policy::template_links()
API to return both the linked values and the template ID, together in anOption
. Then we wouldn't need multiple calls. You could just calltemplate_links()
as a way to test whether a policy is template-linked, and if it is to returnSome(tid,links)
. That would simplify a bunch of logic here, and avoid the need for app code to assume the Cedar-internal invariant.It would be changing the API, but we haven't released the
PolicySet::template_links()
API yet, so it won't be a breaking 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.
cedar-policy/cedar#548 -- I'm of a mixed mind about whether doing this is worth 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.
Should use a UUID here
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 think it is. The list ID is under the app's control, so the last part of the ID is always
[N]
whereN
is a number. The first part alwaysreader[
oreditor[
. The stuff in the middle is always the target user or team's ID with a trailing]
. Is this reasoning flawed? If not, IDs are sure to be an injective function of the three inputs.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 think you're right
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'll add a comment that makes this clear.