Wang1rrr opened a new pull request, #7011:
URL: https://github.com/apache/rocketmq-dashboard/pull/7011

   ## Summary
   Closes #7010.
   
   Use UTF-8 explicitly for Basic credentials in both the data-source 
connection probe and the actual Prometheus-compatible range query. The previous 
Spring default is ISO-8859-1: it silently changes Latin-1 credential bytes and 
throws for Chinese/emoji credentials. ASCII headers remain byte-for-byte 
equivalent.
   
   This matches [Prometheus's documented UTF-8 password 
hashing](https://prometheus.io/docs/guides/basic-auth/#hashing-a-password) and 
[its authentication handler's comparison of the received password 
bytes](https://github.com/prometheus/exporter-toolkit/blob/v0.14.1/web/handler.go#L98-L119).
   
   ## Validation
   - Before: all 6 new cases fail, covering accented Latin characters, Chinese, 
and emoji in both request paths. The range fixture returns HTTP 401 for the 
wrong Basic header; unencodable credentials fail before sending.
   - After: `mvn -B -ntp -Dtest=PrometheusMetricsSourceTest,SettingsServiceTest 
test`: 77 tests pass on Java 21; Checkstyle passes.
   - The range-query cases exercise a local HTTP server and the 
connection-probe cases assert the exact request header. Existing ASCII and 
Bearer cases also pass.
   - `git diff --check` passes.
   - No external Prometheus deployment or full backend suite was run locally.
   
   AI assistance was used; the diff and before/after regression results were 
reviewed.
   
   


-- 
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]

Reply via email to