From @takluyver:
Is there any plan for an API to create upload tokens? E.g. I'd like to have a command-line tool prompt me once for my password & 2FA code, then obtain and store a project-scoped token to use for uploads.
This is a followup to #994.
I will be working on this issue next!
@brainwane I have a few questions regarding this issue. Should the command line tool be created in Twine? Should this tool create tokens for entire projects or should it implement the new caveats implemented in #6255 ?
As my request was a bit vague: what I'm really looking for is a public, documented HTTP interface for creating API tokens. I maintain a command line tool, which handles project uploads, and I'd like to extend it to use API tokens. But I'm not aware of any way to create them programmatically. Once the HTTP interface exists, no doubt other tools will use it too.
Thanks for working on it!
Sorry for the wait in replying to you @rcipkins -- I think @di or @ewdurbin would be better placed to answer you!
This may be part of (or blocked on) https://github.com/pypa/warehouse/issues/284 -- we don't currently have any authenticated APIs (aside from the upload API) but it seems reasonable that this would be part of some future JSON API which could support authentication.
~@takluyver can't you generate an unscoped macaroon and then narrow the scope of it with Caveats yourself before storing it?~
ah this was already mentioned