Skip to content

Redact JSON bodies with a UTF-8 BOM - #54

Merged
itssimon merged 1 commit into
mainfrom
fix/utf8-bom-body-redaction
Oct 9, 2026
Merged

itssimon merged 1 commit into
mainfrom
fix/utf8-bom-body-redaction

Conversation

@itssimon

@itssimon itssimon commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

JSON bodies beginning with a UTF-8 byte order mark failed parsing and were exported as unmasked text. Skip a single leading BOM when creating Utf8JsonReader so JSON field masking applies to these bodies.

Validation:

  • make check passed.
  • make test passed all 175 existing tests on .NET 10.
  • A temporary synthetic reproduction through request capture, redaction, and OTLP serialization confirmed that plain and BOM-prefixed JSON both mask password and token.
  • GitHub Actions passed formatting, the .NET 8/9/10 test jobs, and the CI gate.

The Codecov checks fail because the new BOM branch is not exercised by the existing suite: patch coverage is 50.00%, and project coverage is 89.79% (-0.03 percentage points).

No tests were added. Local .NET 8 and 9 runs were unavailable because those runtimes are not installed; both passed in CI.

@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.79%. Comparing base (a2fb31a) to head (e0b5fcd).

Files with missing lines Patch % Lines
src/Apitally/Export/SpanRedaction.cs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   89.81%   89.79%   -0.03%     
==========================================
  Files          46       46              
  Lines        3506     3507       +1     
  Branches      412      413       +1     
==========================================
  Hits         3149     3149              
  Misses        268      268              
- Partials       89       90       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@itssimon
itssimon marked this pull request as ready for review October 9, 2026 11:29

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Turn on auto-fix | Re-trigger cubic

@itssimon
itssimon merged commit cd90a21 into main Oct 9, 2026
8 of 10 checks passed
@itssimon
itssimon deleted the fix/utf8-bom-body-redaction branch October 9, 2026 11:30
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.

1 participant