Files
tiku-backend.net/Tiku.Infrastructure/Auth/AuthServiceDependencies.cs
xiong 33375a38d7
Some checks failed
ci / release-gate (push) Has been cancelled
refactor(architecture): harden module boundaries
2026-08-04 12:10:36 +08:00

45 lines
2.4 KiB
C#

using Microsoft.AspNetCore.Identity;
using Tiku.Application.Auth;
using Tiku.Application.Security;
using Tiku.Application.Tenancy;
using Tiku.Domain.Identity;
using Tiku.Infrastructure.Persistence;
namespace Tiku.Infrastructure.Auth;
internal sealed record AuthServiceDependencies(
IIdentityPersistence IdentityPersistence,
ITenancyPersistence TenancyPersistence,
IJobsOperationsPersistence JobsOperationsPersistence,
SignInManager<User> SignInManager,
UserManager<User> UserManager,
ISmsVerificationService SmsVerificationService,
IAuthSessionStore SessionStore,
IWechatOAuthClient WechatOAuthClient,
ITenantExternalProviderConfigService ProviderConfigService,
IFeatureAccessService FeatureAccessService);
internal abstract partial class AuthServiceBase(AuthServiceDependencies dependencies)
{
protected IIdentityPersistence identityPersistence { get; } = dependencies.IdentityPersistence;
protected ITenancyPersistence tenancyPersistence { get; } = dependencies.TenancyPersistence;
protected IJobsOperationsPersistence jobsOperationsPersistence { get; } = dependencies.JobsOperationsPersistence;
protected SignInManager<User> signInManager { get; } = dependencies.SignInManager;
protected UserManager<User> userManager { get; } = dependencies.UserManager;
protected ISmsVerificationService smsVerificationService { get; } = dependencies.SmsVerificationService;
protected IAuthSessionStore sessionStore { get; } = dependencies.SessionStore;
protected IWechatOAuthClient wechatOAuthClient { get; } = dependencies.WechatOAuthClient;
protected ITenantExternalProviderConfigService providerConfigService { get; } = dependencies.ProviderConfigService;
protected IFeatureAccessService featureAccessService { get; } = dependencies.FeatureAccessService;
protected const string PasswordProvider = "password";
protected const string SmsProvider = "sms";
protected const string WechatWebProvider = "wechat_web";
protected const string WechatMiniAppProvider = "wechat_miniapp";
protected static readonly string[] WechatWebProviderAliases = ["wechat_web", "wechat-web", "wechat"];
protected static readonly string[] WechatMiniAppProviderAliases =
["wechat-miniapp", "wechat_miniapp", "wechat-mini", "wechatMiniapp"];
protected static readonly string[] WechatIdentityProviders =
["wechat_web", "wechat-web", "wechat", "wechat-miniapp", "wechat_miniapp", "wechat-mini", "wechatMiniapp"];
}