feat(google): keyless auth via Workload Identity Federation - #347
Open
sjawhar wants to merge 1 commit into
Open
Conversation
NewClient now branches on whether a service-account key is supplied:
- key present -> existing JWTConfigFromJSON + Subject (domain-wide delegation)
- key absent -> ADC (e.g. an AWS Lambda role federated to GCP via Workload
Identity Federation) + impersonate.CredentialsTokenSource with
Subject, so DWD still applies. Target SA is named by the
GOOGLE_IMPERSONATE_SERVICE_ACCOUNT env var.
Lets ssosync run with zero long-lived credentials where org policy forbids
service-account key creation (constraints/iam.disableServiceAccountKeyCreation).
legion-implementer
Bot
force-pushed
the
wif-keyless
branch
from
July 16, 2026 22:12
4040f66 to
e8f85b2
Compare
|
Thank you @sjawhar I was looking for this exact feature to avoid storing SA keys |
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.
What
Adds a keyless authentication path to
internal/google.NewClient: when no service-account key is supplied, it uses Application Default Credentials to impersonate the target service account (google.golang.org/api/impersonate), carrying the Workspace admin inSubjectso domain-wide delegation still works.google.JWTConfigFromJSON) is unchanged — fully backward compatible.serviceAccountKeyis empty andGOOGLE_IMPERSONATE_SERVICE_ACCOUNTnames the service account to impersonate.Subjectare unchanged.Why
ssosynccurrently requires a downloaded SA key, which is a blocker underiam.disableServiceAccountKeyCreationor when running outside GCP. This enables the modern keyless pattern: e.g. an AWS Lambda federated to GCP via Workload Identity Federation, impersonating the sync SA, with no long-lived credential.Testing
go build/go vet/make ci(golangci-lint +go test ./internal/...) pass. Running in production: an AWS Lambda federated to GCP via WIF, impersonating the Workspace sync service account, syncing groups into IAM Identity Center on a schedule.Closes #345.