refactor: consolidate backend into modular monolith

This commit is contained in:
2026-07-30 15:37:31 +08:00
parent 30fd159041
commit 7a73dcbd12
55 changed files with 20409 additions and 1728 deletions

View File

@@ -96,17 +96,6 @@ internal sealed class RedisSecurityStore(
}
}
public async Task SetInvalidationVersionAsync(
string realm,
Guid? tenantId,
Guid? userId,
long version,
CancellationToken cancellationToken = default)
{
var key = $"{prefix}:auth-inv:{Normalize(realm)}:{tenantId?.ToString("N") ?? "-"}:{userId?.ToString("N") ?? "-"}";
await connection.GetDatabase().StringSetAsync(key, version, TimeSpan.FromDays(2)).WaitAsync(cancellationToken);
}
private static string Normalize(string value) =>
string.Concat(value.Trim().ToLowerInvariant().Select(character =>
char.IsLetterOrDigit(character) || character is '-' or '_' ? character : '-'));
@@ -122,13 +111,6 @@ public sealed class NullRedisSecurityStore : IRedisSecurityStore
Task.FromResult(new DistributedRateLimitResult(true));
public Task<bool> PingAsync(CancellationToken cancellationToken = default) => Task.FromResult(false);
public Task SetInvalidationVersionAsync(
string realm,
Guid? tenantId,
Guid? userId,
long version,
CancellationToken cancellationToken = default) => Task.CompletedTask;
}
public sealed class RedisSecurityUnavailableException(Exception innerException)