Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for registry v3 JWK thumbprint key ID format #401

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

evanebb
Copy link

@evanebb evanebb commented Feb 13, 2025

Fixes #386.
This is a fairly quick and dirty fix, feel free to burn this PR down :)

As mentioned in that issue, the v3 version of the registry no longer supports libtrust key IDs. There are multiple alternative options to choose from, but the simplest one to implement for this project is using the JWK thumbprint of the public key as the key ID instead.

For every certificate present in the rootcertbundle passed to the registry, it'll add the public key to the trusted keys identified by the JWK thumbprint: https://github.com/distribution/distribution/blob/63d3892315c817c931b88779399a8e9142899a8e/registry/auth/token/accesscontroller.go#L346-L348
So, if you pass this JWK thumbprint in the key ID header in the token, the registry can select the proper signing key using this thumbprint.

This PR allows configuring this through a new directive in the configuration file, namely token.disable_legacy_key_id.
If set to true, it will pass the JWK thumbprint in the key ID header instead of the libtrust key ID. It defaults to false for now, to avoid accidental breakage when updating setups using the v2 registry.

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.

docker-registry has changed its JWT implementation, no longer supports libtrust key IDs
1 participant