Skip to content

Support 2FA --otp=123456 #1091

Closed
Closed

Description

@hzoo

https://docs.npmjs.com/getting-started/using-two-factor-authentication

Need a prompt to be able to pass this for publishing, etc (right before since not that much time)

EDIT: current workaround is NPM_CONFIG_OTP=123456 lerna publish

Activity

  1. evocateur commented on Oct 30, 2017

    @evocateur
    Member

    I'm worried that we'll have to re-prompt if publishes start failing (due to expired TOTP). Really exposes how un-tested and gnarly our current publish failure handling is. :/

  2. hzoo commented on Oct 30, 2017

    @hzoo
    ContributorAuthor

    Yeah that's what happened, also since we published like 100 pkgs and it would expire in between (had to just turn it off)

  3. djfarrelly commented on Nov 3, 2017

    @djfarrelly

    To help people in the short term, perhaps npm's tokens could help. Creating a wrapper script to generate a token, adding it to your .npmrc then publishing using lerna then removing and deleting the token could work.

    Docs: https://docs.npmjs.com/getting-started/working_with_tokens
    Other helpful info: https://circleci.com/docs/1.0/npm-private-module-dependency/

  4. rhysforyou commented on Feb 11, 2018

    @rhysforyou

    For people finding this through Google, I'd like to point out that a good workaround is to set the NPM_CONFIG_OTP environment variable before running lerna publish, e.g.

    NPM_CONFIG_OTP=123456 lerna publish
  5. added this to the v3.0.0 milestone on Feb 28, 2018
  6. jthegedus commented on Mar 5, 2018

    @jthegedus

    The above solution doesn't seem to work with Yarn & lerna as a devDep, eg:

    NPM_CONFIG_OTP=123456 yarn lerna publish

    It still fails on the OTP during publication 😞

  7. evocateur commented on Mar 5, 2018

    @evocateur
    Member
  8. jthegedus commented on Mar 5, 2018

    @jthegedus

    Fair point. I was under the impression that Yarn read all of npm's configs, wishful thinking. A note for others nonetheless.

  9. teppeis commented on May 5, 2018

    @teppeis
    Contributor

    Yarn's issue: yarnpkg/yarn#4904

  10. dupski commented on May 13, 2018

    @dupski

    +1 for lerna to prompt for this, although NPM_CONFIG_OTP seems to work ok. Turning off 2FA doesn't seem like a good solution :)

  11. evocateur commented on Jul 4, 2018

    @evocateur
    Member

    @iarna (from the npm team) suggested running npm pack initially and then prompting for the OTP and publishing the tarballs concurrently. I think approach this has lots of promise!

  12. rgbkrk commented on Jul 12, 2018

    @rgbkrk

    As a result of the recent compromise, I'd love to be able to enforce 2FA across our org. Is there a way to do the npm pack approach with lerna now or does this need work within lerna itself?

  13. 53 remaining items

  14. added a commit that references this issue on Mar 5, 2019
  15. ricmoo commented on Mar 5, 2019

    @ricmoo

    Can you point me in the right direction as to which file I need to update/patch to change the studio to "inherit"?

    Thanks!! :)

  16. evocateur commented on Mar 6, 2019

    @evocateur
    Member
  17. ricmoo commented on Mar 6, 2019

    @ricmoo

    I see. That may explain why the export technique isn’t working for me either then?

    Is there any existing work around? Even if it involves patching the bin/lerna?

  18. ricmoo commented on Mar 7, 2019

    @ricmoo

    @imaman Can you share your technique for patching? :)

  19. busticated commented on Mar 7, 2019

    @busticated
  20. imaman commented on Mar 7, 2019

    @imaman

    @ricmoo: there's a branch called "one-time-password-to-rule-them-all" which contains a proposed solution.

    Link to the branch: https://github.com/lerna/lerna/tree/one-time-password-to-rule-them-all

  21. ricmoo commented on Mar 7, 2019

    @ricmoo

    @busticated Oh, I meant specifically what lines and files to modify for the purpose of OTP w/ Lerna. :)

    @imaman Is that safe? I checked it out the other day and it was 114 commits behind... :s (or do you mean just copy the otpplease and co?)

  22. imaman commented on Mar 7, 2019

    @imaman

    @ricmoo: The actual fix is very small so I selectively copied only this part. Unfortunately, I am away from my laptop for the next 10 days so I can't send you a copy-and-paste snippet.

  23. ricmoo commented on Mar 7, 2019

    @ricmoo

    @imaman No worries, that helps a tonne. I'll copy it over (maybe experiment with a smaller test repo first). :)

  24. added a commit that references this issue on May 13, 2019
    c56bda1
  25. evocateur commented on May 14, 2019

    @evocateur
    Member

    Published in v3.14.0. Used it to publish it, even. ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions