Home / Companies / Speakeasy / Blog / Post Details
Content Deep Dive

Secure your Python SDK publishing with PyPI trusted publishing

Blog post from Speakeasy

Post Details
Company
Date Published
Author
Speakeasy Team
Word Count
740
Company Posts That Month
17
Language
English
Hacker News Points
-
Post removed?
No
Summary

Publishing Python SDKs to PyPI has become more secure and efficient with the introduction of trusted publishing, which utilizes OpenID Connect (OIDC) to establish a trust relationship between PyPI and GitHub Actions workflows. Unlike traditional methods that rely on long-lived API tokens prone to leaks and requiring manual rotation, trusted publishing generates short-lived tokens at publish time, reducing security risks and maintenance efforts. Speakeasy supports PyPI trusted publishing through either an automatic setup using its CLI, which simplifies the process, or a manual configuration for those who prefer detailed control. This approach ties each publish to a specific commit, workflow run, and repository, enhancing auditability and eliminating the need to manage or rotate stored credentials. Setting up trusted publishing involves configuring the GitHub workflow permissions and adding a publish-pypi job, with further configuration needed on PyPI to designate GitHub Actions as the trusted publisher. The transition to trusted publishing not only simplifies the workflow but also aligns with the Python packaging ecosystem's move towards improved security practices.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Secrets Management 4 1,388 209 84 +19%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.