feat(infrastructure): register Google OAuth2 services and dispatcher; add Microsoft.Extensions.Http package reference

This commit is contained in:
2026-08-17 15:06:11 +02:00
parent 6ff01b364c
commit 3ddd5e83a2
2 changed files with 11 additions and 1 deletions

View File

@@ -29,8 +29,17 @@ public static class DependencyInjection
IConfiguration configuration)
{
// --- External Services ---
// OAuth2 token services — provider-specific implementations registered separately,
// dispatcher is the single IOAuth2TokenService consumed by all other services.
services.AddSingleton<MicrosoftOAuth2TokenService>();
services.AddSingleton<GoogleOAuth2TokenService>();
services.AddSingleton<IOAuth2TokenService, OAuth2TokenServiceDispatcher>();
services.AddHttpClient(nameof(GoogleOAuth2TokenService));
services.AddHttpClient(nameof(GoogleOAuth2AuthorizationService));
services.AddSingleton<IOAuth2AuthorizationService, GoogleOAuth2AuthorizationService>();
// Email Service - SMTP outbound (Limilabs Mail.dll) - OAuth2 aware
services.AddSingleton<IOAuth2TokenService, MicrosoftOAuth2TokenService>();
services.AddSingleton<LimilabsEmailService>();
services.AddSingleton<IEmailService>(sp => sp.GetRequiredService<LimilabsEmailService>());

View File

@@ -23,6 +23,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.10" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.65.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.11" />