feat: modularize external providers

This commit is contained in:
2026-07-27 17:47:21 +08:00
parent db4c7b4496
commit 70b99e6063
47 changed files with 1219 additions and 667 deletions

View File

@@ -0,0 +1,23 @@
namespace Tiku.Application.Auth;
public sealed record IdentityProviderRequest(
Guid TenantId,
string Provider,
string Identifier,
string Secret,
string? IpAddress,
string? UserAgent);
public sealed record IdentityProviderResult(
string Provider,
string Subject,
string? Phone,
string? Email,
string? DisplayName);
public interface IIdentityProvider
{
Task<IdentityProviderResult> AuthenticateAsync(
IdentityProviderRequest request,
CancellationToken cancellationToken = default);
}

View File

@@ -0,0 +1,23 @@
using Tiku.Domain.Tenancy;
namespace Tiku.Application.Auth;
public sealed record SmsProviderSendRequest(
Guid TenantId,
string Phone,
SmsPurpose Purpose,
string Code,
string? IpAddress,
string? UserAgent);
public sealed record SmsProviderSendResult(
string Provider,
string Status,
string? MessageId = null);
public interface ISmsProvider
{
Task<SmsProviderSendResult> SendAsync(
SmsProviderSendRequest request,
CancellationToken cancellationToken = default);
}