GQL Authorization Middleware implemented, will take care of controllers next.

This commit is contained in:
David Lebee
2021-02-04 21:00:24 -05:00
parent 45279da02b
commit 3e6c76ab18
9 changed files with 183 additions and 4 deletions
@@ -0,0 +1,9 @@
namespace PoweredSoft.CQRS.Abstractions.Security
{
public enum AuthorizationResult
{
Unauthorized,
Forbidden,
Allowed
}
}
@@ -0,0 +1,11 @@
using System;
using System.Threading;
using System.Threading.Tasks;
namespace PoweredSoft.CQRS.Abstractions.Security
{
public interface ICommandAuthorizationService
{
Task<AuthorizationResult> IsAllowedAsync(Type commandType, CancellationToken cancellationToken = default);
}
}
@@ -0,0 +1,12 @@
using System;
using System.Threading;
using System.Threading.Tasks;
namespace PoweredSoft.CQRS.Abstractions.Security
{
public interface IQueryAuthorizationService
{
Task<AuthorizationResult> IsAllowedAsync(Type queryType, CancellationToken cancellationToken = default);
}
}