Repository navigation
[8.19] (backport #22573) use full credential in the api key cache key - #22577
Conversation
* use full credential in the api key cache key * remove redundant id (cherry picked from commit a2101d4) # Conflicts: # internal/beater/auth/authenticator_test.go
|
Cherry-pick of a2101d4 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved conflicts prevent the auth tests from compiling and require branch-compatible constructor and instrumentation fixes plus correct credential-cache assertions.
2 open issues
What changed in this PR
Backports #22573 to 8.19 so API-key privilege caching distinguishes credentials with the same ID but different secrets.
Changes:
- Uses a SHA-256 hash of the full credential, plus the resource, as the cache key.
- Updates cache tests for credential isolation, repeated lookups, and cache capacity.
| File | Description |
|---|---|
internal/beater/auth/authenticator_test.go |
Updates credential-isolation assertions and cache-test setup. |
internal/beater/auth/apikey.go |
Replaces ID-based cache keys with full-credential hashes. |
Review effort: Balanced
|
Dependency review finished without posting an analysis comment. If you expected a review, push a new commit to this pull request (or close and reopen it) to try again. Workflow run: https://github.com/elastic/apm-server/actions/runs/45532214613 |
💚 Build Succeeded
History
cc @aelnahas |
✅ Merged into
|

Motivation/summary
Cache API key privilege lookups per credential.
Checklist
For functional changes, consider:
How to test these changes
go test ./internal/beater/authRelated issues
This is an automatic backport of pull request #22573 done by [Mergify](https://mergify.com).