feat(security): add distributed authorization foundation

This commit is contained in:
2026-07-29 10:40:10 +08:00
parent c7f9a4e3c9
commit df88fa19cb
76 changed files with 22020 additions and 88 deletions

View File

@@ -1,16 +1,31 @@
namespace Tiku.Application.Security;
public enum SystemScopeCallerType
{
Platform,
Worker,
Migrator,
PublicQuestionBank,
Test
}
public sealed record SystemScopeRequest(
Guid? TargetTenantId,
SystemScopeCallerType CallerType,
string Caller,
string Reason,
string CorrelationId);
public interface ITenantExecutionScope
{
Task ExecuteAsync(
Guid? targetTenantId,
string reason,
SystemScopeRequest request,
Func<IServiceProvider, CancellationToken, Task> operation,
CancellationToken cancellationToken = default);
Task<TResult> ExecuteAsync<TResult>(
Guid? targetTenantId,
string reason,
SystemScopeRequest request,
Func<IServiceProvider, CancellationToken, Task<TResult>> operation,
CancellationToken cancellationToken = default);
}