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

feat(token): support automation tokens via --token-type #427

Open
4 tasks
Tracked by #536
darcyclarke opened this issue Jan 13, 2022 · 0 comments
Open
4 tasks
Tracked by #536

feat(token): support automation tokens via --token-type #427

darcyclarke opened this issue Jan 13, 2022 · 0 comments
Labels

Comments

@darcyclarke
Copy link
Contributor

darcyclarke commented Jan 13, 2022

Summary

The CLI should support automation tokens (which are already available on the website)

Exit Criteria

  • npm token create supports a new --token-type flag
    • default value is: read-write, other values are read & automation
    • legacy --read-only flag should map to --token-type=read
  • npm token list outputs the corresponding token type (no longer just the "read-only" boolean)
  • Tests are written to reflect new capabilities
  • Documentation is updated to reflect new capabilities

Examples

npm token create --token-type=read

npm token create --token-name="Actions CI" --token-type=automation

npm token list 

+--------+---------+------------+------------+------------+----------------+
| id     | token   | created    | name       | type       | CIDR whitelist |
+--------+---------+------------+------------+------------+----------------+
| 7f3134 | 1fa9ba… | 2017-10-02 |            | read       |                |
+--------+---------+------------+------------+------------+----------------+
| c03241 | af7aef… | 2017-10-02 | npm login  | read-write |                |
+--------+---------+------------+------------+------------+----------------+
| e0cf92 | 3a436a… | 2017-10-02 | npm login  | read-write |                |
+--------+---------+------------+------------+------------+----------------+
| 63eb9d | 74ef35… | 2017-09-28 | Actions CI | automation |                |
+--------+---------+------------+------------+------------+----------------+

Potential Bikeshedding

  • the website calls read-write tokens "Publish" tokens... if we want to keep this verbiage, feel free to adjust the values noted above accordingly (there may be reasons we want to push forward with read-write though... as it's a standard across GitHub & may more clearly communicate the capabilities of the permissions that token is associated with - ref. https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-tokens-with-the-cli)

References

@darcyclarke darcyclarke mentioned this issue Mar 23, 2022
32 tasks
@lukekarrys lukekarrys self-assigned this May 2, 2022
@darcyclarke darcyclarke mentioned this issue Aug 22, 2022
46 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants