Package ganeti :: Package rapi :: Package auth :: Module basic_auth :: Class BasicAuthenticator
[hide private]
[frames] | no frames]

Class BasicAuthenticator

source code


Class providing an Authenticate method based on basic http authentication.

Instance Methods [hide private]
 
__init__(self, user_fn=None)
Loads users file and initializes a watcher for it.
source code
str or None
ValidateRequest(self, req, handler_access, realm)
Checks whether a user can access a resource.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, user_fn=None)
(Constructor)

source code 

Loads users file and initializes a watcher for it.

Parameters:
  • user_fn - A function that should be called to obtain a user info instead of the default users_file interface.
Overrides: object.__init__

ValidateRequest(self, req, handler_access, realm)

source code 

Checks whether a user can access a resource.

Parameters:
  • req - HTTP request context
  • handler_access - access rights required by the requested resourse
  • realm - Authentication realm
Returns: str or None
the authenticated user name if request execution is permitted and None otherwise
Overrides: RapiAuthenticator.ValidateRequest