fix(auth): inject Google OAuth credentials at build time - #247
Merged
Conversation
Remove the hardcoded Google OAuth client ID and client secret from source and inject them at compile time from GitHub Actions secrets (WUKONG_GOOGLE_CLIENT_ID / WUKONG_GOOGLE_CLIENT_SECRET), following the same pattern as WUKONG_HONEYCOMB_API_KEY in the telemetry crate. - prod builds (--features prod) fail at compile time if the secrets are missing, so a release can never ship without credentials - dev builds fall back to empty strings so local builds and tests work without any secrets Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…alues - Add GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET to Cross.toml passthrough so the Dockerized Linux builds can see them (root cause of the Linux CI failures) - Rename env vars to match the existing GOOGLE_CLIENT_SECRET repo secret naming - Add compile-time asserts: a missing Actions secret expands to an empty string which env!() accepts, so prod builds now fail loudly instead of shipping blank credentials Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The client ID is a public identifier, so it lives in Actions variables (vars.GOOGLE_CLIENT_ID) rather than secrets; only the client secret stays in secrets. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
maail
approved these changes
Jul 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.
Summary
Removes the hardcoded Google OAuth client ID and client secret from
cli/src/auth/google_cloud.rsand injects them at compile time from GitHub Actions secrets, following the same pattern already used forWUKONG_HONEYCOMB_API_KEYin the telemetry crate.--features prod): credentials come fromenv!("WUKONG_GOOGLE_CLIENT_ID")/env!("WUKONG_GOOGLE_CLIENT_SECRET")— the build fails at compile time if the secrets are missing, so a release can never ship without credentials.option_env!, so localcargo build/cargo testand contributor builds work without any secrets (set the env vars locally to test the Google login flow).ci.ymlandrelease.ymlinject the secrets at the workflowenv:level (CI's build job also compiles with--features prod).Required before merge / next release
WUKONG_GOOGLE_CLIENT_IDandWUKONG_GOOGLE_CLIENT_SECRETas Actions secrets in repo settings — prod builds fail without them.invalid_client) until usersbrew upgrade wukong.Notes
Testing
cargo check(dev, no env vars) ✅cargo check --features prodwith env vars set ✅cargo fmt+cargo clippy— clean (2 pre-existing warnings unrelated to this change)cargo test— one pre-existing snapshot failure (applicationtest, local-environment DNS issue) that also fails on unmodifiedmain; all other tests pass🤖 Generated with Claude Code