Differences between revisions 30 and 31
Revision 30 as of 2019-07-25 17:10:02
Size: 7696
Editor: EWDurbin
Comment:
Revision 31 as of 2019-07-29 00:58:13
Size: 7687
Comment: API token testing - polish
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
'''In beta:''' Starting '''DATE TK''', we'll give users the ability to create and use API tokens to upload packages. API tokens provide an alternative way (instead of username and password) to authenticate when uploading packages to PyPI or Test PyPI. You can create a token for an entire PyPI account, in which case, the token will work for all projects associated with that account. Alternatively, you can limit a token's scope to a specific project. And then, manually or in your configuration file, when you upload, use `@token` for the username and the token string for the password. API token support is '''in beta''' so check the "caution" warning below. '''In beta:''' You can create and use API tokens to upload packages. API tokens provide an alternative way (instead of username and password) to authenticate when uploading packages to PyPI or Test PyPI. You can create a token for an entire PyPI account, in which case, the token will work for all projects associated with that account. Alternatively, you can limit a token's scope to a specific project. And then, manually or in your configuration file, when you upload, use `@token` for the username and the token string for the password. API token support is '''in beta''' so check the "caution" warning below.
Line 69: Line 69:
See [[https://pypi.org/help/#apitoken|our help docs]] for guidance on provisioning and using API Tokens. These can be created to allow uploads for all projects a User has access to or scoped to a specific project. See [[https://pypi.org/help/#apitoken|our help docs]] for guidance on provisioning and using API Tokens. You can create a token that allows uploads for all projects your user account has Maintainer or Owner access to, or scope it to a specific project.

Help us test PyPI's authentication improvements!

Warehouse is the code behind the Python Package Repository (PyPI). We are seeking maintainers of Projects on PyPI to test our new two-factor auth and API token functionality and send us bug reports. WebAuthn support and API tokens are in beta; please help us shake the bugs out!

Feedback on user experience, accessibility, and overall ease of use are welcome; we want to support your workflows for account management and package maintainership. Go to your account settings and try it out!

Guidelines for Particpation

  • By participating, you agree to abide by the PyPA Code of Conduct.

  • You must verify your primary email address on your Test PyPI and PyPI accounts before setting up 2FA or an API token.
  • You should sign up for the PyPI Announcement Mailing List for updates.

Changes we're making

To increase the security of PyPI downloads, we're beginning to introduce two-factor authentication (2FA) as a login security option, and we're adding scoped API tokens so you can upload a package using a token instead of a username and password.

You can use 2FA right now on Test PyPI and on official PyPI. PyPI currently supports a single 2FA method: generating a code through a Time-based One-time Password (TOTP) application. After you set up 2FA on your PyPI account, then you must provide a TOTP (along with your username and password) to log in. Therefore, to use 2FA on PyPI, you'll need to provision an application (usually a mobile phone app) in order to generate authentication codes; see below for suggestions and pointers.

In beta: We support WebAuthn and thus "security keys". A security key (also known as a universal second factor, or U2F key) is hardware device that communicates via USB, NFC, or Bluetooth. Popular keys include Yubikey, Google Titan and Thetis. PyPI supports any FIDO U2F compatible key and follows the !WebAuthn standard. Users who have set up this second factor will be prompted to use their key (usually by inserting it into a USB port and pressing a button) when logging in. The WebAuthn support is in beta so check the "caution" warning below.

Two-factor authentication currently only applies to the login step, not package uploads.

In beta: You can create and use API tokens to upload packages. API tokens provide an alternative way (instead of username and password) to authenticate when uploading packages to PyPI or Test PyPI. You can create a token for an entire PyPI account, in which case, the token will work for all projects associated with that account. Alternatively, you can limit a token's scope to a specific project. And then, manually or in your configuration file, when you upload, use @token for the username and the token string for the password. API token support is in beta so check the "caution" warning below.

Things to test

Most of these you can test on pypi.org. For testing destructive actions, like removing an owner or deleting a project, please use test.pypi.org.

Caution (before you test)

During this beta testing period, if things go awry, there's a chance we will need to wipe WebAuthn and API tokens from users' accounts, so if you choose to try it, please be forewarned. That's why you need a PyPI-verified email address on your user account before adding a second login auth factor, to make potential account recovery smoother.

Reminder! Sign up for the PyPI Announcement Mailing List to be kept in the loop as we continue this process!

Workflows

  • Verify primary email address
  • Add, disable, and remove 2FA token using TOTP
  • Add, disable, and remove 2FA token using U2F (WebAuthn)

  • Login/Logout
  • Set multiple 2FA tokens and login
  • Add and remove project-scoped API token
  • Add and remove user-scoped API token
  • Upload a package using API token
  • Remove a user from owner/maintainer status for a project and verify that their API token for that project stops working
  • Delete a project and verify that an API token scoped for that project stops working
  • User Registration and Confirmation
  • Password Reset

Testers we need

In particular, please help us test this if any of these apply to you:

  • automate uploads using continuous integration
  • save your PyPI credentials in a `.pypirc` file

  • use Windows
  • usually visit PyPI on a mobile device
  • are an organization where users share an auth token within a group
  • have 4+ maintainers or owners for one project
  • use an unusual TOTP app or U2F token
  • have a slow Internet connection
  • usually block cookies and JavaScript (note that you can't set up a U2F key without JavaScript)

  • maintain 20+ projects
  • created your PyPI account 6+ years ago

Setting up a TOTP application

See our help docs for guidance on choosing a TOTP app for desktop or mobile.

Setting up a U2F security key

See our help docs for guidance on setting up your U2F security key. Please note that you cannot set up or use U2F for a second factor without turning on JavaScript, and that right now we only support Chrome, Edge, and Firefox.

Provisioning and using API Tokens

See our help docs for guidance on provisioning and using API Tokens. You can create a token that allows uploads for all projects your user account has Maintainer or Owner access to, or scope it to a specific project.

Security bugs

If you find any potential security vulnerabilities, please follow our published security policy. Please don't report security issues in Warehouse via GitHub, IRC, or mailing lists. Instead, please directly email one or more of our maintainers.

Our next steps

Once we fix all the urgent bugs we find, we'll remove the "beta" badge for each feature. Then we expect to move on to working on further security, accessibility, and internationalization tasks per the Warehouse roadmap). Thanks to the Open Technology Fund for funding this work. More progress reports at the Packaging Working Group's wiki page.

Contact us

Security issues: email security @ python dot org

GitHub for all other bug reports & feature requests:https://github.com/pypa/warehouse/issues/new

IRC: #pypa-dev on Freenode (someone's usually there 10am-5pm Central Time on weekdays)

Email: distutils-sig mailing list

Thank you for testing Warehouse! You're helping us secure this ecosystem, and future users of PyPI will appreciate it. :)

WarehousePackageMaintainerTesting (last edited 2019-08-15 21:22:16 by SumanaHarihareswara)

Unable to view page? See the FrontPage for instructions.