Repository navigation
[9.4] (backport #22573) use full credential in the api key cache key - #22576
Merged
Merged
Conversation
* use full credential in the api key cache key * remove redundant id (cherry picked from commit a2101d4)
1 task
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change to credential-specific API key privilege caching.
No open issues 🎉
What changed in this PR
Backports #22573 to 9.4, updating API key privilege caching to distinguish full credentials rather than sharing cached results by API key ID.
Changes:
- Builds cache keys from a SHA-256 hash of the full credential plus the resource.
- Updates the regression test to reject different credentials sharing an ID while preserving cache hits for valid credentials.
| File | Description |
|---|---|
internal/beater/auth/authenticator_test.go |
Verifies credential-specific caching and adjusts the test request limit. |
internal/beater/auth/apikey.go |
Replaces ID-based cache keys with hashed full-credential keys. |
Review effort: Balanced
💚 Build Succeeded
cc @aelnahas |
Contributor
|
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/45513070076 |
aelnahas
approved these changes
Nov 25, 2026
Contributor
Author
✅ Merged into
|
24 of 37 tasks
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.
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).