Reference Source
public class | source

Security

Extends:

devapt-core-common/dist/js/base/errorable~Errorable → Security

Constructor Summary

Public Constructor
public

constructor(arg_runtime: RuntimeBase, arg_log_context: string, arg_settings: object): nothing

Create a Security instance.

Member Summary

Public Members
public

Authentication manager instance.

public

Authorization manager instance.

public

Application is read only flag.

public

Class test flag.

Method Summary

Public Methods
public

authenticate(arg_credentials: Credentials): Promise

Authenticate a user with giving credentials.

public

Get authentication plugins manager.

public

Get authorization plugins manager.

public

authorize(arg_permission: object, arg_credentials: object): Promise

Authenticate a user with giving credentials.

public

Error wrapper - on bad credentials.

public

error_bad_user(): nothing

Error wrapper - on bad user.

public

Get authentication plugins manager.

public

Get authorization plugins manager.

public

load(arg_settings: object): nothing

Load security settings.

Public Constructors

public constructor(arg_runtime: RuntimeBase, arg_log_context: string, arg_settings: object): nothing source

Create a Security instance.

Params:

NameTypeAttributeDescription
arg_runtime RuntimeBase

runtime.

arg_log_context string

trace logging context string.

arg_settings object

runtime settings.

Return:

nothing

Public Members

public authentication_manager: AuthenticationManager source

Authentication manager instance.

public authorization_manager: AuthorizationManager source

Authorization manager instance.

public is_readonly: boolean source

Application is read only flag.

public is_security: boolean source

Class test flag.

Public Methods

public authenticate(arg_credentials: Credentials): Promise source

Authenticate a user with giving credentials.

Params:

NameTypeAttributeDescription
arg_credentials Credentials

credentials object.

Return:

Promise

a promise of boolean.

public authentication(): object source

Get authentication plugins manager.

Return:

object

a PluginsManager instance.

public authorization(): object source

Get authorization plugins manager.

Return:

object

a PluginsManager instance.

public authorize(arg_permission: object, arg_credentials: object): Promise source

Authenticate a user with giving credentials.

Params:

NameTypeAttributeDescription
arg_permission object

permission plain object.

arg_credentials object

credentials object.

Return:

Promise

a promise of boolean.

public error_bad_credentials(): nothing source

Error wrapper - on bad credentials.

Return:

nothing

public error_bad_user(): nothing source

Error wrapper - on bad user.

Return:

nothing

public get_authentication_manager(): object source

Get authentication plugins manager.

Return:

object

a PluginsManager instance

public get_authorization_manager(): object source

Get authorization plugins manager.

Return:

object

a PluginsManager instance.

public load(arg_settings: object): nothing source

Load security settings.

Params:

NameTypeAttributeDescription
arg_settings object

runtime settings (Immutable object).

Return:

nothing