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

[ADDED] ConnectedUrlRedacted() that does not return the password #923

Merged
merged 1 commit into from Mar 9, 2022

Conversation

ripienaar
Copy link
Contributor

Signed-off-by: R.I.Pienaar rip@devco.net

Signed-off-by: R.I.Pienaar <rip@devco.net>
@ripienaar ripienaar requested a review from kozlovic March 9, 2022 16:51
@@ -1803,6 +1803,21 @@ func (nc *Conn) ConnectedUrl() string {
return nc.current.url.String()
}

// ConnectedUrlRedacted reports the connected server's URL with passwords redacted
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you connect with like nats://user:password@foo:4222 ConnectedUrl() returns the password in clear, this just an easier way to get something safely logable

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 85.142% when pulling c024098 on ripienaar:redacted_connected_url into 2f2f696 on nats-io:main.

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kozlovic kozlovic changed the title adds a redacted version of ConnectedUrl() [ADDED] ConnectedUrlRedacted() that does not return the password Mar 9, 2022
@kozlovic kozlovic merged commit 8045a50 into nats-io:main Mar 9, 2022
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.

None yet

3 participants