45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using DysonNetwork.Common.Models;
|
|
using DysonNetwork.Pass.Features.Auth.Models;
|
|
|
|
namespace DysonNetwork.Pass.Features.Auth.Services;
|
|
|
|
public interface IAccountService
|
|
{
|
|
/// <summary>
|
|
/// Creates a new account from OIDC user info
|
|
/// </summary>
|
|
Task<Common.Models.Account> CreateAccount(Common.Models.OidcUserInfo userInfo);
|
|
|
|
/// <summary>
|
|
/// Finds an account by email
|
|
/// </summary>
|
|
Task<Common.Models.Account?> FindByEmailAsync(string email);
|
|
|
|
/// <summary>
|
|
/// Finds an account by ID
|
|
/// </summary>
|
|
Task<Common.Models.Account?> FindByIdAsync(string accountId);
|
|
|
|
/// <summary>
|
|
/// Updates an existing account
|
|
/// </summary>
|
|
Task UpdateAccount(Common.Models.Account account);
|
|
|
|
/// <summary>
|
|
/// Finds or creates an account based on OIDC user info
|
|
/// </summary>
|
|
Task<Common.Models.Account> FindOrCreateAccountAsync(Common.Models.OidcUserInfo userInfo, string provider);
|
|
|
|
/// <summary>
|
|
/// Gets an account by ID
|
|
/// </summary>
|
|
Task<Common.Models.Account?> GetAccountByIdAsync(Guid accountId);
|
|
|
|
/// <summary>
|
|
/// Generates authentication tokens for an account
|
|
/// </summary>
|
|
Task<AuthTokens> GenerateAuthTokensAsync(Common.Models.Account account, string sessionId);
|
|
}
|