Trusted Publishing: Lessons from PyPI
summary
PyPI implements Trusted Publishing: an OpenID Connect-based flow that exchanges ephemeral OIDC credentials from CI (GitHub Actions) for short-lived, scoped API tokens (10-minute lifetime), eliminating long-lived user tokens and most manual token handling. It adds pending publishers to create projects on first publish and ties publish rights to repo+workflow, not secrets. Thousands of packages, including central Python dependencies, have enrolled. Implementation pain points include complex many-to-many data models, wide IDP claim variability, and the need to exchange OIDC for internal tokens.
AI-written summary · about
chapters (15)
- 0:00Introduction and background
- 1:44Authentication problems with PyPI
- 3:53API tokens and their limits
- 6:21Goals for trusted publishing
- 7:21OpenID Connect fundamentals
- 8:26Trusted publishing concept
- 10:11How trusted publishing works
- 11:15Solving the chicken and egg problem
- 12:58Supply chain benefits
- 14:04Data model complexities
- 15:28OpenID Connect variations
- 16:51Provider-specific challenges
- 18:14Why exchange OIDC for API tokens
- 20:19Naming and usability feedback
- 21:01User adoption and future steps
