DO NOT MERGE - feat: add --team to authorizations list and authorizations:create - #3928
Open
michaelmalave wants to merge 4 commits into
Open
michaelmalave wants to merge 4 commits into
michaelmalave wants to merge 4 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.
Adds --team to `heroku authorizations:create` so the created OAuth
authorization can be owned by a named team. When --team is set, the
command POSTs to /teams/${team}/oauth/authorizations (team value
encodeURIComponent'd); otherwise it keeps the existing
/oauth/authorizations user path. Existing flags (--description,
--expires-in, --scope, --json, --short) and the POST body are
unchanged.
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 test.
This was referenced Sep 16, 2026
jdodson
approved these changes
Sep 16, 2026
jdodson
left a comment
Contributor
There was a problem hiding this comment.
You are right, this is a svelte PR.
Looked it over, tested it out and it looks good.
Approved.
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
Add a
--teamflag to the twoauthorizationscommands whose Platform API operations are team-scoped, so a team admin can list and create team-owned OAuth tokens from the CLI. Consolidates the team-owned-tokens work into a single PR now that the API contract is confirmed: only the collection routes (GET/POST /teams/{team}/oauth/authorizations) are team-scoped.--teamtoheroku authorizations(list) — routes toGET /teams/{team}/oauth/authorizationswhen set, otherwise the existingGET /oauth/authorizations.--teamtoheroku authorizations:create— routes toPOST /teams/{team}/oauth/authorizationswhen set, otherwise the existingPOST /oauth/authorizations.version=3.sdkAccept header (SDK_HEADER) only on the--teampath, which the team-authorizations route requires (assert_variant! "sdk"); the non-team path is byte-for-byte unchanged.3.sdkheader on the team path.Type of Change
Feature Additions (minor semver update)
Testing
Notes:
The
--teampath requires the target team to have theteam-tokensfeature flag and the caller to hold themanage_tokenscapability.heroku-uat/heroku-dev-toolshas been flagged in for testing.Steps:
git checkout worker/gus-a3QEE000002hXIv2AM-team-list-create && npm i && npm run build./bin/run authorizations:create --team heroku-dev-tools --description "smoke test"— Expect: a created team-owned token printed../bin/run authorizations --team heroku-dev-tools— Expect: the team's authorizations listed (includes the one from step 3).heroku authorizations:revoke <AUTH_UUID> --team heroku-dev-tools— Cleanup to remove the test team token created for this.Screenshots (if applicable)
Related Issues
GUS work item: W-24132432 — authorizations list
--teamGUS work item: W-24132433 — authorizations:create
--team