Skip to content

Record key ownership when authenticating organizations#1207

Merged
ericmj merged 1 commit into
mainfrom
org-key-warning
Jul 21, 2026
Merged

Record key ownership when authenticating organizations#1207
ericmj merged 1 commit into
mainfrom
org-key-warning

Conversation

@ericmj

@ericmj ericmj commented Jul 20, 2026

Copy link
Copy Markdown
Member

Following the stored-key deprecation warning's own instructions (generate an organization key, pass it with mix hex.organization auth ORG --key KEY) didn't silence it, because the client can't tell an organization-owned key from a user-owned key once it's stored. CI logs stay full of the warning even for correctly configured organization keys.

mix hex.organization auth ORG --key KEY now reads the key owner from the GET /api/auth response used to verify the key (hexpm/hexpm#1746) and stores it as auth_key_owner on the repo config. At fetch time, organization-owned keys don't warn anymore, user-owned keys warn that they stop working in Hex 2.6, and keys stored before this version keep the old warning plus a hint to re-run the auth command to record the owner. The HEX_REPOS_KEY warning also names Hex 2.6 now instead of "will be removed". Authenticating with an organization key prints a note that Hex 2.6 will exchange the key for a short-lived token, so CI should run auth right before fetching.

Against a server that doesn't return owner information yet, everything behaves as before, so this doesn't depend on the hexpm deploy ordering.

The stored-key deprecation warning recommends mix hex.organization auth
ORG --key KEY, but following it did not silence the warning because the
client could not tell an organization-owned key from a user-owned key
once stored.

Extract the key owner from the GET /api/auth response when verifying the
key and store it as auth_key_owner on the repo config. Organization keys
no longer warn and print a note about the Hex 2.6 token exchange, user
keys warn that they stop working in Hex 2.6, and keys stored before this
version keep warning until the command is re-run. Servers that respond
204 without owner information behave as before.
@ericmj
ericmj merged commit 0eb1763 into main Jul 21, 2026
22 checks passed
@ericmj
ericmj deleted the org-key-warning branch July 21, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant