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 PreAuthorize(AuthorizationArgs args, Dictionary state); Task Authorize(IPermission permission, AuthorizationArgs args, Dictionary state); Task> QueryDescriptors(); }