books/backend/Books.Api/EventFlow/Repositories/IApiKeyRepository.cs

25 lines
657 B
C#
Raw Normal View History

namespace Books.Api.EventFlow.Repositories;
public interface IApiKeyRepository
{
Task<ApiKeyValidationDto?> GetByIdForValidationAsync(string apiKeyId, CancellationToken cancellationToken = default);
Task<IReadOnlyList<ApiKeyDto>> GetByCompanyIdAsync(string companyId, CancellationToken cancellationToken = default);
}
public record ApiKeyValidationDto(
string ApiKeyId,
string Name,
string KeyHash,
string CompanyId,
bool IsActive);
public record ApiKeyDto(
string Id,
string Name,
string CompanyId,
string CreatedBy,
DateTime CreatedAt,
bool IsActive,
DateTime? RevokedAt,
string? RevokedBy);