Skip to content

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

Merged
mergify[bot] merged 2 commits into
8.19from
mergify/bp/8.19/pr-22573
Nov 25, 2026
Merged

mergify[bot] merged 2 commits into
8.19from
mergify/bp/8.19/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)

# Conflicts:
#	internal/beater/auth/authenticator_test.go
@mergify
mergify Bot requested a review from a team as a code owner November 24, 2026 23:48
@mergify mergify Bot added backport conflicts There is a conflict in the backported pull request labels Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 23:48
@mergify mergify Bot added the conflicts There is a conflict in the backported pull request label Nov 24, 2026
@mergify

mergify Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of a2101d4 has failed:

On branch mergify/bp/8.19/pr-22573
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit a2101d4.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   internal/beater/auth/apikey.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/beater/auth/authenticator_test.go

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-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.

🟡 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

@github-actions

github-actions Bot commented Nov 24, 2026 •

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/45532214613

Copilot AI balanced review requested due to automatic review settings November 25, 2026 02:20

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 block the backport of credential-specific API key caching.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @aelnahas

@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 8.19 as f2a63af at 02:38 UTC

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

So far

  • ✅ Entered the queue Wed 25 Nov, 02:29 · rule default · triggered by rule squash and merge backport PRs after CI passes
  • ✅ Passed · draft #22581
  • ✅ Merged 02:38 · f2a63af · 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 branch protection, 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 branch protection:
    • check-success = CLA
    • check-neutral = CLA
    • check-skipped = CLA
  • any of · required by GitHub branch protection:
    • check-success = lint
    • check-neutral = lint
    • check-skipped = lint
  • any of · required by GitHub branch protection:
    • check-success = buildkite/docs-build-pr
    • check-neutral = buildkite/docs-build-pr
    • check-skipped = buildkite/docs-build-pr

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit f2a63af into 8.19 Nov 25, 2026
52 checks passed
@mergify
mergify Bot deleted the mergify/bp/8.19/pr-22573 branch November 25, 2026 02:38
@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

backport conflicts There is a conflict in the backported pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants