A provider behind the same Traefik answers 404 while its router is not
loaded, and 502 or 503 while it restarts. GetProviderMetadata returned
these statuses as a plain error, so the startup retries stopped at the
first attempt. After that, nothing retried until a request arrived, and
that request got the 503 page (#147).
- GetProviderMetadata returns a non-200 status as *HTTPError, so the
startup retries apply to 429 and 5xx.
- RetryConfig gets RetryableStatusCodes. MetadataFetchRetryConfig sets
it to 404, so only discovery retries a 404.
- If startup discovery fails, the init goroutine retries in the
background (5 s, doubling up to 60 s, with jitter). It stops when
metadata is adopted or when Close cancels the instance context.
- GetMetadataWithRecovery takes a context, so Close also ends the
startup retries.
- Background attempts log at ERROR for the first three and every tenth,
at DEBUG otherwise. A document with no usable issuer does not end
recovery. A Close during the startup retries logs at DEBUG only.
- The 503 served while metadata is unavailable or initialization times
out carries Retry-After: 10, and the startup error log names the
middleware.
TestMetadataRecoveryOnProviderFailure and the issue152 cold-start test
now serve 400 for a failed discovery, because startup retries 500 and
503 and these tests need init to fail at once.
Issue #152 asks for a manual introspection endpoint because some IdPs
omit introspection_endpoint from discovery. Analysis found the two
documented overrides revocationURL and oidcEndSessionURL were dead
code: the 1b49e13 rebuild dropped their constructor wiring.
Add the IntrospectionURL config field and wire all three overrides.
The overrides apply inside updateMetadataEndpoints, so they survive
every metadata refresh. A manual value always wins over discovery.
The constructor also seeds the live fields, so a failed discovery
does not lose operator configuration.
Manual values skip the poisoned-discovery defences on purpose. They
sit at the same trust tier as providerURL and isValidSecureURL gates
them at config time.
Add issue152_regression_test.go: 8 tests pin precedence, refresh
survival, cold-start seeding, end-to-end introspection over HTTP,
and the validation contract.