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

[configopaque] Implement encoding.BinaryMarshaler interface for String #9279

Merged

Conversation

TylerHelmuth
Copy link
Member

Description:
Implements the encoding.BinaryMarshaler interface for String. This prevents the situation configopaque -> []byte -> string from leaking the String value.

Link to tracking Issue:
Closes #9272

Testing:
Added unit test

Copy link

codecov bot commented Jan 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (440bb82) 90.31% compared to head (74a5179) 90.33%.
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9279      +/-   ##
==========================================
+ Coverage   90.31%   90.33%   +0.02%     
==========================================
  Files         341      340       -1     
  Lines       18308    17970     -338     
==========================================
- Hits        16535    16234     -301     
+ Misses       1437     1412      -25     
+ Partials      336      324      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TylerHelmuth TylerHelmuth force-pushed the configopaque-implement-BinaryMarshaler branch from 32292d6 to bb3aa4d Compare January 16, 2024 16:19
@TylerHelmuth TylerHelmuth marked this pull request as ready for review January 16, 2024 16:19
@TylerHelmuth TylerHelmuth requested a review from a team as a code owner January 16, 2024 16:19
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

cc @bogdandrutu, will merge this by Friday morning EU time if there are no objections/the PR is not blocked. Please block if you need more time to think about this

Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

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

Approved. I don't see any reason not to add this support.

@mx-psi mx-psi merged commit 72f6ce1 into open-telemetry:main Jan 19, 2024
32 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 19, 2024
@TylerHelmuth TylerHelmuth deleted the configopaque-implement-BinaryMarshaler branch January 19, 2024 17:05
TylerHelmuth added a commit to TylerHelmuth/opentelemetry-collector that referenced this pull request Jan 23, 2024
open-telemetry#9279)

**Description:** <Describe what has changed.>
Implements the `encoding.BinaryMarshaler` interface for `String`. This
prevents the situation `configopaque` -> `[]byte` -> `string` from
leaking the `String` value.

**Link to tracking Issue:** <Issue number if applicable>
Closes
open-telemetry#9272

**Testing:** 
Added unit test

---------

Co-authored-by: Antoine Toulme <antoine@toulme.name>
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.

Should configopaque.String implement encoding.BinaryMarshaler?
3 participants