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

Support context propagation in http clients #14070

Closed
ilyakaznacheev opened this issue Feb 15, 2022 · 3 comments · Fixed by #14388
Closed

Support context propagation in http clients #14070

ilyakaznacheev opened this issue Feb 15, 2022 · 3 comments · Fixed by #14388

Comments

@ilyakaznacheev
Copy link

Is your feature request related to a problem? Please describe.
In the case of long requests, it is impossible to terminate them via context cancellation.

Describe the solution you'd like
Add methods with context propagation, e.g.

  • ReadContext(ctx context.Context, path string) (*Secret, error)
  • ListContext(ctx context.Context, path string) (*Secret, error)
  • WriteContext(ctx context.Context, path string, data map[string]interface{}) (*Secret, error)
  • etc.

Describe alternatives you've considered
No alternatives in the context of Golang best practices.

Explain any additional use-cases
It can take a long time for a certificate to be generated in the Vault. It may be necessary to abort the request and terminate the job correctly.

Additional context
No change of existing methods/signatures is required. New methods will be added. The only difference is using the context passed to the method as a parameter instead of context.Background().

@ilyakaznacheev
Copy link
Author

We need this functionality, so I'm ready to implement if a quick release is possible.

@ilyakaznacheev
Copy link
Author

All methods are implemented, with 100% backward compatibility. Waiting for review.

@ilyakaznacheev
Copy link
Author

Sorry for the mess, still working on my rebase skills

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment