feat: env-var credentials for Google Sheets (varlock-friendly)#44
Draft
corriander wants to merge 2 commits into
Draft
feat: env-var credentials for Google Sheets (varlock-friendly)#44corriander wants to merge 2 commits into
corriander wants to merge 2 commits into
Conversation
Support supplying the Google service-account key via the VDD_GSHEETS_CREDENTIALS environment variable (JSON content, not a path). When set and non-empty it takes precedence over the on-disk credentials file; otherwise the existing file path is used unchanged. pygsheets 2.0.6 natively supports this via authorize( service_account_env_var=...), which json-decodes the named env var and builds service_account.Credentials.from_service_account_info. Also ship a repo-root varlock .env.schema (1Password op() resolver, sensitive+required) so the key can be injected at run time without touching disk, and document the pattern plus the OS-dependent file-fallback path in docs/gsheets-integration.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Latest @varlock/1password-plugin is 2.0.0 (peer: varlock ^1.8.0) with identical decorator syntax. Standalone varlock installs download the exact pinned version from npm, so the pin matters; note in the schema how to adjust it for older varlock versions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Adds environment-variable credential support to the Google Sheets integration so the service-account key can be injected at run time (e.g. by varlock from 1Password) instead of living on disk.
GSheetsFacadenow authorizes fromVDD_GSHEETS_CREDENTIALS(the service-account JSON content, not a path) when the variable is set and non-empty; otherwise it falls back to the existingplatformdirs.user_config_dir('vdd')/gsheets_credentials.jsonfile unchanged.authorize(service_account_env_var=...), which json-decodes the named env var and buildsservice_account.Credentials.from_service_account_info. No new dependencies..env.schemafor varlock: 1Passwordop()resolver, declared@sensitive+@required, with placeholder vault/item/field for you to fill in. varlock is your dev tooling and is deliberately not a dependency of vdd.varlock run -- ...pattern, and the OS-dependent file-fallback path (~/.config/vddon Linux vs~/Library/Application Support/vddon macOS) indocs/gsheets-integration.md.Testing
uv run --frozen pytest— 158 passed (154 baseline + 4 new tests covering env-var precedence, empty-value fallback, file fallback, and client caching).Notes
pyproject.toml/uv.lockuntouched.🤖 Generated with Claude Code