Skip to content

"De novo" project creation via API tokens/OIDC #11296

Closed
@woodruffw

Description

@woodruffw

There's currently a little bit of friction around bootstrapping API tokens on a new PyPI project:

  1. Prepare a package for a new project
  2. 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)
  3. Log into PyPI and create a project-scoped token for the new project
  4. 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:

  1. 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.
  2. 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.
  3. Something else?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions