bharos commented on code in PR #12096:
URL: https://github.com/apache/gravitino/pull/12096#discussion_r3627334091
##########
core/src/main/java/org/apache/gravitino/UserPrincipal.java:
##########
@@ -113,6 +124,27 @@ public List<UserGroup> getGroups() {
return groups;
}
+ /**
+ * Returns the roles the caller declared active for this request (role
assumption); {@link
+ * ActiveRoles#all()} when none was declared.
+ *
+ * @return the active-role declaration
+ */
+ public ActiveRoles getActiveRoles() {
Review Comment:
I think that no override is needed because equals/hashCode intentionally
cover only identity (username + groups).
I see accessToken is also left out of equals/hashCode as it is also a
per-request variable (similar to activeRoles), whereas the equality is built on
the static user identity.
Adding activeRoles would also be fine since a principal only exists per
request, but I'm inclined to follow the same convention as accessToken and skip
it. Let me know if you'd prefer it included (either ways looks ok to me)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]