fix(auth): preserve isolated credentials on decryption failure - #891
fix(auth): preserve isolated credentials on decryption failure#891mandalorianuy wants to merge 1 commit into
Conversation
(cherry picked from commit d594aec746955373976619876e95f237872ab0db)
🦋 Changeset detectedLatest commit: 27619dc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
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. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the robustness and security of the credential management system. By changing the behavior to fail closed on decryption errors, it prevents potential silent authentication issues. Additionally, it introduces smarter defaults for key storage backends when using isolated configuration directories, enhancing support for multi-profile environments. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the CLI's credential handling to fail closed upon decryption failure, preserving the encrypted credentials and token caches instead of deleting them and falling through to other sources. It also updates the keyring backend selection to default to file-based storage when a custom configuration directory is specified, preventing profile conflicts. As there are no review comments, I have no feedback to provide.
Description
Preserve isolated encrypted credentials and token caches when decryption fails, fail closed instead of silently authenticating with another credential source, and default custom config directories to profile-local file key storage unless the backend is explicitly overridden.
Source implementation commit:
d594aec746955373976619876e95f237872ab0db.Delivery commit:
27619dc7ccbf46f7cdf85d6c54c5bcc3a1ad42f2(cherry-picked with traceability).Dry Run Output:
Not applicable; this is an authentication and credential-storage fix with no API request or helper command change.
Validation
cargo fmt --all -- --checkcargo test -p google-workspace-cli --bin gws auth::tests— 23 passedcargo test -p google-workspace-cli --bin gws credential_store::tests— 28 passedcargo test -p google-workspace-cli— 703 passedcargo clippy -p google-workspace-cli --bin gws -- -D warningscargo build -p google-workspace-cligit diff --checkcargo check,google-workspace82 tests, CLI 703 tests.changeset/preserve-undecryptable-credentials.mdThe final branch is based on
origin/maina3768d0e82ad83cca2da97724e46bea4ff0e6dbdand changes only the changeset,auth.rs, andcredential_store.rs. No Google Workspace APIs, credentials, scopes, users, Sheet, or email were touched; human review and merge remain pending.