Heimdall token verifier: one process-wide instance owns the key cache
The verifier was registered as a typed client, which is transient, so each request would have started with an empty key cache. It is now a singleton that takes its HTTP client from the factory per fetch. Test hosts share one in-memory database root so EF keeps a single service provider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f3b8acbbc5
commit
e99eea8769
4 changed files with 9 additions and 5 deletions
|
|
@ -280,7 +280,7 @@ public sealed class HeimdallHost : TestWebApplicationFactory
|
|||
{
|
||||
services.RemoveAll<TimeProvider>();
|
||||
services.AddSingleton<TimeProvider>(Clock);
|
||||
services.AddHttpClient<HeimdallTokenVerifier>().ConfigurePrimaryHttpMessageHandler(() => Heimdall);
|
||||
services.AddHttpClient(HeimdallTokenVerifier.ClientName).ConfigurePrimaryHttpMessageHandler(() => Heimdall);
|
||||
services.AddHttpClient<HeimdallAuthService>().ConfigurePrimaryHttpMessageHandler(() => Heimdall);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue