Skip to content

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Oct 2, 2025

This PR adjusts our POST /api/v1/trusted_publishing/tokens endpoint to also accept GitLab OIDC tokens.

As discussed in #11988, we are using a trust-on-first-use principle for the namespace IDs for GitLab due to some API constraints. In other words: the token exchange endpoint will fill in the namespace_id column from the OIDC JWT claims if it was empty before and on each subsequent token exchange it will only accept it if the IDs are matching.

Other than that, this is essentially the same implementation as for GitHub Actions.

Worth noting also is that, just like PyPI, we only support gitlab.com for now, but not any self-hosted GitLab instances.

Related

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-backend ⚙️ labels Oct 2, 2025
@Turbo87 Turbo87 requested a review from a team October 2, 2025 01:18
@Turbo87 Turbo87 force-pushed the gitlab-oidc-exchange branch from b2d6282 to d2eea95 Compare October 2, 2025 01:52
@Turbo87 Turbo87 force-pushed the gitlab-oidc-exchange branch from d2eea95 to 4449eed Compare October 2, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ 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