qianye1001 opened a new pull request, #10951:
URL: https://github.com/apache/rocketmq/pull/10951
### Which Issue(s) This PR Fixes
- Fixes #10950
### Brief Description
Configuration values are currently written directly to Proxy startup logs,
Broker and BrokerContainer update logs, object-property logs, and invalid
metrics-header warnings. This can expose TLS passwords, authentication
bootstrap data, inner-client credentials, and exporter headers.
This change:
- introduces a runtime `@SensitiveConfig` marker for explicitly sensitive
configuration fields;
- adds a shared log-only masking utility that preserves a short prefix and
suffix for troubleshooting;
- uses annotated masking when Proxy formats its startup configuration;
- masks sensitive values in Broker, BrokerContainer, Controller, and metrics
error logs;
- keeps a conservative key-name fallback for untyped `Properties`, where
field annotations are unavailable;
- leaves the existing raw `formatProxyConfig()` API unchanged and adds a
separate log-safe projection.
The configuration parsing, assignment, update, persistence, and
`DataVersion` behavior are unchanged.
### How Did You Test This Change?
- JDK 11 focused tests:
```text
mvn -pl common,remoting,auth,proxy -am \
-DskipITs -Dsurefire.failIfNoSpecifiedTests=false \
-Dtest=ConfigLogUtilsTest,MixAllTest,ConfigurationTest,ConfigurationManagerTest
test
```
All selected tests passed, including assertions that the raw formatter
retains the original value while the log formatter masks it.
- JDK 11 package validation:
```text
mvn -pl broker,proxy,controller,container -am -DskipTests package
```
All 13 reactor modules succeeded with Checkstyle and SpotBugs passing.
--
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]