Wire auto-auth self-healing channels into Vault Agent cache handler#32002
Open
VishalGawade1 wants to merge 2 commits into
Open
Wire auto-auth self-healing channels into Vault Agent cache handler#32002VishalGawade1 wants to merge 2 commits into
VishalGawade1 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
374ba62 to
3883f06
Compare
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.
Description
Fixes #31995.
Vault Agent's auto-auth self-healing (introduced in #26307) is not wired up for the cache/proxy listener. In
command/proxy.go, after the auth handler is created, the localauthInProgressandinvalidTokenErrChvariables are reassigned to the auth handler'sAuthInProgress/InvalidTokenchannels before being passed tocache.ProxyHandler. The equivalent reassignment is missing incommand/agent.go, so the cache handler ends up sending on an orphaned, unbuffered channel with no reader.As a result, when
vault agentis run with a cache listener and the auto-auth token is revoked, a request made with the revoked token hangs until timeout instead of triggering re-authentication (and each such request leaks a blocked goroutine). This affects both the leaseCache and api_proxy proxier paths, since both receive the same channels.This PR adds the missing reassignment in
command/agent.go, mirroringcommand/proxy.go, and adds a regression test (TestAgent_ReTriggerAutoAuth_RevokedToken) modeled on the existingTestProxy_ReTriggerAutoAuth_RevokedToken. With the fix the test passes; reverting the fix makes the revoked-token request hang, which the test's timeout guard catches.@heatherezell — as discussed in the issue, here's the PR. Thanks!
PCI review checklist