fix(http): fall back to metadata logging in strictmode - #4440
Open
stevenvegt wants to merge 2 commits into
Open
Conversation
http.log=metadata-and-body logs full request and response bodies at Info severity. The loggable content types include application/json and application/x-www-form-urlencoded, which are exactly the OAuth token endpoint's request and response types, so client assertions, VP tokens, authorization codes and issued access tokens all reach the log in full. In strictmode the value is now reset to metadata with a warning at startup, following the existing warn-and-override precedent for unsafe-but-valid configuration values (auth.accesstokenlifespan, cpuprofile). Startup is not failed: remediation for the operator is removing a single config value, and a security patch must be safe to apply without reading release notes. Assisted-by: AI
stevenvegt
requested review from
Dirklectisch,
JorisHeadease,
gerardsn,
reinkrul and
woutslakhorst
as code owners
July 30, 2026 14:47
Assisted-by: AI
Contributor
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (2)
🛟 Help
|
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.

In strictmode,
http.log: metadata-and-bodyis now reset tometadataat startup, with a warning. Bodies on the OAuth endpoints contain credentials (client_assertion, VP tokens, authorization codes, issued access tokens) and the body logger's loggable content types (application/json,application/x-www-form-urlencoded) are exactly the token endpoint's request and response types, so full body logging must not be possible on a strictmode node.Startup is deliberately not failed. This follows the existing warn-and-override precedent for valid-but-unsafe configuration values:
auth.accesstokenlifespanis overridden with a warning in strictmode (auth/services/oauth/authz_server.go), andcpuprofileis ignored with a warning (cmd/root.go). A misspelled key leaves the operator's intent unknowable, but a valid-but-unsafe value has a known safe alternative to fall back to.Documentation: the strictmode summary in
configuration.rstnow lists this override, and thehttp.logflag description mentions it (withserver_options.rstregenerated, which re-padded the whole generated table).Testing:
TestEngine_LoggingMiddlewaregains a subtestbodyLogger is disabled in strict modethat POSTs a JSON body containingvery-secret-requestto a strictmode-configured engine returningvery-secret-response, and asserts that a metadata entry is logged (msg="HTTP request",status=200), that neither secret string reaches the log, that the effective config is reset tometadata, and that the startup warning is emitted. Before the fix this test showed both bodies logged in full at Info. The pre-existingbodyLoggersubtest now setsStrictmode = falseexplicitly, sinceNewServerConfig()defaults to strictmode and it tests the non-strict behavior.