Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve instructional text for API tokens #6551

Closed
nlhkabu opened this issue Aug 30, 2019 · 7 comments · Fixed by #6615
Closed

Improve instructional text for API tokens #6551

nlhkabu opened this issue Aug 30, 2019 · 7 comments · Fixed by #6615
Assignees

Comments

@nlhkabu
Copy link
Contributor

nlhkabu commented Aug 30, 2019

Based on feedback collected in user testing:

On the API token confirmation page, we should:

  • Show the username/password instructions on the API token confirmation page
  • Show an example .pypirc file, and explain where to put them for "entire account" tokens vs "scoped to project" tokens

On the manage project > settings page:

  • Add a link back to the API token creation page

FYI @justinmayer

@nlhkabu nlhkabu added this to the OTF Security work milestone Aug 30, 2019
@nlhkabu nlhkabu self-assigned this Aug 30, 2019
@nlhkabu nlhkabu changed the title Improve help and instructional text for API tokens Improve instructional text for API tokens Aug 30, 2019
@nlhkabu
Copy link
Contributor Author

nlhkabu commented Aug 30, 2019

Example help text for "whole account" (user scoped) tokens:

Screenshot from 2019-08-30 07-38-03

For tokens scoped to a specific project, what would the .pypirc file look like and where would it be located?

I assume that users can create a .pypirc file in their project root directory, but I could not find this documented anywhere.

@theacodes @di @dstufft - any ideas?

@woodruffw
Copy link
Member

For tokens scoped to a specific project, what would the .pypirc file look like and where would it be located?

Project-scoped tokens look and are configured identically to user-scoped tokens, so the .pypirc file should look and be placed identically. The major distinction between the two will probably be in whether people use .pypirc frequently for project-scoped tokens, given that they're mostly useful for CI/CD and platforms like Travis provide separate configuration mechanisms.

@nlhkabu
Copy link
Contributor Author

nlhkabu commented Sep 3, 2019

Just to be clear -> if I created a project-scoped token, then I would add the details of this token into a .pypirc file at $HOME/.pypirc. Effectively, it means that I can only have one token on my local machine at any time?

E.g. I cannot create .pypirc files that correspond to each project locally (either by naming them differently, or by placing them in the project root)?

@woodruffw
Copy link
Member

woodruffw commented Sep 3, 2019

Effectively, it means that I can only have one token on my local machine at any time?

Ah, not exactly. You would effectively have one "default" token. If you wanted to have multiple project-scoped tokens, you could do something like this:

# either your user-scoped token or your default project-scoped token
[pypi]
username = __token__
password = pypi-blah

# some other token
[whatever]
username = __token__
password = pypi-blarg

And then do twine --repository whatever to switch to the whatever token.

Edit: Oh, and I believe you can create individual .pypirc files and tell twine where to look for them. That would also be a solution to the same problem.

@nlhkabu
Copy link
Contributor Author

nlhkabu commented Sep 5, 2019

Thanks for your feedback @woodruffw. I'll update the text based on your feedback and we can go from there :)

@nlhkabu
Copy link
Contributor Author

nlhkabu commented Sep 5, 2019

Ok, so second attempt:

User scoped token instructions

Screenshot from 2019-09-05 07-28-15

Project scoped token instructions

Screenshot from 2019-09-05 07-29-23

@woodruffw can you please review the text?

I'm thinking that this information is maybe too long for this page and could be moved to the help page instead - but I'd like to get the details nailed down first :)

@brainwane brainwane removed this from the OTF Security work milestone Sep 8, 2019
@brainwane
Copy link
Contributor

Contractors on the OTF-funded work need to deprioritize work on the security features in order to ensure we complete the accessibility and internationalization work by the end of the month. Therefore, while this would be great to resolve and I recognize that Nicole may still complete it, I'm removing it from the milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants