npm / npm/cli

Add 2fa-required-unless-automation option for packages

Open
#4,244 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement ws:libnpmaccess
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

What / Why

There are three 2FA option values: required (required), not required (not-required), and required unless automation token (required-unless-automation). libnpmaccess only recognizes the first two. I would like to be able to access the third option.

When

When I want to use a script to enable 2FA+automation token, or to ensure this option is enabled, on all packages in an organization. Currently, I have to do this manually using the npmjs.com website.

Where

  • npm access

How

Currently, the option is a toggle:

  • npm access 2fa-required <package>
  • npm access 2fa-not-required <package>
Expected Behavior
  • npm access 2fa-required-unless-automation <package>

Who

Release managers and organization administrators.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the npm access command and the libnpmaccess handling of the existing 2FA option values. Trace how 2fa-required and 2fa-not-required are parsed and sent, then verify that npm access 2fa-required-unless-automation <package> enables the third option for a package.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
authentication, cli, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.