Skip to content

chore(youtube-auth): load client_id/secret from env at build time#100

Merged
ImpulseB23 merged 5 commits intomainfrom
chore/youtube-creds-from-env
Apr 21, 2026
Merged

chore(youtube-auth): load client_id/secret from env at build time#100
ImpulseB23 merged 5 commits intomainfrom
chore/youtube-creds-from-env

Conversation

@ImpulseB23
Copy link
Copy Markdown
Owner

Replaces hard-coded REPLACE_ME placeholders for GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET with option_env! lookups so production credentials are injected via env vars at build time and never land in the repo. Falls back to the same placeholders when unset, preserving the invalid_client failure mode for unconfigured builds.

  • build.rs declares rerun-if-env-changed for both vars so cached builds don't bake in stale values.
  • Both secrets are set on the repo and now wired into release.yml under the tauri-action step so release builds get the real credentials.
  • CI doesn't need them, tests construct AuthManagerBuilder with mock values.
  • Defensive .gitignore for client_secret_*.json downloads from the GCP console.

After merge, a v* tag cut by release-please will produce binaries that complete the YouTube loopback flow against the real Desktop OAuth client.

Replaces hard-coded REPLACE_ME placeholders for GOOGLE_CLIENT_ID and
GOOGLE_CLIENT_SECRET with option_env! lookups so production credentials
are injected via env vars at build time and never committed. Falls back
to the same placeholders when the env vars are unset, preserving the
existing 'invalid_client' failure mode for unconfigured builds.

build.rs now declares rerun-if-env-changed for both vars so cached
builds don't bake in stale values.
Copilot AI review requested due to automatic review settings April 21, 2026 21:10
@github-actions github-actions Bot added rust Rust/Tauri changes ci CI/CD changes size/s 10-100 lines changed labels Apr 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the YouTube OAuth configuration flow so production client_id / client_secret are injected via environment variables at Rust compile time (instead of hard-coded placeholders), aligning with the repo’s goal of keeping credentials out of source control while still allowing unconfigured builds to fail with invalid_client.

Changes:

  • Load GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET via option_env! with placeholder fallbacks.
  • Add cargo:rerun-if-env-changed entries in build.rs to avoid stale cached builds.
  • Wire secrets into the GitHub Actions release workflow and ignore downloaded Google client secret JSON files.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
apps/desktop/src-tauri/src/youtube_auth/mod.rs Switches OAuth constants to compile-time env lookups with placeholder fallback.
apps/desktop/src-tauri/build.rs Ensures Cargo rebuilds when YouTube OAuth env vars change.
.gitignore Prevents accidental commits of Google OAuth client secret JSON downloads.
.github/workflows/release.yml Injects YouTube OAuth env vars into the release build step.

Comment thread apps/desktop/src-tauri/src/youtube_auth/mod.rs Outdated
Comment thread apps/desktop/src-tauri/src/youtube_auth/mod.rs Outdated
Comment thread .github/workflows/release.yml
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ImpulseB23 ImpulseB23 merged commit 866d3b2 into main Apr 21, 2026
13 checks passed
@ImpulseB23 ImpulseB23 deleted the chore/youtube-creds-from-env branch April 21, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD changes rust Rust/Tauri changes size/s 10-100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants