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

cmd/pprof: use netrc for user/password authentication #39187

Open
prashantv opened this issue May 21, 2020 · 3 comments
Open

cmd/pprof: use netrc for user/password authentication #39187

prashantv opened this issue May 21, 2020 · 3 comments

Comments

@prashantv
Copy link
Contributor

@prashantv prashantv commented May 21, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/prashant/Library/Caches/go-build"
GOENV="/Users/prashant/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/prashant/gocode"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.2_1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.2_1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/db/_9qlqsfd5zbckpmfx7jbkpr80000gn/T/go-build663148624=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Use go tool pprof to fetch a profile from an internal site that is protected behind auth. Authentication information is written to ~/.netrc and curl -n <url> works fine. Since Go supports netrc for getting modules, it would be great if pprof could similarly support netrc files.

What did you expect to see?

go tool pprof to use authentication information from ~/.netrc.

What did you see instead?

401, as the user/information is not used.

@prashantv prashantv changed the title cmd/pprof: Use netrc for user/password information®cmd cmd/pprof: Use netrc for user/password information May 21, 2020
@prashantv prashantv changed the title cmd/pprof: Use netrc for user/password information cmd/pprof: Use netrc for user/password authentication May 21, 2020
@cagedmantis cagedmantis changed the title cmd/pprof: Use netrc for user/password authentication cmd/pprof: use netrc for user/password authentication May 21, 2020
@cagedmantis cagedmantis added this to the Backlog milestone May 21, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented May 21, 2020

/cc @hyangah

@hyangah
Copy link
Contributor

@hyangah hyangah commented May 24, 2020

@bcmills what do you think about moving cmd/go/internal/auth to somewhere so cmd/pprof can reuse?

@bcmills
Copy link
Member

@bcmills bcmills commented Jul 20, 2020

I think it would be fine to factor out cmd/go/internal/auth to somewhere in cmd/internal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.