Repository navigation
feat: add --team to authorizations:revoke and authorizations:rotate - #3925
Closed
michaelmalave wants to merge 2 commits into
Closed
michaelmalave wants to merge 2 commits into
michaelmalave wants to merge 2 commits into
Conversation
…otate (W-24132436)
When --team is set, revoke targets DELETE /teams/${team}/oauth/authorizations/${id}
and rotate targets POST /teams/${team}/oauth/authorizations/${id}/actions/regenerate-tokens.
Without --team, both commands keep their existing user-scoped paths. The --team flag
applies to both authorizations:revoke and its authorizations:destroy alias since they
share the same command class. Adds unit test coverage for both the team and non-team
paths on each command.
…/rotate The team-owned authorizations API routes (/teams/:team/oauth/authorizations) are 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
|
Closing: no CLI change required. There is no team-scoped |
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:revoke(and itsauthorizations:destroyalias) andheroku authorizations:rotateso an admin can revoke or rotate an OAuth authorization owned by a team. Without the flag, both commands behave exactly as before.--team(sharedflags.team()helper) toauthorizations:revoke/:destroyandauthorizations:rotate./teams/{team}/oauth/authorizations/{id}when--teamis set./teams/{team}/oauth/authorizations/{id}/actions/regenerate-tokenswhen--teamis set; keep the existing personal paths 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).authorizations:destroysharesrevoke.ts's class and is covered by the same tests. Live smoke exercises the real team endpoints that unit tests mock.Steps:
git fetch origin worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-3 && git checkout worker/gus-a3QEE000002hXIv2AM-2026-09-14-task-3npm ci && npm run buildheroku login./bin/run authorizations:rotate <AUTHORIZATION_ID> --team <TEAM>— Expect: rotates the team-owned authorization's tokens./bin/run authorizations:revoke <AUTHORIZATION_ID> --team <TEAM>— Expect: revokes the team-owned authorization./bin/run authorizations:revoke <PERSONAL_AUTHORIZATION_ID>— Expect: unchanged personal-token behavior (no--team)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 these commands did not previously have a team flag.Related Issues
GUS work item: W-24132436