Skip to content

Prevent http.url containing credentials in HttpClientTracer - #2707

Merged
trask merged 7 commits into
open-telemetry:mainfrom
Hangzhi:no-credentials-in-httpurl
May 7, 2021
Merged

Prevent http.url containing credentials in HttpClientTracer#2707
trask merged 7 commits into
open-telemetry:mainfrom
Hangzhi:no-credentials-in-httpurl

Conversation

@Hangzhi

@Hangzhi Hangzhi commented Apr 3, 2021

Copy link
Copy Markdown
Contributor

Fixes this #2674

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 3, 2021

Copy link
Copy Markdown

CLA Signed

The committers are authorized under a signed CLA.

@Hangzhi
Hangzhi requested a review from anuraaga April 6, 2021 07:32
fix inconsistency in protocol

@mateuszrzeszutek mateuszrzeszutek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We also have a few more usages of this attribute: HttpAttributesExtractor from the instrumenter API (should #url() return URI? I think it should), the HttpServerTracer, apache-camel and aws-lambda instrumentations.

Can you fix all of them? Thanks!

Comment on lines +186 to +196
setter.setAttribute(
SemanticAttributes.HTTP_URL,
new URI(
url.getScheme(),
null,
url.getHost(),
url.getPort(),
url.getPath(),
url.getQuery(),
url.getFragment())
.toString());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hi @Hangzhi! I think it would be a worthwhile optimization here to only create a new URI object when the existing URI has user-info

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Hangzhi, are you willing to address this comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the help @Hangzhi I've gone ahead and applied this suggestion to the PR

@Hangzhi
Hangzhi requested a review from laurit as a code owner May 7, 2021 03:41
@anuraaga anuraaga changed the title Prevent http.url containing credentials Prevent http.url containing credentials in HttpClientTracer May 7, 2021
@trask
trask merged commit 60ee981 into open-telemetry:main May 7, 2021
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.

5 participants