Skip to content
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

Make secureGitUrl() warn for insecure Urls #5424

Merged
merged 3 commits into from
Apr 18, 2018
Merged

Make secureGitUrl() warn for insecure Urls #5424

merged 3 commits into from
Apr 18, 2018

Conversation

sth
Copy link
Contributor

@sth sth commented Feb 28, 2018

This is an updated version of #4809. It is rebased to current master and has some new tests added that verify the behavior of the modified secureGitUrl() function.

Summary
secureGitUrl() tries to make sure that we use secure URLs. It currently behaves inconsistently, like allowing plain http download without any warnings or raising SecurityError if a repository doesn't exist. See #4307 for details.

Main changes in behavior with this pull request:

  • Insecure http: and git: URLs are handled consistently:
    • Plain http: URLs without a commit hash now report a warning. Previously they were silently accepted.
    • Plain git: URLs without a commit hash now no longer raise a SecurityError. Instead they report a warning.
  • Non-existing or otherwise inaccessible repositories now no longer raise SecurityError. Previously this happend in some cases, leading to very confusing error messages.

For more context/rational see #4307 and the test cases in this pull request.

@buildsize
Copy link

buildsize bot commented Feb 28, 2018

This change will decrease the build size from 10.51 MB to 10.51 MB, a decrease of 1.59 KB (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 910.44 KB 910.27 KB -174 bytes (0%)
yarn-[version].js 3.96 MB 3.96 MB -574 bytes (0%)
yarn-legacy-[version].js 4.11 MB 4.11 MB -574 bytes (0%)
yarn-v[version].tar.gz 915.84 KB 915.73 KB -113 bytes (0%)
yarn_[version]all.deb 676.22 KB 676.03 KB -192 bytes (0%)

@arcanis
Copy link
Member

arcanis commented Apr 18, 2018

A bit late, but this looks good! Thanks @sth! 🙂

@arcanis arcanis merged commit 101d48f into yarnpkg:master Apr 18, 2018
@sth sth deleted the warn-insecure-urls branch May 15, 2018 22:45
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.

2 participants