You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
using Connected.Security.Permissions;
|
|
|
|
|
|
|
|
|
|
namespace Connected.Security.Authorization.Middleware;
|
|
|
|
|
|
|
|
|
|
public enum AuthorizationProviderResult
|
|
|
|
|
{
|
|
|
|
|
Success = 1,
|
|
|
|
|
Fail = 2,
|
|
|
|
|
NotHandled = 3
|
|
|
|
|
}
|
|
|
|
|
public interface IAuthorizationMiddleware : IMiddleware
|
|
|
|
|
{
|
|
|
|
|
string Id { get; }
|
|
|
|
|
Task<AuthorizationProviderResult> PreAuthorize(AuthorizationArgs args, Dictionary<string, object> state);
|
|
|
|
|
Task<AuthorizationProviderResult> Authorize(IPermission permission, AuthorizationArgs args, Dictionary<string, object> state);
|
|
|
|
|
Task<ImmutableList<IPermissionSchemaDescriptor>> QueryDescriptors();
|
|
|
|
|
}
|