Skip to content

refactor: use @heroku/sdk for auth commands#3815

Open
erika-wallace wants to merge 8 commits into
v12.0.0from
ew/sdk-update-auth
Open

refactor: use @heroku/sdk for auth commands#3815
erika-wallace wants to merge 8 commits into
v12.0.0from
ew/sdk-update-auth

Conversation

@erika-wallace

@erika-wallace erika-wallace commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the following auth commands to @heroku/sdk:

  • auth/whoami
  • auth/token
  • auth/2fa
  • auth/login

Details

  • auth/whoami: Migrated GET /account call to platform.account.info()
  • auth/token: Migrated GET /oauth/authorizations call to platform.oauthAuthorization.list()
  • auth/2fa: Migrated GET /account call to platform.account.info()
  • auth/login: Migrated GET /account call to platform.account.info() (login flow itself remains with APIClient.login())

Not migrated

  • auth/logout: No HTTP API calls to migrate (only uses APIClient.logout() and local credential management)
  • auth/2fa/disable: Command just errors out; no API calls

Testing

Notes:
The SDK uses heroku-fetch to make API calls, which looks for a netrc file. Therefore, we must login with HEROKU_NETRC_WRITE=true.

Steps:

  1. Pull down this branch
  2. npm i && npm run build
  3. ./bin/run logout
  4. HEROKU_NETRC_WRITE=true ./bin/run login — Outputs "logged in as email"
  5. ./bin/run whoami — Outputs "email"
  6. ./bin/run auth:token — Outputs "token"
  7. ./bin/run auth:2fa — Outputs "two-factor authentication is enabled/not enabled"

Cleanup:

  • ./bin/run logout

Related Issues

GUS work item: W-23373474

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