Repository navigation
refactor!: Component identifier representation standardized - #204
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
- Coverage 97.98% 97.96% -0.02%
==========================================
Files 23 23
Lines 1635 1623 -12
==========================================
- Hits 1602 1590 -12
Misses 33 33 ☔ View full report in Codecov by Harness. |
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a breaking change to component identifier representation
Motivation
Previously,
httpsigsupported two representations of HTTP message component identifiers inWithComponents():@methodorcontent-digest;req."@method"or"content-digest";req.However, the public API became inconsistent with the implementation of #166 and #176 in how these identifiers were returned:
SignatureRequest.Componentscontained serialized Structured Fields Items.SignatureInfo.ComponentsandVerifiedSignature.Componentsused simplified, unquoted identifiers as map keys.This asymmetry could lead to surprising behavior. An identifier accepted by
WithComponents()or returned byParseAcceptSignature()could not necessarily be reused as a key when accessing the covered component values.To eliminate this ambiguity, all public string-based component identifier APIs now consistently use the RFC 9421 Structured Fields Item representation.
Migration guide
Update component configuration
Before:
After:
Previously valid unquoted identifiers now result in
ErrInvalidComponentIdentifierwhen the option is applied.Update component map lookups
Both
SignatureInfo.Components, available during key resolution, andVerifiedSignature.Components, available after successful verification, now use serialized identifiers as keys.Before:
After: