kubeguard / guard

🔑 Kubernetes Authentication & Authorization WebHook Server
https://kubeguard.dev
Apache License 2.0
590 stars 81 forks source link

Use the request context throughout the code, and add retries & timeouts to more Azure auth provider calls #358

Closed AzureMarker closed 1 year ago

AzureMarker commented 1 year ago

There are two improvements in this PR:

  1. The request context is used. This context gets canceled when the client cancels the request or the connection closes, stopping operations from running longer than needed.
  2. The Azure auth provider uses a retryable HTTP client with request timeouts wherever possible. This should improve the reliability of the provider when network connectivity is unstable.

Tested by deploying to an Azure Resource Bridge and verifying auth calls to Guard still worked.

AzureMarker commented 1 year ago

lgtm. @AzureMarker should we go ahead and merge?

Yes, if possible (we need an approval from someone who is authorized to merge).