sollhui opened a new pull request, #69621:
URL: https://github.com/apache/doris/pull/69621
### What problem does this PR solve?
COPY upload and query requests log their headers before authentication.
Their private header collector records raw Authorization values, cookies and
tokens. For example, a COPY request carrying Basic credentials writes the
reversible credential into the INFO log.
Extract Stream Load's existing case-insensitive redaction policy into
`HttpHeaderUtils` and apply it to both COPY header logs and Stream Load header
logs. Sensitive values render as `***MASKED***`, while diagnostic fields such
as `fileName` and `label` retain their values. The original request headers
remain available to authentication and forwarding.
Master already masks Stream Load headers in BE and avoids printing
credentials when FE authentication parsing fails; this change shares the FE
policy with the remaining COPY paths and strengthens regression coverage.
### Release note
COPY upload and query request logs now mask Authorization,
Proxy-Authorization, Cookie, Set-Cookie, token, Auth-Token and auth_code
headers regardless of case.
### Check List (For Author)
- Test
- [x] Unit Test: the 3 `HttpHeaderUtilsTest` tests passed in an isolated
Maven harness compiling the actual production utility and test source with
`--release 17` on the available JDK 20. Cases cover header-name casing,
Basic/Bearer/malformed credentials, preserving original authentication headers,
and ordinary diagnostic headers.
- [x] Manual test: Doris Checkstyle passed for all 6 changed Java files;
`git diff --check` passed.
- Added `CopyIntoActionTest` and strengthened `LoadActionTest` to cover
the controller header renderers. These controller tests have not been executed
locally: `run-fe-ut.sh --run
org.apache.doris.httpv2.util.HttpHeaderUtilsTest,org.apache.doris.httpv2.rest.CopyIntoActionTest,org.apache.doris.httpv2.rest.LoadActionTest`
exits during JDK initialization because the configured JDK 17 installation
lacks `lib/modules`. Thirdparty/protoc build dependencies are also unavailable
locally. Full FE validation is left to CI.
- Behavior changed:
- [x] Yes. COPY request logs redact credential-bearing headers.
Authentication and forwarding continue using the original values; Stream Load
retains its existing masking behavior.
- Does this need documentation?
- [x] No.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]