|
1 | 1 | using CodeBeam.UltimateAuth.Core.Domain; |
2 | | -using CodeBeam.UltimateAuth.Core.MultiTenancy; |
3 | 2 |
|
4 | 3 | namespace CodeBeam.UltimateAuth.Core.Abstractions; |
5 | 4 |
|
6 | | -/// <summary> |
7 | | -/// Low-level persistence abstraction for refresh tokens. |
8 | | -/// NO validation logic. NO business rules. |
9 | | -/// </summary> |
10 | 5 | public interface IRefreshTokenStore |
11 | 6 | { |
12 | | - Task StoreAsync(TenantKey tenant, StoredRefreshToken token, CancellationToken ct = default); |
| 7 | + Task ExecuteAsync(Func<CancellationToken, Task> action, CancellationToken ct = default); |
13 | 8 |
|
14 | | - Task<StoredRefreshToken?> FindByHashAsync(TenantKey tenant, string tokenHash, CancellationToken ct = default); |
| 9 | + Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>> action, CancellationToken ct = default); |
15 | 10 |
|
16 | | - Task RevokeAsync(TenantKey tenant, string tokenHash, DateTimeOffset revokedAt, string? replacedByTokenHash = null, CancellationToken ct = default); |
| 11 | + Task StoreAsync(RefreshToken token, CancellationToken ct = default); |
17 | 12 |
|
18 | | - Task RevokeBySessionAsync(TenantKey tenant, AuthSessionId sessionId, DateTimeOffset revokedAt, CancellationToken ct = default); |
| 13 | + Task<RefreshToken?> FindByHashAsync(string tokenHash, CancellationToken ct = default); |
19 | 14 |
|
20 | | - Task RevokeByChainAsync(TenantKey tenant, SessionChainId chainId, DateTimeOffset revokedAt, CancellationToken ct = default); |
| 15 | + Task RevokeAsync(string tokenHash, DateTimeOffset revokedAt, string? replacedByTokenHash = null, CancellationToken ct = default); |
21 | 16 |
|
22 | | - Task RevokeAllForUserAsync(TenantKey tenant, UserKey userKey, DateTimeOffset revokedAt, CancellationToken ct = default); |
| 17 | + Task RevokeBySessionAsync(AuthSessionId sessionId, DateTimeOffset revokedAt, CancellationToken ct = default); |
| 18 | + |
| 19 | + Task RevokeByChainAsync(SessionChainId chainId, DateTimeOffset revokedAt, CancellationToken ct = default); |
| 20 | + |
| 21 | + Task RevokeAllForUserAsync(UserKey userKey, DateTimeOffset revokedAt, CancellationToken ct = default); |
23 | 22 | } |
0 commit comments