Skip to content

Add auth whoami command - #12

Merged
Createitv merged 1 commit into
mainfrom
codex/auth-whoami
Oct 13, 2026
Merged

Createitv merged 1 commit into
mainfrom
codex/auth-whoami

Conversation

@Createitv

Copy link
Copy Markdown
Owner

问题与结果 / Problem and outcome

Users can now run agc auth whoami after authentication to identify the active credential safely. Huawei only exposes official team/developer account information through its OAuth Client team-list API, so the command keeps local identity and OAuth team lookup explicit instead of presenting a profile label as a developer name.

改动 / Changes

  • Add agc auth whoami for active profile, API Client ID, Service Account sub_account, and project context.
  • Add --teams using AGC_OAUTH2_TOKEN to call Huawei's official OAuth-only team account endpoint.
  • Keep Client Key, private keys, and OAuth tokens out of output and errors.
  • Add bilingual README/user-guide documentation and changelog entry.

兼容性 / Compatibility

  • CLI: new non-breaking auth subcommand and AGC_OAUTH2_TOKEN environment variable.
  • REST: None.
  • Configuration: existing credentials remain unchanged; OAuth token is ephemeral and never persisted.
  • Output schema: new whoami envelope only.

验证 / Validation

  • Focused whoami and team-list tests passed.
  • make ci passed with 84.9% total Go coverage and web tests/build.
  • go test -race ./... passed.
  • Official API reviewed: Project Management team-list access requires OAuth Client mode.
  • No live Huawei OAuth token was used; remote behavior is covered with an isolated HTTP server.

文档与完成条件 / Documentation and completion

  • Focused scope, no unrelated files
  • Behavior changes have unit and command tests
  • CLI/REST boundary checked
  • Compatibility and output behavior documented
  • Chinese and English docs updated
  • User-visible change added to CHANGELOG
  • Relevant checks run; live OAuth limitation disclosed
  • Examples and logs contain no secrets

@Createitv
Createitv merged commit 995588e into main Oct 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant