-
Notifications
You must be signed in to change notification settings - Fork 40
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
[FEATURE] registry-scoped certfile and keyfile options #118
Comments
jenseng
added a commit
to jenseng/npm-registry-fetch
that referenced
this issue
Jul 12, 2022
Closes npm#118 RFC: npm/rfcs#591 Add support for registry-scoped certfile and keyfile options, e.g. ``` { "//my.registry.example/npm/:certfile": "~/.secret/stuff.crt", "//my.registry.example/npm/:keyfile": "~/.secret/stuff.key" } ``` Since these are registry-specific, they will override top-level cert and key options (if set). Like the top-level `cafile` option, these registry-scoped options are silently ignored if invalid.
jenseng
added a commit
to jenseng/npm-registry-fetch
that referenced
this issue
Jul 18, 2022
Closes npm#118 RFC: npm/rfcs#591 Add support for registry-scoped certfile and keyfile options, e.g. ``` { "//my.registry.example/npm/:certfile": "~/.secret/stuff.crt", "//my.registry.example/npm/:keyfile": "~/.secret/stuff.key" } ``` Since these are registry-specific, they will override top-level cert and key options (if set). Like the top-level `cafile` option, these registry-scoped options are silently ignored if invalid.
wraithgar
pushed a commit
that referenced
this issue
Jul 18, 2022
Closes #118 RFC: npm/rfcs#591 Add support for registry-scoped certfile and keyfile options, e.g. ``` { "//my.registry.example/npm/:certfile": "~/.secret/stuff.crt", "//my.registry.example/npm/:keyfile": "~/.secret/stuff.key" } ``` Since these are registry-specific, they will override top-level cert and key options (if set). Like the top-level `cafile` option, these registry-scoped options are silently ignored if invalid.
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What
Add support for registry-scoped
certfile
andkeyfile
options, e.g.Why
cert
andkey
at the top level, which means it could be used in connections against any registry. If your options are coming from@npmcli/config
, then there's not a good way to control this. Ideally a client certificate would only be presented to the registry that actually needs it, and you should be able to use different ones depending on the registry.cert
andkey
options are the actual contents of the cert/key, rather than paths to them. If your options are coming from@npmcli/config
, and the cert/key are auto-generated elsewhere, you need to then keep your use.npmrc
in sync with that process or specify them as env vars. Both options potentially weaken security (e.g. could be accidentally checked in,.npmrc
might be readable by other users, key could be extracted from/proc/<pid>/environ
, etc.).Current Workarounds
npm_config_cert
andnpm_config_key
env vars:Why
section).npmrc
with the desired settings and use it vianpm_config_userconfig
:Why
section)npm-registry-fetch
to inject thekey
/cert
as necessary@npmcli/config
as well 😅All the workarounds are problematic, and get even more complicated in dual-publishing scenarios. For example, you might want to scope the (bogus) credentials, but that can't be done via env vars due to this bug.
Notes
getCredentialsByURI
/etc. in@npmcli/config
ENEEDAUTH
error if doing a write to something other than login #38 and [BUG] ENEEDAUTH when authenticating against a registry via mTLS cli#4765 in the sense that these could be considered new authN-related options, i.e. custom registry authN could solely be done via mTLS, in which case we shouldn't throwENEEDAUTH
if these are set but token/credentials are not.The text was updated successfully, but these errors were encountered: