Skip to content

[9.6] (backport #22573) use full credential in the api key cache key - #22574

Merged
mergify[bot] merged 1 commit into
9.6from
mergify/bp/9.6/pr-22573
Nov 25, 2026
Merged

mergify[bot] merged 1 commit into
9.6from
mergify/bp/9.6/pr-22573

Conversation

@mergify

@mergify mergify Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Motivation/summary

Cache API key privilege lookups per credential.

Checklist

For functional changes, consider:

  • Is it observable through the addition of either logging or metrics?
  • Is its use being published in telemetry to enable product improvement?
  • Have system tests been added to avoid regression?

How to test these changes

go test ./internal/beater/auth

Related issues


This is an automatic backport of pull request #22573 done by [Mergify](https://mergify.com).

* use full credential in the api key cache key

* remove redundant id

(cherry picked from commit a2101d4)
@mergify
mergify Bot requested a review from a team as a code owner November 24, 2026 23:48
@mergify mergify Bot added the backport label Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 23:48
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change that isolates cached API key privilege lookups by full credential.

No open issues 🎉

What changed in this PR

Backports #22573 to 9.6, isolating cached API key privilege lookups by full credential rather than API key ID.

Changes:

  • Uses a SHA-256 hash of the credential plus the resource as the cache key.
  • Updates regression tests to reject different credentials sharing an ID while preserving valid credential cache hits.
File Description
internal/​beater/​auth/​authenticator_test.go Tests credential-specific rejection and cache reuse; adjusts cache capacity.
internal/​beater/​auth/​apikey.go Replaces ID-based cache keys with full-credential hashes.

Review effort: Balanced

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

cc @aelnahas

@github-actions

Copy link
Copy Markdown
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/45513030239

@mergify mergify Bot added the queued label Nov 25, 2026
@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Merged into 9.6 as 61c1ee8 at 11:24 UTC

10 min in the queue, 9 min of it CI.

So far

  • ✅ Entered the queue Wed 25 Nov, 11:14 · rule default · triggered by rule squash and merge backport PRs after CI passes
  • ✅ Passed · draft #22582
  • ✅ Merged 11:24 · 61c1ee8 · squash
9 merge conditions met
  • check-success=CLA
  • check-success=lint
  • check-success=system-test
  • check-success=test (macos-latest)
  • github-review-approved · required by GitHub repository ruleset rule 9.*, GitHub repository ruleset rule [org] Require a PR for Renovate and GitHub repository ruleset rule [org] Require a PR
  • any of:
    • check-success=test (windows-2025)
    • check-success=test (windows-latest)
  • any of · required by GitHub repository ruleset rule 9.*:
    • check-success = lint
    • check-neutral = lint
    • check-skipped = lint
  • any of · required by GitHub repository ruleset rule 9.*:
    • check-success = buildkite/docs-build-pr
    • check-neutral = buildkite/docs-build-pr
    • check-skipped = buildkite/docs-build-pr
  • any of · required by GitHub repository ruleset rule 9.*:
    • check-success = CLA
    • check-neutral = CLA
    • check-skipped = CLA

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 61c1ee8 into 9.6 Nov 25, 2026
68 checks passed
@mergify
mergify Bot deleted the mergify/bp/9.6/pr-22573 branch November 25, 2026 11:24
@mergify mergify Bot removed the queued label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants