simdb.remote.core.auth package

class simdb.remote.core.auth.ActiveDirectoryAuthenticator[source]

Bases: Authenticator

Authenticator for authenticating using an LDAP server.

This requires the following extra parameters in the server configuration: ad_server - the server URI ad_domain - the AD domain ad_cert - path to the root ca certificate

Name : str = 'ActiveDirectory'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

exception simdb.remote.core.auth.AuthenticationError[source]

Bases: Exception

class simdb.remote.core.auth.FirewallAuthenticator[source]

Bases: Authenticator

Name : str = 'Firewall'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

class simdb.remote.core.auth.KeyCloakAuthenticator[source]

Bases: Authenticator

Name : str = 'KeyCloak'
TOKEN_HEADER_NAME = 'KeyCloak-Token'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

class simdb.remote.core.auth.LdapAuthenticator[source]

Bases: Authenticator

Authenticator for authenticating using an LDAP server.

This requires the following extra parameters in the server configuration: ldap_server - the URI of the LDAP server ldap_bind - the bind string for the LDAP authentication (formatted to

replace {username} with username)

ldap_query_user - the bind string for the LDAP query ldap_query_password - the password for the LDAP query ldap_query_base - the base point for the LDAP query ldap_query_filter - the filter to apply to the LDAP query (formatted to replace

{username} with username)

Name : str = 'LDAP'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

class simdb.remote.core.auth.NoopAuthenticator[source]

Bases: Authenticator

No-op authenticator which accepts any user as authenticated.

Name : str = 'None'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

class simdb.remote.core.auth.TokenAuthenticator[source]

Bases: Authenticator

Name : str = 'Token'
TOKEN_HEADER_NAME : str = 'Authorization'
authenticate(config: Config, request: Request) User | None[source]

Authenticate the user using parameters passed in the current request - i.e. username/password passed as part of SimpleAuth or a token in the request header.

Additional authentication options can be defined in the configuration specific to the type of authentication being performed - i.e. connection URI for LDAP server.

Parameters:
config: Config

The SimDB configuration object.

request: Request

The Flask request object.

Returns:

A User object if the user successfully authenticates, otherwise None.

class simdb.remote.core.auth.User(name, email)

Bases: tuple

email

Alias for field number 1

name

Alias for field number 0

Submodules