Skip to content

Save and show JWT claims subset when Trusted Publishing is used #11513

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Jul 4, 2025

For regular publishes we save and show the user that published the new version. For Trusted Publishing we currently don't do anything like that.

This PR proposes a new versions.trustpub_data JSONB column with a provider field and a subset of the relevant JWT claims. Specifically for GitHub Actions we save: repository (e.g. "rust-lang/crates.io"), the run_id (to be able to create URLs like https://github.com/rust-lang/crates.io/actions/runs/16069002415), and the sha (not visibly exposed yet, but could be quite useful in the future).

The frontend is then showing the data on the version list, roughly like we do for the user publishers:

Bildschirmfoto 2025-07-04 um 15 46 07

The "GitHub" label in this screenshot is clickable and leads to the corresponding job page on GitHub.

Similarly, the publish notification email template is adjusted to also show if versions were published by GitHub Actions via Trusted Publishing.

Note that this PR also adds a similar column to the trustpub_tokens table. At the time of publishing the JWT is no longer available, so we need to save the data during the token exchange and then copy it from one table to the other when crates are published with a Trusted Publishing token.

Related:

@Turbo87 Turbo87 added the C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works label Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant