orangeCatDeveloper opened a new pull request, #4188:
URL: https://github.com/apache/hertzbeat/pull/4188

   ## What's changed?
   
   Fixes #2838.
   
   The `app-prestodb.yml` template's `status` and `task` metric http sections 
already referenced `^_^authType^_^` / `^_^username^_^` / `^_^password^_^` 
placeholders in their `authorization` blocks, but the corresponding params were 
never defined, so the monitor form offered no way to enter credentials for an 
auth-enabled PrestoDB.
   
   This PR:
   
   - defines the missing `authType` (Basic Auth / Digest Auth), `username` and 
`password` params, following the same structure as `app-api.yml`
   - adds the `authorization` block to the `cluster` (priority 0 availability 
probe) and `node` metrics, which previously sent unauthenticated requests — 
without this, an auth-enabled PrestoDB is marked unavailable even with 
credentials configured, since the availability probe gets 401 before the 
auth-wired metrics ever run
   - updates the en / zh-cn help docs, and aligns the zh-cn `启用HTTPS` row with 
the form field label
   - adds `PrestodbMonitorE2eTest`: unlike the existing http e2e tests it takes 
the protocol from the template definition after placeholder replacement 
(mirroring `WheelTimerTask#initJobMetrics`), so a metric whose http section 
lacks the authorization wiring fails the test with a 401. Covers both the 
authenticated path (all 4 metric groups collect through a mock server enforcing 
HTTP Basic Auth) and the rejection path (no credentials → collection fails)
   
   Verification beyond the e2e test: ran the template against a real 
`prestodb/presto` docker instance configured with 
`http-server.authentication.type=PASSWORD` (password-file authenticator, 
bcrypt) + HTTPS self-signed keystore, per the official security docs. With 
credentials all metric groups collect successfully over HTTPS Basic Auth; 
without credentials the availability probe is rejected with 401. Also verified 
all template field names against the live `/v1/cluster`, `/v1/status`, 
`/v1/node`, `/v1/task` responses.
   
   Note: PrestoDB's native password authentication (LDAP / password file) uses 
HTTP Basic over HTTPS; Digest Auth is not natively supported by Presto and is 
only useful behind a reverse proxy — the option is kept for consistency with 
other hertzbeat http templates.
   
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   - [x]  I have added the necessary unit tests and all cases have passed.
   
   ## Add or update API
   
   - [x] I have added the necessary [e2e 
tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have 
passed.


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

Reply via email to