Support OTP fetching from config.otpUrl#176
Support OTP fetching from config.otpUrl#176dominykas wants to merge 5 commits intosemantic-release:masterfrom
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