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

net/url: add URL.Redacted to return a password scrubbed string #35578

Closed
wants to merge 1 commit into from

Conversation

nrxr
Copy link

@nrxr nrxr commented Nov 14, 2019

Returning an URL.String() without the password is very useful for
situations where the URL is supposed to be logged and the password is
not useful to be shown.

This method re-uses URL.String() but with the password scrubbed and
substituted for a "xxxxx" in order to make it obvious that there was a
password. If the URL had no password then no "xxxxx" will be shown.

Fixes #34855

@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Nov 14, 2019
@gopherbot
Copy link
Contributor

This PR (HEAD: 4a3b9c2) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Brad Fitzpatrick:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from nrxr:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 7ec1240) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@nrxr nrxr force-pushed the feat/add-net-url-redacted branch from 7ec1240 to 43e2477 Compare November 15, 2019 01:39
@gopherbot
Copy link
Contributor

This PR (HEAD: 43e2477) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 3:

(4 comments)

Thank you for this change nrxr, and apologies for the late review!

I’ve added some suggestions, please take a look.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@nrxr nrxr force-pushed the feat/add-net-url-redacted branch from 43e2477 to e56499a Compare April 7, 2020 00:17
@gopherbot
Copy link
Contributor

This PR (HEAD: e56499a) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@nrxr nrxr force-pushed the feat/add-net-url-redacted branch from e56499a to 4c0d033 Compare April 7, 2020 00:20
@gopherbot
Copy link
Contributor

This PR (HEAD: 4c0d033) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from nrxr:

Patch Set 5:

(4 comments)

Patch Set 3:

(4 comments)

Thank you for this change nrxr, and apologies for the late review!

I’ve added some suggestions, please take a look.

ACK


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@nrxr nrxr force-pushed the feat/add-net-url-redacted branch from 4c0d033 to ad2e110 Compare April 7, 2020 00:26
@gopherbot
Copy link
Contributor

This PR (HEAD: ad2e110) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from nrxr:

Patch Set 6:

Hi Emmanuel,

Seems like I can't edit the commit within gerrit so you would have to edit it by yourself in order to match your suggestion.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 6:

(3 comments)

Patch Set 6:

Hi Emmanuel,

Seems like I can't edit the commit within gerrit so you would have to edit it by yourself in order to match your suggestion.

Thank you for these change nrxr! Just 3 more minor changes and good to go.
You'll need to manually edit commits in the Github PR description and title.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@nrxr nrxr changed the title net/url: add URL.Redacted() to return password-free string net/url: add URL.Redacted to return a password scrubbed string Apr 8, 2020
Returning an URL.String() without the password is very useful for
situations where the URL is supposed to be logged and the password is
not useful to be shown.

This method re-uses URL.String() but with the password scrubbed and
substituted for a "xxxxx" in order to make it obvious that there was a
password. If the URL had no password then no "xxxxx" will be shown.

Fixes golang#34855
@nrxr nrxr force-pushed the feat/add-net-url-redacted branch from ad2e110 to 46d06db Compare April 8, 2020 10:20
@gopherbot
Copy link
Contributor

This PR (HEAD: 46d06db) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/207082 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from nrxr:

Patch Set 8:

(3 comments)

Patch Set 6:

(3 comments)

Patch Set 6:

Hi Emmanuel,

Seems like I can't edit the commit within gerrit so you would have to edit it by yourself in order to match your suggestion.

Thank you for these change nrxr! Just 3 more minor changes and good to go.
You'll need to manually edit commits in the Github PR description and title.

Done. Now I know how to update the description and title here. Thanks!


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 8: Run-TryBot+1 Code-Review+2

Thank you nrxr! LGTM

RELNOTE=yes


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 8:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=5d5039d3


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 8:

Build is still in progress...
This change failed on (x/tools) linux-amd64:
See https://storage.googleapis.com/go-build-log/5d5039d3/linux-amd64_21d2bf87.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 8: TryBot-Result-1

2 of 20 TryBots failed:
Failed on (x/tools) linux-amd64: https://storage.googleapis.com/go-build-log/5d5039d3/linux-amd64_21d2bf87.log
Failed on linux-386: https://storage.googleapis.com/go-build-log/5d5039d3/linux-386_5a80b2ac.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 8: Run-TryBot+1

Patch Set 8: TryBot-Result-1

2 of 20 TryBots failed:
Failed on (x/tools) linux-amd64: https://storage.googleapis.com/go-build-log/5d5039d3/linux-amd64_21d2bf87.log
Failed on linux-386: https://storage.googleapis.com/go-build-log/5d5039d3/linux-386_5a80b2ac.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.

These look like flakes unrelated to this change.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 8:

Build is still in progress...
This change failed on (x/tools) linux-amd64:
See https://storage.googleapis.com/go-build-log/5d5039d3/linux-amd64_733cb69c.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 8:

Hey Ian, could you please help me rebase this CL? The tree seems to be from November 2019, and we have some unrelated test failures. I don’t have the bit to rebase CLs so can’t do it myself. Thank you!


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 8: TryBot-Result-1

1 of 20 TryBots failed:
Failed on (x/tools) linux-amd64: https://storage.googleapis.com/go-build-log/5d5039d3/linux-amd64_733cb69c.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 9: Patch Set 8 was rebased


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 9: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 9:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=1786d441


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 9: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Apr 8, 2020
Returning an URL.String() without the password is very useful for
situations where the URL is supposed to be logged and the password is
not useful to be shown.

This method re-uses URL.String() but with the password scrubbed and
substituted for a "xxxxx" in order to make it obvious that there was a
password. If the URL had no password then no "xxxxx" will be shown.

Fixes #34855

Change-Id: I7f17d81aa09a7963d2731d16fe15c6ae8e2285fc
GitHub-Last-Rev: 46d06db
GitHub-Pull-Request: #35578
Reviewed-on: https://go-review.googlesource.com/c/go/+/207082
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 9:

Thank you Ian for the rebase help and trybot run!


Please don’t reply on this GitHub thread. Visit golang.org/cl/207082.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/207082 has been merged.

@gopherbot gopherbot closed this Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net/url: add URL.Redacted to return password-free string
3 participants