Skip to content

Automatically refresh short-lived PyPI token in long Trusted Publishing uploads #1246

@facutuesca

Description

@facutuesca

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

trusted publish
oidc
timeout

Please describe the problem you are attempting to solve with this request

When uploading several large distributions to an index, depending on their size and network conditions, uploads might take more than 15 mins.

In Trusted Publishing flows where the OIDC token is exchanged for a PyPI token that is short-lived (15 mins), twine upload will fail between file uploads if the 15 mins are up and there are still files left to upload.

There's at least one case of someone hitting this issue (see here).

How do you think we should solve this?

A possible solution would be for twine to automatically request a new PyPI token between file uploads, if more than 15 minutes have passed since the original token was requested.

Anything else you'd like to mention?

cc @woodruffw @webknjaz

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions