admin管理员组

文章数量:1399242

I have a CI-CD pipeline which builds and release a Python package into PyPi. An auth token is used for this and I have a new requirement to rotate/regenerate this token relatively regularly, maybe once per 6-12 months (for sake of security).

So the question is if it is possible to achieve in PyPi in automated fashion somehow? I checked PyPi's docs and help and looks like I need to use its UI and 2FA all the time to add a new token (and remove the old one) and I couldn't find any possibility how to automate this process.

I have a CI-CD pipeline which builds and release a Python package into PyPi. An auth token is used for this and I have a new requirement to rotate/regenerate this token relatively regularly, maybe once per 6-12 months (for sake of security).

So the question is if it is possible to achieve in PyPi in automated fashion somehow? I checked PyPi's docs and help and looks like I need to use its UI and 2FA all the time to add a new token (and remove the old one) and I couldn't find any possibility how to automate this process.

Share Improve this question asked Mar 25 at 15:53 artemdevelartemdevel 6411 gold badge10 silver badges21 bronze badges 2
  • 1 pypi./help/#trusted-publishers – phd Commented Mar 25 at 18:14
  • @phd thanks! looks like this is what I need indeed! – artemdevel Commented Mar 26 at 8:16
Add a comment  | 

1 Answer 1

Reset to default 0

There is currently no way to automate this with PyPi. You could make a selenium script to generate a new token, however it may be clunky and would need to work separately from the rest of the script.

本文标签: securityIs it possible to automatically regenerate auth token for PyPiStack Overflow