Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent/cert: properly return the cached client on AuthClient #11576

Merged
merged 4 commits into from
May 12, 2021

Conversation

calvn
Copy link
Contributor

@calvn calvn commented May 11, 2021

This PR addresses a bug on the agent cert auto-auth method where the client returned was not the cached client if AuthClient was called on subsequent auth requests.

Possibly fixes #10835. This fixes an issue that had the same error message as the one reported there, but the error only appeared if auth.cert was expecting a cached client to be returned (e.g. due to a re-auth or retry after backoff)

Test fixtures were copied over from the api package in order to keep the tests lean and avoid instantiating a test cluster to dynamically generate them like we do on the end-to-end test (and thus carrying over a bunch of imports to the cert package).

@calvn calvn added this to the 1.7.2 milestone May 11, 2021
@calvn calvn requested review from tvoran, jasonodonnell and tomhjp May 11, 2021 01:46
command/agent/auth/cert/cert_test.go Outdated Show resolved Hide resolved
command/agent/auth/cert/cert_test.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – vault May 11, 2021 17:09 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook May 11, 2021 17:09 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook May 12, 2021 21:20 Inactive
@vercel vercel bot temporarily deployed to Preview – vault May 12, 2021 21:20 Inactive
@calvn calvn merged commit e2f4703 into master May 12, 2021
@calvn calvn deleted the agent-cert-auth-client-fix branch May 12, 2021 21:59
calvn added a commit that referenced this pull request May 12, 2021
* agent/cert: properly return the cached client on AuthClient

* test: pass in nil client config, check on pointer values directly

* test: pass in nil client config

* changelog: add changelog entry
calvn added a commit that referenced this pull request May 12, 2021
…11602)

* agent/cert: properly return the cached client on AuthClient

* test: pass in nil client config, check on pointer values directly

* test: pass in nil client config

* changelog: add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vault agent certificate authentication error
2 participants