Class QueryHealthAuthorization

Namespace
Cratis.Arc.Queries
Assembly
Cratis.Arc.Core.dll

Applies the configured query health access requirements at pipeline authorization boundaries.

public class QueryHealthAuthorization : IAnonymousEvaluator, IAuthorizationAttributeEvaluator
Inheritance
QueryHealthAuthorization
Implements
Inherited Members
Extension Methods

Constructors

QueryHealthAuthorization(IOptions<ArcOptions>)

Initializes a new instance of the QueryHealthAuthorization class without a host environment.

public QueryHealthAuthorization(IOptions<ArcOptions> options)

Parameters

options IOptions<ArcOptions>

The configured Arc options.

QueryHealthAuthorization(IOptions<ArcOptions>, IHostEnvironment?)

Applies the configured query health access requirements at pipeline authorization boundaries.

public QueryHealthAuthorization(IOptions<ArcOptions> options, IHostEnvironment? environment)

Parameters

options IOptions<ArcOptions>

The configured Arc options.

environment IHostEnvironment

The host environment.

Methods

GetAuthorizationInfo(MethodInfo)

Checks if the method has an authorization attribute and retrieves role information.

public (bool HasAuthorize, string? Roles)? GetAuthorizationInfo(MethodInfo method)

Parameters

method MethodInfo

The method to check.

Returns

(bool HasAuthorize, string Roles)?

Tuple with (hasAuthorize, roles) or null if this evaluator cannot determine.

GetAuthorizationInfo(Type)

Checks if the type has an authorization attribute and retrieves role information.

public (bool HasAuthorize, string? Roles)? GetAuthorizationInfo(Type type)

Parameters

type Type

The type to check.

Returns

(bool HasAuthorize, string Roles)?

Tuple with (hasAuthorize, roles) or null if this evaluator cannot determine.

IsAnonymousAllowed(MethodInfo)

Checks if anonymous access is allowed for the specified method.

public bool? IsAnonymousAllowed(MethodInfo method)

Parameters

method MethodInfo

The method to check.

Returns

bool?

True if anonymous access is allowed, false otherwise, or null if this evaluator cannot determine.

IsAnonymousAllowed(Type)

Checks if anonymous access is allowed for the specified type.

public bool? IsAnonymousAllowed(Type type)

Parameters

type Type

The type to check.

Returns

bool?

True if anonymous access is allowed, false otherwise, or null if this evaluator cannot determine.