Skip to content

Zero-config auth: work automatically when gws or gogcli is already set up #70

@sripathikrishnan

Description

@sripathikrishnan

Problem

Right now, every extrasuite user must go through a separate auth setup step — either install and configure a gateway server, or manually supply a service account JSON file. This friction is a barrier for users who are already authenticated with popular Google Workspace CLI tools like gws or gogcli, and just want to try the pull/diff/push workflow.

Desired behavior

extrasuite should resolve credentials in this order, automatically:

  1. ExtraSuite server — if configured (via EXTRASUITE_SERVER_URL, --gateway, or ~/.config/extrasuite/gateway.json), use it. This gives you named agent identity and a full audit trail. Recommended for team deployments.

  2. Service account file — if SERVICE_ACCOUNT_PATH or --service-account is set, use the SA key directly.

  3. gws — if the user has configured gws, extrasuite picks up those credentials and authenticates against Google directly. No extra setup required. Relevant environment variables/files: GOOGLE_WORKSPACE_CLI_TOKEN, GOOGLE_WORKSPACE_CLI_CLIENT_ID + GOOGLE_WORKSPACE_CLI_CLIENT_SECRET, GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE, ~/.config/gws/client_secret.json.

  4. gogcli — same idea for gogcli users. Relevant config: GOG_ACCESS_TOKEN, ~/.config/gogcli/credentials.json (platform-specific path).

  5. Fail with a clear error message listing what to configure.

What "works automatically" means

  • If a pre-obtained access token is available (GOOGLE_WORKSPACE_CLI_TOKEN / GOG_ACCESS_TOKEN), use it immediately — no browser needed.
  • If OAuth client credentials are found (client ID + secret from gws or gogcli config), extrasuite performs a one-time OAuth browser flow using those credentials, stores the resulting refresh token in its own secure keyring entry, and silently refreshes it on every subsequent run. The user sees a standard Google consent screen the first time only.

Trade-offs vs. the gateway

In gws/gogcli mode, operations happen under the user's own Google identity (the same account they used when setting up gws/gogcli). File edits in Google Drive will show as made by that person, not a named agent. For personal use and experimentation this is fine. Teams who want a distinct agent identity and strong audit trail should still configure the gateway server.

Scope of this issue

  • Layered credential resolution in CredentialsManager
  • Reading gws and gogcli credential files from their documented, public config locations
  • One-time OAuth dance using the discovered client credentials, with refresh token stored in extrasuite's own keyring
  • Clear, actionable error messages when no auth method is found, including hints about what to configure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions