forked from gongxuegit/tiku-backend.net
feat: modularize external providers
This commit is contained in:
23
Tiku.Application/Auth/IIdentityProvider.cs
Normal file
23
Tiku.Application/Auth/IIdentityProvider.cs
Normal 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);
|
||||
}
|
||||
23
Tiku.Application/Auth/ISmsProvider.cs
Normal file
23
Tiku.Application/Auth/ISmsProvider.cs
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user