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(access): add new get, set & list #477

Closed
4 tasks
Tracked by #443 ...
darcyclarke opened this issue Mar 25, 2022 · 4 comments · Fixed by npm/cli#5445
Closed
4 tasks
Tracked by #443 ...

feat(access): add new get, set & list #477

darcyclarke opened this issue Mar 25, 2022 · 4 comments · Fixed by npm/cli#5445
Assignees
Labels
Milestone

Comments

@darcyclarke
Copy link
Contributor

darcyclarke commented Mar 25, 2022

Summary

The CLI should support automation tokens (which are already available on the website). Currently, npm access has a binary understanding of 2fa support with the subcommands 2fa-required & 2fa-not-required, we should expand the set of subcommands to better consolidate functionality & not arbitrarily expand the subcommands required to manage this config.

Exit Criteria

  • add new list subcommand with positional args of <packages|collaborators> & alias (npm access ls)
    • note: consider moving this functionality/information into npm view
    • ex. npm access list packages [<user>|<scope>|<scope:team>]
    • ex. npm access list collaborators [<package> [<user>]]
    • ex. npm access ls packages @darcyclarke
  • add new get <key> & set <key=val> subcommands with the following keys/values:
    • status: public|private
    • mfa: false|publish|automation (alias: 2fa)
  • Tests are written to reflect new capabilities
  • Documentation is updated to reflect new capabilities

Examples

npm access get status lodash # "public"
npm access get status @secret/private-pkg-ex # "private"

npm access set status=private lodash # sets the public accessibility of the package to private

npm access set mfa=publish lodash # sets a 2fa requirement for publishing with publish tokens
npm access set mfa=automation lodash # sets a 2fa requirement for publishing with automation tokens
npm access set mfa=false # turns off 2fa requirements for publishing

References

image

@darcyclarke darcyclarke mentioned this issue Mar 25, 2022
32 tasks
@darcyclarke darcyclarke changed the title BREAKING CHANGE(access): major refactor & 2fa publish for automation tokens support feat(access): add new set & list Apr 21, 2022
@darcyclarke darcyclarke changed the title feat(access): add new set & list feat(access): add new get, set & list Apr 21, 2022
@darcyclarke darcyclarke mentioned this issue Aug 22, 2022
46 tasks
@darcyclarke
Copy link
Contributor Author

@wraithgar can you look into this as a new API surface area? It should essentially replace the legacy subcommands (ref. #500) but shouldn't expand the functionality if we don't have the APIs to support that.

@wraithgar
Copy link
Member

There is no registry api surface area to view a package's access other than status (i.e. public/private).

@wraithgar
Copy link
Member

Changing mfa=false to mfa=none so that the code doesn't have 'false' strings it's parsing. Having a string with a value false is a little confusing. We can bike shed this before v9 lands.

@ljharb
Copy link

ljharb commented Aug 31, 2022

Why <key>=<val> exactly? That seems awkward, especially if i can't npm access set mfa=none status=public etc.

@lukekarrys lukekarrys added this to the v9.0.0 milestone Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants