Say who is asking when looking a group up - #10
Merged
Conversation
Groups answers GetGroup only for a member of the group's organization, and the caller was not on the request: gRPC keeps incoming and outgoing metadata apart, so the context arrived anonymous. It fails granting a group access to a private resource. Granting to a user or an agent takes a different branch and was unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Found while fixing the same bug in
users(users#31).validatePrincipalSameOrgpasses its incoming server context straight togroupsClient.GetGroup. gRPC keeps incoming and outgoing metadata apart, so the call arrives with nox-identity-id, and Groups rejects it:The failure is
Unauthenticated: missing identity id, surfacing asgroup lookup: ...when granting a group access to a private resource. Granting to a user or an agent takes theidentityClientbranch and is unaffected — which is presumably why it went unnoticed.networksalready readsx-identity-idoff the incoming context for its own authorization; this reuses that to name the caller on the outgoing one.The
identityClient.GetIdentityTypecall in the same function is left alone: the identity service has no authorization checks, so it needs no caller.