Repository navigation
feat: add --team to authorizations list - #3924
Closed
michaelmalave wants to merge 2 commits into
Closed
michaelmalave wants to merge 2 commits into
michaelmalave wants to merge 2 commits into
Conversation
Adds an optional --team flag to `heroku authorizations` so it can list a team's OAuth authorizations via GET /teams/:team/oauth/authorizations, instead of the running user's tokens. Without --team, behavior is unchanged. Reuses the existing table/JSON rendering and follows the flags.team() convention already used by apps:index and usage:addons.
The team-owned authorizations API route (/teams/:team/oauth/authorizations) is gated behind the 3.sdk API variant; without the Accept header the request 404s. Send SDK_HEADER on the --team path only and assert it in the team tests.
Contributor
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--teamoption toheroku authorizations(the list command) so a user can list an OAuth authorizations belonging to a team instead of their personal tokens. Without the flag, the command lists personal authorizations exactly as before.--team(sharedflags.team()helper) to theauthorizationslist command./teams/{team}/oauth/authorizationswhen--teamis set; keep the existing/oauth/authorizationspath otherwise.Type of Change
Feature Additions (minor semver update)
Testing
Notes:
Automated: scoped authorizations unit suite is green (
npm run test:ci:unitis chronically broken onclimainindependent of this diff, so verification runs the scoped suite). Live smoke exercises the real team-authorizations list endpoint that unit tests mock.Steps:
git fetch origin worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-2 && git checkout worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-2npm ci && npm run buildheroku login./bin/run authorizations --team <TEAM>— Expect: lists the team's authorizations./bin/run authorizations --team <TEAM> --json— Expect: same, as JSON./bin/run authorizations— Expect: unchanged behavior (personal authorizations)Additional Context
flags.team()(the shared@heroku-cli/commandhelper reused here, as inapps/members) carries an env-var default:--org→HEROKU_TEAM→HEROKU_ORGANIZATION. So a user withHEROKU_TEAM/HEROKU_ORGANIZATIONexported will be routed to the team endpoint even without passing--team. This matches existing team-scoped commands; flagging it because this command did not previously have a team flag.Related Issues
GUS work item: W-24132432