Skip to content

auth: multiple credentials per environment, keyed by account name #139

Description

@MingruiZhang

Follow-up to landing-ai/ade-cli-internal#72 (fixed by landing-ai/ade-cli-internal#78), which was explicitly scoped to fixing the login/logout overwrite-and-selection confusion. That change made environments coexist but kept one credential per environment.

This issue tracks the deferred half of landing-ai/ade-cli-internal#72's title — "like env, account name": supporting multiple credentials within a single environment, addressable by account.

Motivation

Today a second login to the same environment replaces the first. Someone with two production accounts (e.g. two identities/tenants, or an API key and an OAuth session) can't keep both.

Current model (post-landing-ai/ade-cli-internal#78)

  • A profile is keyed by environment only; credentials.json holds one entry per env under environments.
  • login --env X authenticates/selects X; login (flagless) targets production.
  • logout is per environment.

See docs/adr/0001-auth-login-selects-logout-per-env.md for the model and why account-level profiles were deferred.

Rough scope (to be grilled before building)

  • Profile identity becomes (environment, account); storage grows a nested map.
  • Account naming: auto-derive from OAuth token identity (email/sub); explicit --account/--name for API keys.
  • Selection within an env (which account is active) + how status/logout address accounts.
  • Migration of the existing one-credential-per-env schema.

Design decisions (identity model, selection UX, storage layout) should go through a /grill-with-docs session and a new ADR before implementation.


Migrated from the private development tracker (landing-ai/ade-cli-internal#79) during the launch cutover.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-infoBlocked on missing informationneeds-triageAwaiting triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions