-
Notifications
You must be signed in to change notification settings - Fork 122
Support OTP fetching from config.otpUrl #176
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
Conversation
Note: this does not yet assert that the OTP was actually sent over to npm.
|
Reading through the documentation of https://github.com/nearform/optic I don't think using it require any modification in this plugin. In your CI you could simply set Because the OTP is valid only for a few seconds you could do that via a {
"scripts": {
"prepublishOnly": "export NPM_CONFIG_OTP=$(curl -s $NPM_OTP_URL/$OTP_TOKEN)"
}
}I would rather not make any change in this plugin not recommending any particular solution in the doc out of security concern. |
|
No luck: https://travis-ci.org/dominykas/allow-scripts/jobs/575685664#L310 I suspected this might happen, because I had tried playing around with env vars in a different context - they don't carry through, i.e. npm does not see an env vars from one of I'll try writing the otp into an No luck: https://travis-ci.org/dominykas/allow-scripts/jobs/575690340#L316 It can probably be worked around by using the No luck with exec: https://travis-ci.org/dominykas/allow-scripts/jobs/576303090#L347 I might not be writing the param correctly or it is unsupported via the The only way I could get the env var to work was to set it directly before calling Edit: also just realized that setting it before executing Would it make sense to replace |
|
Closing per #234 (comment) |
Tested on one of my own packages: works like magic!
I think I got the coverage right, but I'm still not sure how to assert that
--otpwas passed through to npm. npm will send the OTP inside thenpm-otpheader, but short of adding a proxy around the couch app, I'm not sure if it's even possible to observe that in any way.See also: #93