Support NPM OTP token
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start with bin/publib-npm around the npm publish invocation referenced in the issue, then inspect the surrounding publishing flow and existing tests. Compare the proposed environment-variable and interactive approaches against the npm OTP behavior. Done means publishing with a 2FA-enabled npm account can receive an OTP through a documented, tested path.
Written by the indexing model from the issue text.
Description
Problem
NPM package can't be published with publib when 2FA is configured in the target NPM account.
Details
npm publish command used in publib-npm (source) requires an --opt flag when 2FA is configured. There's no equivalent env variable according to NPM docs.
Workaround
I was able to publish an NPM package by editing publib sources in node_modules. I added the --otp flag in node_modules/.bin/publib-npm:
npm publish ${tag} ${access} ${file} --otp <my_temp_code> 2>&1 | tee ${log}
Suggested Solution
An NPM_OTP_TOKEN env variable could be supported by publib and used as the --otp flag value in the npm publish command. This won't be the optimal solution, though, as the OTP token is short-lived and will have to be updated right before running the publib command. A better solution would be to somehow allow npm publish to run in interactive mode and prompt the user for the OTP token. (see NPM OTP option docs).
- Dominant language
- TypeScript
- Stars
- 61
- Forks
- 25
- Avg merge
- 3m
- Merged PRs (30d)
- 17
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cdklabs/publib
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
cdklabs/publib#1716 · 17 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
Workspace package - publib-npm fails to detect dist/js/*.tgz and creates new empty tgzPossibly taken @sap1110 claimed this 23 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
Pin dependenciesOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
cdklabs/publib#1116 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
cdklabs/publib#874 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
ranxianglei/billion-context#7860 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
agent-oc-find-bugs api complexity → simple payment-methods recurring contributions reviewed stripe
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencollective/opencollective#9177 ·