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

x/any: make the netrc parser importable #31334

Open
kevinburke opened this issue Apr 8, 2019 · 4 comments
Open

x/any: make the netrc parser importable #31334

kevinburke opened this issue Apr 8, 2019 · 4 comments
Labels
FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@kevinburke
Copy link
Contributor

There are two implementations of a netrc parser: one lives in src/cmd/go/internal/web2/web.go and the other one lives in x/tools/cmd/auth/netrcauth/netrcauth.go.

Apart from the fact that these two implementations may differ in how they parse the spec this is a useful piece of functionality written by people with a high degree of trust and it would be nice if this library could be imported from somewhere.

@gopherbot gopherbot added this to the Unreleased milestone Apr 8, 2019
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 9, 2019
@bcmills bcmills self-assigned this Apr 9, 2019
@bcmills
Copy link
Contributor

bcmills commented Apr 9, 2019

CC @rogpeppe for github.com/rogpeppe/go-internal.

Note that the netrc parser is currently in flux for #26232.

Honestly, though, if you need to consume its output I would rather you just shell out to x/tools/cmd/auth/netrcauth: that command-line API will need to be stable by 1.13, and it's very easy to parse using textproto, so I'm not sure we need to add a Go package API on top of it.

@josharian
Copy link
Contributor

Aside: Possibly a good candidate for fuzzing. cc @thepudds

@kevinburke
Copy link
Contributor Author

Alright, I might push a proposed interface to github.com/kevinburke/netrc and we can see how it looks.

netrcauth seems like it would do what I want, but the goal would be to use it in API clients such as github.com/kevinburke/twilio-go or github.com/kevinburke/travis and I'm not sure I want to count on end users having a second binary - netrcauth - on their machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

6 participants
@josharian @kevinburke @ALTree @bcmills @gopherbot and others