Repository navigation
Only let a signed-in person revoke keys - #2103
Merged
Merged
Conversation
A key can't create other keys since #2055, but the Generate New Key form still described the Keys permission as creating keys with a subset of the key's permissions. The test that read-only organization members can't revoke keys matched any "Revoke key" text on the page, which the new description contains, so it now looks for the revoke button's aria-label.
A key, or a token exchanged for one, can no longer revoke keys, the same way it can't create them since #2055. A leaked key with keys or api:write could revoke every other key of its account or organization. Keys can't hold the keys permission any more: the key form doesn't offer it, write members asking for api:write get api:read and publish, and creating a key with it fails validation. The keys OAuth scope keeps working for signed-in users.
ericmj
added a commit
to hexpm/hex
that referenced
this pull request
Nov 4, 2026
hexpm is refusing keys, and tokens exchanged for keys, when revoking keys (hexpm/hexpm#2103). The test now revokes with the signed-in user, which works against hexpm before and after that change.
ericmj
added a commit
to hexpm/hex
that referenced
this pull request
Nov 4, 2026
hexpm is refusing keys, and tokens exchanged for keys, when revoking keys (hexpm/hexpm#2103). The test now revokes with the signed-in user, which works against hexpm before and after that change.
ericmj
added a commit
to hexpm/hex
that referenced
this pull request
Nov 4, 2026
hexpm is refusing keys, and tokens exchanged for keys, when revoking keys (hexpm/hexpm#2103). The test now revokes with the signed-in user, which works against hexpm before and after that change.
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.
A leaked key with
keysorapi:writecould revoke every other key of its account or organization withDELETE /api/keys. Keys can't create keys since #2055, and now they can't revoke them either, so only a signed-in person manages keys, on the dashboard or with themix hex.user authsession.DELETE /api/keys,DELETE /api/keys/:nameand the organization routes answer 403 to a key or a token exchanged for one, before the organization is looked up, the same as key creation. Keys can't hold thekeyspermission any more: the key form doesn't offer it, write members asking forapi:writegetapi:readandpublish, and creating a key with it fails validation. Keys that already hold it keep it, and it no longer lets them do anything. ThekeysOAuth scope keeps working for signed-in users. /docs/keys and /docs/publish say keys can't create or revoke keys.Hex's
Hex.APITest"keys" test revoked keys with a key on main, v2.5 and v2.4, which this CI runs. hexpm/hex#1304 changes it on main, and the same commit is on v2.5 and v2.4, so this CI passes once #1304 merges.