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

Use context in Kubernetes authentication #14724

Closed
nicolascb opened this issue Mar 25, 2022 · 2 comments · Fixed by #14775
Closed

Use context in Kubernetes authentication #14724

nicolascb opened this issue Mar 25, 2022 · 2 comments · Fixed by #14775
Labels
devex Developer Experience

Comments

@nicolascb
Copy link

nicolascb commented Mar 25, 2022

Is your feature request related to a problem? Please describe.

Today the Login method via Kubernetes receives a context but does not use it: api/auth/kubernetes/kubernetes.go#L70

Describe the solution you'd like

Using the latest version of the api, we can solve this problem like this:

api/auth/kubernetes/kubernetes.go#L77

-       resp, err := client.Logical().Write(path, loginData)
+       resp, err := client.Logical().WriteWithContext(ctx, path, loginData)

Describe alternatives you've considered
N/A

Explain any additional use-cases
N/A

@averche
Copy link
Contributor

averche commented Mar 29, 2022

Hi @nicolascb!

Thank you for this suggestion! Now that we have WithContext methods, this change is quite easy. I have a PR that takes care of all of our current auth helpers in on shot: #14775

@averche
Copy link
Contributor

averche commented Apr 6, 2022

I have merged the PR. Thank you for contributing to HashiCorp!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex Developer Experience
Projects
None yet
2 participants