Skip to content

Conversation

@Aeolun
Copy link

@Aeolun Aeolun commented Aug 4, 2022

This prevents arborist from changing URL's that are specified as git+https from being transformed into git+ssh regardless of whether or not authentication has been specified in the package.json.

We shouldn't try to guess what the user intended. If they specify either https or ssh then that's what will be used.

Details

This uses a fix roughly based on a suggestion by @denenr in #4305. I've also taken the liberty of cleaning up the humongous nested ternary statement.

Fixes #4305
Fixes #2610

@Aeolun Aeolun requested a review from a team as a code owner August 4, 2022 03:32
@Aeolun Aeolun force-pushed the bugfix/use-specified-resolution-protocol branch from 7bd8fc5 to d7b405a Compare August 4, 2022 04:03
@Aeolun Aeolun closed this Aug 4, 2022
@Aeolun
Copy link
Author

Aeolun commented Aug 4, 2022

This doesn't actually work. I will resubmit when I know what the issue is.

oldium added a commit to oldium/npm-cli that referenced this pull request Oct 27, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keep the fall-back to git+ssh when the protocol is not specified.

Supercedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Oct 27, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keep the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Oct 27, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keeps the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Oct 27, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keeps the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Oct 27, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keeps the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Nov 12, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keeps the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
oldium added a commit to oldium/npm-cli that referenced this pull request Nov 15, 2025
This prevents changing URLs from https and git+https into git+ssh, but
keeps the fall-back to git+ssh when the protocol is not specified.

Supersedes npm#5256
Fixes npm#4305
Fixes npm#2610

Signed-off-by: Oldřich Jedlička <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] git+https protocol not respected when generating package-lock.json [BUG] NPM v7 uses SSH instead of an explicit HTTPS for GitHub repos

1 participant