Fix credentials for groups settings api#5165
Merged
ViniciustCosta merged 1 commit intomasterfrom Feb 13, 2026
Merged
Conversation
javanlacerda
approved these changes
Feb 13, 2026
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.
Motivation
In order to call the groups settings API to allow adding external members to groups, the service account credentials need to contain the correct scope
'https://www.googleapis.com/auth/apps.groups.settings'to verify its admin role in the correspondent Google Workspace (oss-fuzz.com in this case).Rationale
Calling the get default creds with this scope does not work correctly. My guess is that the GKE/GCE gets the Application Default Credentials via its metadata server, which is configured by default to issue tokens within a limited set of defined scopes (e.g.,
cloud-platform).An alternative is self-impersonating the service account to generate new Credentials with the right scopes. This avoids having to deal with creating a secret containing a new key for the default service account and then generating the credentials based on this key.
Note: For this to work, the SA must have the
Service Account Token Creatorrole. This is already set for the Compute Engine default account in all prod environments.Tests
Tested in dev by running the oss_fuzz_cc_groups cronjob with test groups. logs: https://screenshot.googleplex.com/76a7vJjjKC4NhCe.png
Check complete investigation on: b/477964128