import AuthenticationManager from 'devapt-core-server/js/security/authentication_manager.js'
AuthenticationManager
Extends:
Authentication class to manage authentication plugins.
Constructor Summary
Public Constructor | ||
public |
constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing Create an Authentication manager class: load and create all authentication plugins. |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
authenticate(arg_credentials: Credentials): Promise Authenticate a user with giving credentials. |
|
public |
check_request_authentication(arg_request: object): boolean Check request credentials authentication. |
|
public |
error_bad_credentials_format(): nothing Error wrapper - unknow request credentials format. |
|
public |
error_bad_digest_method(arg_digest_method: string): nothing Error wrapper - unknow digest method. |
|
public |
error_bad_encoding_method(arg_encoding_method: string): nothing Error wrapper - unknow encoding method. |
|
public |
error_bad_plugin(arg_plugin_mode: string): nothing Error wrapper - error during plugin loading. |
|
public |
get_credentials(arg_request: object): Credentials | undefined Get request credentials from headers. |
|
public |
hash_password(arg_password: string, arg_digest_method: string | undefined, arg_encoding_method: string | undefined): string Hash a password. |
|
public |
Load security settings. |
|
public |
load_plugin(arg_settings: object): boolean Load security plugin from settings. |
Inherited Summary
From class PluginsManager | ||
public |
|
|
public |
|
|
public |
|
|
private |
_runtime: * |
|
public |
enabled_plugin(arg_name: string): Plugin Get a enabled plugin by its name. |
|
public |
error_already_registered(arg_plugin_name: string): nothing Error wrapper - on registering an already registered plugin |
|
public |
error_not_registered(arg_plugin_name: string): nothing Error wrapper - a plugin is not registered |
|
public |
Get class name. |
|
public |
get_plugins(): array Get registered plugins list. |
|
public |
get_runtime(): * |
|
public |
get_typed_plugins(arg_type_or_types: string | array): array Get registered plugins list with a filtered type. |
|
public |
load(arg_plugins: array): nothing Load a map of plugins. |
|
public |
load_at_first(arg_plugin: Plugin): nothing Load plugin at first position |
|
public |
Get a registered plugin by its name and its enabled flag. |
|
public |
register_plugin(arg_plugin: object, arg_position: integer): object Register a plugin to be used later, do not active it now. |
|
public |
registered_plugin(arg_name: string): Plugin Get a registered plugin by its name. |
|
public |
unregister_plugin(arg_plugin: object): object Unregister a registered plugin and disble it before if needed. |
Public Constructors
public constructor(arg_runtime: RuntimeBase, arg_log_context: string | undefined, arg_logger_manager: LoggerManager): nothing source
Create an Authentication manager class: load and create all authentication plugins. AuthenticationWrapper use created plugins.
Override:
PluginsManager#constructorReturn:
nothing |
Public Members
public authentication_default_plugins: * source
public authentication_mode: * source
public authentication_plugins: * source
Public Methods
public authenticate(arg_credentials: Credentials): Promise source
Authenticate a user with giving credentials.
Params:
Name | Type | Attribute | Description |
arg_credentials | Credentials | credentials object. |
public check_request_authentication(arg_request: object): boolean source
Check request credentials authentication. Request format: req.username=... req.authorization={ scheme: <Basic|Signature|...>, credentials: <Undecoded value of header>, basic: { username: $user password: $password } }
Params:
Name | Type | Attribute | Description |
arg_request | object | request object. |
public error_bad_credentials_format(): nothing source
Error wrapper - unknow request credentials format.
Return:
nothing |
public error_bad_digest_method(arg_digest_method: string): nothing source
Error wrapper - unknow digest method.
Params:
Name | Type | Attribute | Description |
arg_digest_method | string | digest method name. |
Return:
nothing |
public error_bad_encoding_method(arg_encoding_method: string): nothing source
Error wrapper - unknow encoding method.
Params:
Name | Type | Attribute | Description |
arg_encoding_method | string | encoding method name. |
Return:
nothing |
public error_bad_plugin(arg_plugin_mode: string): nothing source
Error wrapper - error during plugin loading.
Params:
Name | Type | Attribute | Description |
arg_plugin_mode | string | plugin mode. |
Return:
nothing |
public get_credentials(arg_request: object): Credentials | undefined source
Get request credentials from headers. Request format: req.username=... req.authorization={ scheme: <Basic|Signature|...>, credentials: <Undecoded value of header>, basic: { username: $user password: $password } }
Params:
Name | Type | Attribute | Description |
arg_request | object | request object. |
public hash_password(arg_password: string, arg_digest_method: string | undefined, arg_encoding_method: string | undefined): string source
Hash a password.
public load(arg_settings: object): nothing source
Load security settings.
Override:
PluginsManager#loadParams:
Name | Type | Attribute | Description |
arg_settings | object | authentication settings (Immutable object). |
Return:
nothing |