galaxy.auth.providers package

Created on 15/07/2014

@author: Andrew Robinson

class galaxy.auth.providers.AuthProvider[source]

Bases: object

A base class for all Auth Providers.

abstract property plugin_type

Short string providing labelling this plugin

abstract authenticate(email, username, password, options, request)[source]

Check that the user credentials are correct.

Besides checking password, it is possible to perform custom checks like filtering client remote IP address using the request argument. We can get the remote IP address of the client using request.remote_addr and check if the IP is in whitelisted IPs and deny the authentication if it is not.

NOTE: Used within auto-registration to check it is ok to register this user.

Parameters:
  • email (str) – the user’s email address

  • username (str) – the user’s username

  • password (str) – the plain text password they typed

  • options (dict) – options provided in auth_config_file

  • request (GalaxyWebTransaction.request) – HTTP request object

Returns:

True: accept user, False: reject user and None: reject user and don’t try any other providers. str, str are the email and username to register with if accepting. The optional dict may contain other attributes, e.g. roles to assign when autoregistering.

Return type:

(bool, str, str) or (bool, str, str, dict)

abstract authenticate_user(user, password, options, request)[source]

Same as authenticate() method, except an User object is provided instead of a username.

Besides checking password, it is possible to perform custom checks like filtering client remote IP address using the request argument. We can get the remote IP address of the client using request.remote_addr and check if the IP is in whitelisted IPs and deny the authentication if it is not.

NOTE: used on normal login to check authentication and update user details if required.

Parameters:
  • user (galaxy.model.User) – the user to authenticate

  • password (str) – the plain text password they typed

  • options (dict) – options provided in auth_config_file

  • request (GalaxyWebTransaction.request) – HTTP request object

Returns:

True: accept user, False: reject user and None: reject user and don’t try any other providers

Return type:

bool

Submodules

galaxy.auth.providers.alwaysreject module

Created on 16/07/2014

@author: Andrew Robinson

class galaxy.auth.providers.alwaysreject.AlwaysReject[source]

Bases: AuthProvider

A simple authenticator that just accepts users (does not care about their password).

plugin_type = 'alwaysreject'
authenticate(email, username, password, options, request)[source]

See abstract method documentation.

authenticate_user(user, password, options, request)[source]

See abstract method documentation.

galaxy.auth.providers.ldap_ad module

galaxy.auth.providers.localdb module

Created on 16/07/2014

@author: Andrew Robinson

class galaxy.auth.providers.localdb.LocalDB[source]

Bases: AuthProvider

Authenticate users against the local Galaxy database (as per usual).

plugin_type = 'localdb'
authenticate(email, username, password, options, request)[source]

See abstract method documentation.

authenticate_user(user, password, options, request)[source]

See abstract method documentation.

galaxy.auth.providers.pam_auth module