feat: add --team to authorizations:create - #3926
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 --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.
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:createso a user can create an OAuth authorization owned by a team instead of a personal token. Without the flag, the command creates a personal authorization exactly as before.--team(sharedflags.team()helper) toauthorizations:create./teams/{team}/oauth/authorizationswhen--teamis set; keep the existing/oauth/authorizationspath otherwise. Request body is unchanged.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). Existing flags (--description,--expires-in,--scope,--json,--short) are unaffected. Live smoke exercises the real team create endpoint that unit tests mock.Steps:
git fetch origin worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-4 && git checkout worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-4npm ci && npm run buildheroku login./bin/run authorizations:create --team <TEAM> --description "smoke test"— Expect: creates a team-owned authorization./bin/run authorizations:create --team <TEAM> --scope read --description "smoke scoped"— Expect: creates a scoped team-owned authorization./bin/run authorizations:create --description "personal smoke"— Expect: unchanged behavior (personal authorization)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-24132433