]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/web: merge internal/web2 into web
authorBryan C. Mills <bcmills@google.com>
Fri, 5 Apr 2019 13:26:24 +0000 (09:26 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 23 Apr 2019 21:11:28 +0000 (21:11 +0000)
commit58de7c6d4838729c6c133d9b2461dc6b1f766b76
treebdb3902bda6f0182be6386e261ae9f605a141564
parent807761f3345b264ceb6f5b6fdd804f5c34d4ee51
cmd/go/internal/web: merge internal/web2 into web

The cmd/go/internal/web package was forked in order to support direct
HTTPS fetches from widely-used hosting providers,¹ but direct fetches
were subsequently dropped in CL 107657. The forked web2 package, with
its GitHub-specific diagnostics and .netrc support, remained in use
for module proxy support, but was not used for the initial '?go-get=1'
path resolution, so the .netrc file was only used to fetch from
already-resolved module protocol servers.

This CL moves the .netrc support into its own (new) package,
cmd/go/internal/auth, and consolidates the web and web2 packages back
into just web. As a result, fetches via the web package now support
.netrc, and fetches that previously used web2 now enforce the same
security policies as web (such as prohibiting HTTPS-to-HTTP
redirects).

¹https://github.com/golang/vgo/commit/63138cb6ceed7d6d4e51a8cbd568c64bd3e2b132

Fixes #29591
Fixes #29888
Fixes #30610
Updates #26232

Change-Id: Ia3a13526e443679cf14a72a1f3db96f336ce5e73
Reviewed-on: https://go-review.googlesource.com/c/go/+/170879
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
20 files changed:
src/cmd/go/internal/auth/auth.go [new file with mode: 0644]
src/cmd/go/internal/auth/netrc.go [new file with mode: 0644]
src/cmd/go/internal/auth/netrc_test.go [moved from src/cmd/go/internal/web2/web_test.go with 95% similarity]
src/cmd/go/internal/bug/bug.go
src/cmd/go/internal/get/get.go
src/cmd/go/internal/get/vcs.go
src/cmd/go/internal/get/vcs_test.go
src/cmd/go/internal/modfetch/noweb.go [deleted file]
src/cmd/go/internal/modfetch/proxy.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/modfetch/web.go [deleted file]
src/cmd/go/internal/web/api.go [new file with mode: 0644]
src/cmd/go/internal/web/bootstrap.go
src/cmd/go/internal/web/http.go
src/cmd/go/internal/web/security.go [deleted file]
src/cmd/go/internal/web2/web.go [deleted file]
src/cmd/go/internal/webtest/test.go [deleted file]
src/cmd/go/testdata/script/get_404_meta.txt [new file with mode: 0644]
src/cmd/go/testdata/script/get_insecure_redirect.txt
src/cmd/go/testdata/script/mod_auth.txt [new file with mode: 0644]