ContainerImage.Pinniped/internal/controller/supervisorconfig
Ryan Richard f0d120a6ca Fix broken upstream OIDC discovery timeout added in previous commit
After noticing that the upstream OIDC discovery calls can hang
indefinitely, I had tried to impose a one minute timeout on them
by giving them a timeout context. However, I hadn't noticed that the
context also gets passed into the JWKS fetching object, which gets
added to our cache and used later. Therefore the timeout context
was added to the cache and timed out while sitting in the cache,
causing later JWKS fetchers to fail.

This commit is trying again to impose a reasonable timeout on these
discovery and JWKS calls, but this time by using http.Client's Timeout
field, which is documented to be a timeout for *each* request/response
cycle, so hopefully this is a more appropriate way to impose a timeout
for this use case. The http.Client instance ends up in the cache on
the JWKS fetcher object, so the timeout should apply to each JWKS
request as well.

Requests that can hang forever are effectively a server-side resource
leak, which could theoretically be taken advantage of in a denial of
service attempt, so it would be nice to avoid having them.
2021-07-08 09:44:02 -07:00
..
generator All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00
ldapupstreamwatcher Convert LDAP code to use endpointaddr package. 2021-05-25 16:17:27 -05:00
oidcupstreamwatcher Fix broken upstream OIDC discovery timeout added in previous commit 2021-07-08 09:44:02 -07:00
testdata Forgot to commit some test fixtures in a prior commit 2020-10-27 17:00:00 -07:00
upstreamwatchers Split package upstreamwatchers into four packages 2021-05-12 14:00:39 -07:00
federation_domain_watcher.go Use new 'go.pinniped.dev/generated/latest' package. 2021-02-16 13:00:08 -06:00
federation_domain_watcher_test.go All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00
jwks_observer.go Use new 'go.pinniped.dev/generated/latest' package. 2021-02-16 13:00:08 -06:00
jwks_observer_test.go All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00
jwks_writer.go Use new 'go.pinniped.dev/generated/latest' package. 2021-02-16 13:00:08 -06:00
jwks_writer_test.go All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00
tls_cert_observer.go Use new 'go.pinniped.dev/generated/latest' package. 2021-02-16 13:00:08 -06:00
tls_cert_observer_test.go All controller unit tests should not cancel context until test is over 2021-03-04 17:26:01 -08:00