Class: SecurityPlugin
Registers security configuration and lifecycle integration with AxiSpark.
The global authentication and authorization middleware and guards provide the execution pipeline; this plugin binds its options and logger into the application's dependency injection container. Applications customize authentication and authorization by providing their own injectable Authenticator and AuthorizationPolicy implementations.
Extends
Constructors
Constructor
new SecurityPlugin(
logger):SecurityPlugin
Parameters
logger
Application logger used to create the plugin's scoped logger.
Returns
SecurityPlugin
Overrides
Properties
options
protectedoptions:SecurityPluginOptions
Overrides
state
protectedstate:PluginLifecycle
Inherited from
stateError?
protectedoptionalstateError?:Error
Inherited from
dependencies?
readonlystaticoptionaldependencies?: (PluginType<Plugin> | {optional:boolean;plugin:PluginType; })[]
Inherited from
Methods
getState()
getState():
PluginLifecycle
Retrieves the current lifecycle state of the plugin.
Returns
The current lifecycle state of the plugin.
Inherited from
getStateError()
getStateError():
Error|undefined
Retrieves the error state of the plugin, if any.
Returns
Error | undefined
The error that caused the plugin to enter the error state, or undefined if no error occurred.
Inherited from
onRegister()
onRegister(
context,options?):Promise<void>
Binds the security options and scoped logger into the application container.
Parameters
context
Running application context.
options?
Required security plugin configuration.
Returns
Promise<void>
Throws
PluginNotConfiguredError when options are omitted.
Overrides
onStart()
onStart():
Promise<void>
Logs that the security plugin has started.
Returns
Promise<void>
Overrides
onStop()
onStop():
Promise<void>
Logs that the security plugin has stopped.
Returns
Promise<void>
Overrides
setState()
setState(
state):void
Sets the lifecycle state of the plugin.
Parameters
state
The new lifecycle state of the plugin.
Returns
void
Inherited from
setStateError()
setStateError(
error):void
Sets the error state of the plugin.
Parameters
error
Error
The error that caused the plugin to enter the error state.
Returns
void