You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unworked validation sweep: close task-057 minor findings
Address 18 of 25 minor findings on the credential-redaction operator<<
work (TASK-057); 7 acknowledged-no-action per reviewer guidance:
http_request.cpp cleanups
- Hoist iequal_ascii out of is_authorization_header_key into a file-scope
helper reusing http::http_header_toupper, so the case-fold matches the
rule header_view_map orders keys by.
- Unify dump_header_map_redacted and dump_cookie_map_redacted onto a
shared dump_map_redacted template parameterised by a ValueFor predicate.
- Hoist pass_out into std::string_view to drop the redact-path std::string
temporary.
- Document the HAVE_BAUTH-off / HAVE_DAUTH-off shape in dump_cookie_map_redacted.
Tests (http_request_operator_stream_test.cpp)
- Add operator_stream_no_credentials edge-case test.
- Pin "query args are never redacted" with .arg("page","2") + assertion.
- Pin Footer redaction with .footer("Authorization","Bearer footertoken").
- Split the brittle nested-quote Proxy-Authorization assertion into two
observable-property checks.
Docs and specs
- Add @warning block to operator<< Doxygen repeating the query-arg
verbatim-emission caveat.
- Add WARNING comment above the DEBUG-only body emit in
webserver_body_pipeline.cpp calling out the form-body credential risk.
- Reinforce development-only intent on create_test_request setter.
- Remove digested_pass from RELEASE_NOTES and v2-deferred-backlog-plan
(there was never such a field on the operator<< stream).
- Add §5.2.1 Diagnostic redaction to 05-cross-cutting.md and an
expose_credentials_in_logs paragraph to the create-webserver
component spec, mirroring expose_exception_messages.
Tested
- http_request_operator_stream: 3 tests / 24 checks pass.
- http_request_arena: 8 tests / 21 checks pass.
- libhttpserver.la rebuilds clean.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: specs/architecture/05-cross-cutting.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,10 @@
24
24
5.`feature_unavailable` is a normal `std::runtime_error`; no special status mapping. Users who care translate it explicitly.
25
25
6. There is no throw-as-status idiom. Users wanting 404/400/etc. construct the response by value: `return http_response::empty().with_status(404);`.
26
26
27
+
#### 5.2.1 Diagnostic redaction (TASK-057)
28
+
29
+
`http_request::operator<<` redacts credential material by default (CWE-312 / CWE-532): the Basic-auth `pass` field, `Authorization` and `Proxy-Authorization` header/footer values (case-insensitive), and every cookie value are replaced with the fixed token `<redacted>`. The username (REMOTE_USER) and query-string arguments are emitted verbatim. The v1 verbose-everything behaviour is opt-in for development via `create_webserver::expose_credentials_in_logs(true)` — the same security opt-in shape as `expose_exception_messages` above.
0 commit comments