You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: unified auth resolution and whoami improvements (#60)
- Add resolveAuthMethod() as single source of truth for auth priority
- Rewrite whoami to display active auth method with proper labels
- Auth priority: AWS profile → env vars (AWS_ > TIGRIS_) → OAuth → credentials →
configured
- Clear stale auth state on re-login to prevent method conflicts
- Fix clearOAuthData leaving stale activeMethod causing crashes
- Limit whoami org list to first 5 with hint to see all
- Include test files in lint and format scripts
* chore: include test files in lint and format scripts
Extend lint, lint:fix, format, and format:check to cover test/**/*.ts
alongside src. Fix import ordering and formatting across all test files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: clear stale auth state on re-login
Allow OAuth re-login (remove isAuthenticated block) and clear the
other method's temporary state when switching login methods to prevent
stale sessions from persisting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: make whoami reflect auth resolution priority
Add resolveAuthMethod() as a single source of truth for the auth
priority chain (AWS profile → OAuth → credentials login → env vars →
configured). Refactor getStorageConfig() to use it, and rewrite whoami
to display the active auth method with IAM identity for credential-based
methods.
Move getEnvCredentials, getEnvCredentialSource, and getCredentials from
storage.ts to provider.ts where they belong as auth resolution logic.
Add comprehensive tests for resolveAuthMethod() covering all 5 auth
methods, priority ordering, and edge cases (19 tests).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: limit whoami org list to first 5 with hint to see all
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: merge getEnvCredentialSource into getEnvCredentials
Single function now returns credentials with source field, eliminating
duplicated env var logic and the inconsistency flagged in PR review.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: reorder auth priority so env vars override login state
New priority: AWS profile → env vars → oauth → credentials → configured.
Env vars are explicit per-session overrides and should win over a
previously stored login.
Also replace unnecessary dynamic import of getStorageConfig in whoami
with the existing static import.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: prioritize AWS_ env vars over TIGRIS_ in config and credentials
AWS_ variables are the standard and should be checked before TIGRIS_
in getTigrisConfig() and getEnvCredentials().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: clear stale activeMethod in clearOAuthData to prevent broken state
When clearOAuthData() is called without first updating activeMethod,
resolveAuthMethod() would return oauth but no tokens exist, causing
getStorageConfig() to crash on authClient.getAccessToken().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments