ASPSecurityKitRegistryBase
Members
Namespace: ASPSecurityKit.Net
Assembly: ASPSecurityKit.Net.dll
Summary
Base class to encapsulate logic to register dependencies for .NET.
Constructors
#ctor()
Summary
Initializes a new instance of the ASPSecurityKitRegistryBase class.
Parameters
This constructor has no parameters.
Methods
Register(containerBuilder,authRequestDefinitionRegistrar,authRequestDefinitionType,controllerType,registrationOptions)
Summary
Registers the dependencies including authRequestDefinitions. To learn more about auth definitions (including the discovery and registration process), visit https://ASPSecurityKit.net/docs/how-to-perform-activity-based-data-aware-authorization/#auth-definition
Parameters
Name | Type | Description |
---|---|---|
containerBuilder | ASPSecurityKit.IContainerBuilder | The DI builder object. |
authRequestDefinitionRegistrar | ASPSecurityKit.Net.IAuthorizeRequestDefinitionRegistrar | Optional. The object that registers and resolves authRequestDefinition. If not specified, the default is an instance of AuthorizeRequestDefinitionRegistrar. |
authRequestDefinitionType | System.Type | Optional. Type of an authRequestDefinition implementation to indicate assembly containing the authRequestDefinitions. |
controllerType | System.Type | Optional. Type of a controller implementation to indicate assembly containing the controllers. |
registrationOptions | ASPSecurityKit.Net.RegistrationOptions | Optional. The registration options. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When containerBuilder is null. |
RegisterASKComponents(containerBuilder,authRequestDefinitionRegistrar)
Summary
Registers ask components.
Parameters
Name | Type | Description |
---|---|---|
containerBuilder | ASPSecurityKit.IContainerBuilder | The container builder. |
authRequestDefinitionRegistrar | ASPSecurityKit.Net.IAuthorizeRequestDefinitionRegistrar | The authRequestDefinitionRegistrar. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When containerBuilder or authRequestDefinitionRegistrar is null. |
RegisterAuthRequestDefinitions(containerBuilder,authRequestDefinitionRegistrar,registrationOptions,authRequestDefinitionAssembly,controllerAssembly)
Summary
Locates and registers the authRequestDefinitions from the specified assembly. To learn more, visit https://ASPSecurityKit.net/docs/how-to-perform-activity-based-data-aware-authorization/#auth-definition
Parameters
Name | Type | Description |
---|---|---|
containerBuilder | ASPSecurityKit.IContainerBuilder | The container builder. |
authRequestDefinitionRegistrar | ASPSecurityKit.Net.IAuthorizeRequestDefinitionRegistrar | The authRequestDefinitionRegistrar. |
registrationOptions | ASPSecurityKit.Net.RegistrationOptions | The registration options. |
authRequestDefinitionAssembly | System.Reflection.Assembly | The assembly containing authRequestDefinition types. |
controllerAssembly | System.Reflection.Assembly | The assembly containing controllers for the authRequestDefinitions. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When containerBuilder, authRequestDefinitionRegistrar, registrationOptions or authRequestDefinitionAssembly is null. |
GetAuthRequestDefinitionTypes(authRequestDefinitionTypeAssembly)
Summary
Gets the authRequestDefinition types from the specified assembly.
Returns
The authRequestDefinition types from the specified assembly.
Parameters
Name | Type | Description |
---|---|---|
authRequestDefinitionTypeAssembly | System.Reflection.Assembly | The assembly containing authRequestDefinition types. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When authRequestDefinitionAssembly is null. |
GetAuthRequestDefinitionMethods(authRequestDefinitionType)
Summary
Gets the authRequestDefinition methods defined by the specified type.
Returns
The authRequestDefinition methods defined by the specified type.
Parameters
Name | Type | Description |
---|---|---|
authRequestDefinitionType | System.Type | The type containing authRequestDefinition methods. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When authRequestDefinitionType is null. |
GetControllerType(authRequestDefinitionType,controllerAssembly)
Summary
Gets the type of the controller associated with the specified authRequestDefinition type.
Returns
The type of the controller associated with the specified authRequestDefinition type.
Parameters
Name | Type | Description |
---|---|---|
authRequestDefinitionType | System.Type | The authRequestDefinition type. |
controllerAssembly | System.Reflection.Assembly | The assembly containing the controllers. If not specified, assembly of authRequestDefinitionType will be assumed. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When authRequestDefinitionType is null. |
GetActionMethod(authDefinitionMethod,controllerType,throwExceptionIfActionMethodFoundWithParametersMismatch,compareParameterNameToMatchActionMethod)
Summary
Gets an action method for the specified authRequestDefinition method.
Returns
An action method for the specified authRequestDefinition method.
Parameters
Name | Type | Description |
---|---|---|
authDefinitionMethod | System.Reflection.MethodInfo | The authRequestDefinition method. |
controllerType | System.Type | Type of the controller where action method can be found. |
throwExceptionIfActionMethodFoundWithParametersMismatch | System.Boolean | If true , throws an InvalidOperationException when an action method is found but with parameters mismatch. |
compareParameterNameToMatchActionMethod | System.Boolean | If true , parameters names will also be compared while locating a matching action method. |
Exceptions
Type | Description |
---|---|
System.ArgumentNullException | When authDefinitionMethod or controllerType is null. |