Repository navigation
[9.5] (backport #22573) use full credential in the api key cache key - #22575
Merged
Merged
Conversation
* use full credential in the api key cache key * remove redundant id (cherry picked from commit a2101d4)
Contributor
🤖 GitHub commentsJust comment with:
|
1 task
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change isolating cached API key privileges by full credential.
No open issues 🎉
What changed in this PR
Backports #22573 to 9.5, isolating cached API key privileges by the full credential rather than API key ID.
Changes:
- Uses a SHA-256 credential hash plus resource as the cache key.
- Updates regression coverage to reject a different secret for the same API key ID while preserving cache hits for valid credentials.
| File | Description |
|---|---|
internal/beater/auth/authenticator_test.go |
Tests credential-specific rejection and caching; adjusts cache capacity. |
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/45513058283 |
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).