feat(auth): add named account profiles#788
Conversation
🦋 Changeset detectedLatest commit: 46af288 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 |
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 enhances the CLI by adding support for named authentication profiles. This enables users to manage multiple Google Workspace identities independently without needing to duplicate OAuth client configurations. The changes include new command-line flags, environment variable support, and updated file path logic to ensure credentials and caches are isolated per profile. 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 introduces named auth profiles to the CLI, allowing users to maintain isolated credentials and token caches. Users can specify a profile using the --profile flag or the GOOGLE_WORKSPACE_CLI_PROFILE environment variable. The implementation includes logic for profile-specific directory resolution, profile name validation, and updated argument parsing to handle global flags. I have no feedback to provide as no review comments were submitted.
|
This PR has been inactive for 72 hours. Closing to keep the queue clean. |
|
This PR was closed because it has been stalled for 72 hours. Feel free to magically reopen it if you want to continue working on it! |
|
This PR was auto-closed for inactivity. The branch is still available, checks were passing, and Gemini had no remaining feedback. Could a maintainer reopen this for review when convenient? |
Description
Adds named auth profiles so users can keep separate Google Workspace credentials and token caches for different accounts or tenants.
What changes:
--profile <name>flag andGOOGLE_WORKSPACE_CLI_PROFILEenv var.~/.config/gws/profiles/<name>/.auth login,auth status, andauth logoutprofile-aware.auth loginso a profile does not keep using stale tokens from a previous login.client_secret.jsonfor every profile.This is intended to make account switching explicit and safer for users who work across multiple accounts, Workspace domains, or customers.
Refs #439, #572, #764, #780.
Dry Run Output:
// Not applicable: this adds auth profile storage/routing, not a request-building helper.Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings. See testing note below.pnpx changeset) to document my changes.Testing
cargo fmt --all --checkcargo test -qcargo clippy -- -D warningsis blocked locally by the existingscript.rsclippy warning on currentmain; that warning is fixed separately in fix(script): skip ignored directories during push #786.