using System.Security.Claims;
namespace DramaLing.Api.Services.Infrastructure.Authentication;
///
/// Token 處理服務介面
///
public interface ITokenService
{
///
/// 驗證 JWT Token
///
Task ValidateTokenAsync(string token);
///
/// 從 Token 提取用戶 ID
///
Task ExtractUserIdAsync(string token);
///
/// 從 Authorization Header 提取用戶 ID
///
Task GetUserIdFromHeaderAsync(string? authorizationHeader);
///
/// 檢查 Token 是否有效
///
Task IsTokenValidAsync(string token);
///
/// 取得 Token 的過期時間
///
Task GetTokenExpiryAsync(string token);
}
///
/// 用戶身份服務介面
///
public interface IUserIdentityService
{
///
/// 取得當前用戶 ID
///
Task GetCurrentUserIdAsync();
///
/// 檢查用戶是否為 Premium
///
Task IsCurrentUserPremiumAsync();
///
/// 取得用戶角色
///
Task> GetUserRolesAsync(Guid userId);
///
/// 檢查用戶權限
///
Task HasPermissionAsync(Guid userId, string permission);
}