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

Baggage Member values are being validated in the Go Member data structure #2523

Closed
williamgcampbell opened this issue Jan 19, 2022 · 1 comment · Fixed by #3226
Closed

Baggage Member values are being validated in the Go Member data structure #2523

williamgcampbell opened this issue Jan 19, 2022 · 1 comment · Fixed by #3226
Labels
bug Something isn't working

Comments

@williamgcampbell
Copy link

Description

I saw #2498 around validating too often, but this ticket is asserting that we should not be validating the Member values at all in the Go data structure. The values should be encoded before transit, and decoded back into plaintext form when put back into the data structure. This is mentioned in #2519.

The otel spec has more vanilla language than the W3C spec about Member values. As I understand it, the values should be encoded for transit only.

Environment

  • OS: linux/mac
  • Architecture: x86_64
  • Go Version: 1.17
  • opentelemetry-go version: v1.2.0

Steps To Reproduce

  1. Using the baggage module, create a new Member with a value that contains any characters that should be ignored according to the W3C spec
  2. Any function that validates will return an error

Example:

func TestBaggageMember(t *testing.T) {
	_, err := baggage.NewMember("key", "a,2")
	require.NoError(t, err) // fail
}

Expected behavior

No validation is done when creating or manipulating member values in the Go structures, and proper encoding is done before the propagation of values.

@williamgcampbell williamgcampbell added the bug Something isn't working label Jan 19, 2022
@dmathieu
Copy link
Member

dmathieu commented Apr 4, 2022

I'm not sure this issue is still accurate.
NewMember will require valid/unencoded values. But I believe that's the proper behavior for that method.
Since #2529, Parse will however properly decode values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants