-
Notifications
You must be signed in to change notification settings - Fork 290
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
Cleanup the core messages now that v0 is gone #652
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,19 +113,15 @@ func (cds *crdbDatastore) Watch(ctx context.Context, afterRevision datastore.Rev | |
|
||
oneChange := &core.RelationTupleUpdate{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit / For a follow up: the direct proto instantiation tends to be rather verbose, would it make sense to create helper methods to help with readability? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do have some helper methods defined in various places, so we could in theory grab one, but I like that everything is explicitly named here |
||
Tuple: &core.RelationTuple{ | ||
ObjectAndRelation: &core.ObjectAndRelation{ | ||
ResourceAndRelation: &core.ObjectAndRelation{ | ||
Namespace: pkValues[0], | ||
ObjectId: pkValues[1], | ||
Relation: pkValues[2], | ||
}, | ||
User: &core.User{ | ||
UserOneof: &core.User_Userset{ | ||
Userset: &core.ObjectAndRelation{ | ||
Namespace: pkValues[3], | ||
ObjectId: pkValues[4], | ||
Relation: pkValues[5], | ||
}, | ||
}, | ||
Subject: &core.ObjectAndRelation{ | ||
Namespace: pkValues[3], | ||
ObjectId: pkValues[4], | ||
Relation: pkValues[5], | ||
}, | ||
}, | ||
} | ||
|
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.
If a
Subject
does also have aRelation
, which isn't it namedSubjectAndRelation
, or perhaps why not namingResourceAndRelation
justRelation
?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 real change would be to break the relation out from both, but that is a major refactor, so I left it using ObjectAndRelation. Since I did so, I wanted to be clear that the relation for the operation is in the first ONR