forked from gongxuegit/tiku-backend.net
feat(security): add distributed authorization foundation
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user