maintenance: scope Grafana request authentication - #4288
Open
zqr10159 wants to merge 1 commit into
Open
Conversation
Member
Author
|
Author validation update: Basic authentication was not removed. Every Grafana request still uses createHeaders(), which builds the Authorization Basic header from the configured username and password. The removed code was only a second persistent BasicAuthenticationInterceptor on the shared RestTemplate, which accumulated credentials across requests. This was verified against a real Grafana 13.1.1 instance using a real RestTemplate: listing service accounts, creating the HertzBeat service account, and issuing its token all succeeded. Focused tests passed (4 plus one temporary live smoke), all current GitHub checks are green, and the temporary Grafana test and runtime artifacts were not committed. |
zqr10159
marked this pull request as ready for review
July 31, 2026 02:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Authorization: Basic ...header on every Grafana service-account requestThe three request paths still call
createHeaders(). That unchanged helper builds the Basic header from the configured Grafana username and password. This change only removes the additional shared interceptor.Validation
./mvnw -pl hertzbeat-grafana -Dtest=ServiceAccountServiceTest,DashboardServiceTest test -DskipITs -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=falseLive smoke: Grafana 13.1.1 with a real
RestTemplateand Basic admin credentials successfully listed service accounts, created the HertzBeat service account, and issued its token. The temporary live test passed 1/1 and was not committed.AI assistance: used for draft implementation and test iteration.
Human validation: focused Grafana service tests passed (4 tests); live Grafana 13.1.1 service-account flow passed (1 test); Checkstyle and diff checks passed.
Risk notes: request Authorization headers are unchanged; the persistent shared-client interceptor is no longer installed.