Skip to content

fix(auth): trim OAuth credentials during setup - #908

Open
y4ho0 wants to merge 1 commit into
googleworkspace:mainfrom
y4ho0:fix/trim-oauth-credentials
Open

fix(auth): trim OAuth credentials during setup#908
y4ho0 wants to merge 1 commit into
googleworkspace:mainfrom
y4ho0:fix/trim-oauth-credentials

Conversation

@y4ho0

@y4ho0 y4ho0 commented Aug 23, 2026

Copy link
Copy Markdown

Description

Closes #882.

Interactive OAuth setup now trims leading and trailing whitespace from pasted Client IDs and client secrets before validation and persistence. Whitespace-only values are rejected as empty, while characters inside a credential are preserved.

This prevents invisible spaces or newlines copied from Google Cloud Console from producing an invalid_client response during login.

Dry Run Output: Not applicable; this changes interactive credential input and does not create a Discovery API request.

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace -- --test-threads=1 (785 tests passed)
  • cargo clippy -- -D warnings -A clippy::collapsible_match
  • cargo clippy -- -D warnings is currently blocked on unchanged main-branch code at helpers/script.rs:173 by the Rust 1.97 collapsible_match lint

Checklist:

  • My code follows the AGENTS.md guidelines (no generated google-* crates).
  • I have run cargo fmt --all to format the code perfectly.
  • I have run cargo clippy -- -D warnings and resolved all warnings. See the documented pre-existing main-branch warning above; the changed code is clean.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have provided a Changeset file to document my changes.

@changeset-bot

changeset-bot Bot commented Aug 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cb7c6a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-cla

google-cla Bot commented Aug 23, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth setup: pasted OAuth Client ID is not trimmed — trailing whitespace causes 401 invalid_client at login

2 participants