opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

[baggage] validate key and values during baggage injection/extraction

Open lachmatt opened this issue 9 months ago • 1 comments

Fixes #5479 Design discussion issue #

Changes

  • Baggage item key is no longer encoded and decoded - it is validated against token requirement from the spec instead
  • Baggage item value is validated during extraction
  • Only invalid baggage items are rejected during injection
  • All of the baggage items are rejected during extraction if any of them is invalid (more strict than injection)

NOTE: Amount of allocations (e.g in extract part) can be reduced, I'd prefer to address it in a separate PR.

Merge requirement checklist

  • [x] CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • [x] Unit tests added/updated
  • [x] Appropriate CHANGELOG.md files updated for non-trivial changes
  • [ ] Changes in public API reviewed (if applicable)

lachmatt avatar May 23 '24 09:05 lachmatt