feat(auth): support env var token injection for op run workflows#1
Open
feat(auth): support env var token injection for op run workflows#1
Conversation
Allow bypassing OAuth flow and keyring by setting GOG_CLIENT_ID, GOG_CLIENT_SECRET, and GOG_REFRESH_TOKEN environment variables. This enables 1Password CLI (op run) injection of credentials. Resolution order: Service Account JSON > Env vars > Keyring.
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.
Summary
GOG_CLIENT_ID,GOG_CLIENT_SECRET, andGOG_REFRESH_TOKENenvironment variablesop run) injection of credentials without touching keyring or credentials.jsonGOG_ACCOUNTis missingUsage
Files changed
internal/googleapi/client_env.gotokenSourceFromEnv()internal/googleapi/client_env_test.gointernal/googleapi/client.gointernal/cmd/account.goGOG_ACCOUNTTest plan
go build ./...go test ./internal/googleapi/...GOG_ACCOUNT, rungogcli gmail search, confirm no keyring accessSummary by cubic
Adds env var-based token source so op run can inject Google OAuth credentials without using the keyring or OAuth flow. Service account JSON remains preferred, then env vars, then keyring.
Written for commit f0ae9b7. Summary will update on new commits.