22.121. Class AuthorizationPolicyProvider
Namespace: ArmoniK.Core.Common.Auth.Authorization
Assembly: ArmoniK.Core.Common.dll
Class used by the authorization middleware to generate the policy from its name and configuration
public class AuthorizationPolicyProvider : IAuthorizationPolicyProvider
22.121.1. Inheritance
22.121.2. Implements
22.121.3. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
22.121.4. Constructors
22.121.4.1. AuthorizationPolicyProvider(IOptionsMonitor<AuthenticatorOptions>)
Creates the authorization policy provider from the options
public AuthorizationPolicyProvider(IOptionsMonitor<AuthenticatorOptions> options)
22.121.4.1.1. Parameters
options IOptionsMonitor<AuthenticatorOptions>
Options
22.121.5. Methods
22.121.5.1. GetAlwaysTruePolicyAsync()
Get an authorization policy accepting anything
public static Task<AuthorizationPolicy> GetAlwaysTruePolicyAsync()
22.121.5.1.1. Returns
Policy returning true all the time
22.121.5.2. GetDefaultPolicyAsync()
Get an authorization policy where the user needs to be authenticated
public Task<AuthorizationPolicy> GetDefaultPolicyAsync()
22.121.5.2.1. Returns
Default authorization policy
22.121.5.3. GetFallbackPolicyAsync()
Get a null authorization policy, falling back to other policies
public Task<AuthorizationPolicy?> GetFallbackPolicyAsync()
22.121.5.3.1. Returns
Null policy (fallback)
22.121.5.4. GetPolicyAsync(string)
Get the policy associated with the given name
public Task<AuthorizationPolicy?> GetPolicyAsync(string policyName)
22.121.5.4.1. Parameters
policyName string
Name of the policy
22.121.5.4.2. Returns
Authorization policy