Closed
Description
There's currently a little bit of friction around bootstrapping API tokens on a new PyPI project:
- Prepare a package for a new project
- Upload the first version of the project to PyPI using a user-scoped API token (not ideal for long-term actions) or user credentials (shouldn't be used in CI)
- Log into PyPI and create a project-scoped token for the new project
- Use the new project-scoped token for all future releases
A similar problem will happen with OIDC: we currently require a project to exist before an OIDC publisher can be registered against it, meaning that a user will have to upload at least one release with a user-scoped token or credentials before they can switch to a credential-less workflow.
Some potential solutions:
- Allow users to pre-create projects on PyPI before uploading any releases.
- Pros: Solves the "de novo" problem above.
- Cons: Malicious users can abuse this as a low-friction way to squat names.
- Allow users to pre-register OIDC publishers; on use, the project would be created for the first time.
- Pros: Solves the "de novo" problem and minimizes squatting potential.
- Cons: Complicates the OIDC data mode: pre-registering a publisher means either pre-creating the project (same problem as (1)) or creating a "symbolic" link to a nonexistent project (another column). We'd have to be careful about invalidating a publisher if someone else races/beats it to creating a project, so that someone can't quietly takeover a project's releases via OIDC.
- Something else?