fix: [processor/signingprocessor] scalar type collision - #50892
Conversation
|
@surpradhan what do you think? That should close the scalar collision gap, right? It's a follower of #50884 |
|
Yes @hilmarf, that closes it. I ran the pairs against the branch and they all separate now: One non-blocking note : |
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-11 07:01 UTC Review the latest changes. Status above doesn't look right?
|
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
Signed-off-by: Hilmar Falkenberg <hilmar.falkenberg@sap.com>
80e4be1 to
7408cf7
Compare
addressed in 7408cf7 |
|
@surpradhan other edge cases I should cover? If not, please approve the PR. Thanks a lot for your valuable inputs. It's good to have someone else, being familiar with the pitfalls of canonization. |
|
@hilmarf, I just ran them plus a few more, it looks right. One pair left: Approving. Enjoyed poking at this one. |
…#50919) **Description** - serializeLogRecord only signed string bodies; all other body types were dropped. - That meant a structured-body record and a no-body record could produce the same canonical bytes and verify against each other’s signature. - The fix uses valueToInterface for any non-empty body, matching attribute handling and inheriting the same UTF-8 and depth checks. - Unset bodies are still omitted, so no-body records are unchanged. - Canonical bytes now change for non-string bodies, so existing signatures for those records won’t reproduce. Hence breaking. Note: bodies now inherit the same scalar ambiguity/int64 precision issue as attributes; #50892 fixes that too. **Tracking issue** Fixes #50911 **Testing** covered all body types, distinct structured bodies, no-body behavior, UTF-8/depth validation, and full sign/verify for a map body. The existing int-body test only checked for a non-empty payload, which is why this slipped through. **Documentation** `main` already lists body without a string-only restriction, so this fix aligns the implementation with the README. The (string only) wording comes from #50892. - [x] I, a human, wrote this pull request description myself.
Description
PutInt("k", 123)andPutStr("k", "123")produced identical canonical JSON, so one signature covered both values. Each scalar type is now wrapped in a single-key object keyed by type name (matching OTLP/JSON conventions), making every type distinct.Existing signatures are invalidated by this change, but the component is in development state.
SeverityNumberandSeverityTextare no longer included in the signed payload; the audit logging spec marks them as SHOULD NOT.Link to tracking issue
follow up on: #50884
Testing
added new
TestScalarTypeCollisionDocumentation
README.md updated
Authorship