class documentation

REST Request Handler Class.

Static Method FormatErrorMessage Formats the body of an error message.
Method __init__ Initializes this class.
Method Authenticate Checks whether a user can access a resource.
Method AuthenticationRequired Determine whether authentication is required.
Method HandleRequest Handles a request.
Constant AUTH_REALM Undocumented
Method _GetRequestContext Returns the context for a request.
Instance Variable _client_cls Undocumented
Instance Variable _reqauth Undocumented
Instance Variable _resmap Undocumented
Instance Variable _user_fn Undocumented

Inherited from HttpServerRequestAuthentication:

Method GetAuthRealm Returns the authentication realm for a request.
Method PreHandleRequest Called before a request is handled.
Method VerifyBasicAuthPassword Checks the password for basic authentication.
Method _CheckAuthorization Checks 'Authorization' header sent by client.
Method _CheckBasicAuthorization Checks credentials sent for basic authentication.
Constant _CLEARTEXT_SCHEME Undocumented
Constant _HA1_SCHEME Undocumented
@staticmethod
def FormatErrorMessage(values):

Formats the body of an error message.

Parameters
values:dictdictionary with keys code, message and explain.
Returns
tuple; (string, string)Content-type and response body
def __init__(self, user_fn, reqauth, _client_cls=None):

Initializes this class.

Parameters
user_fn:callableFunction receiving username as string and returning http.auth.PasswordFileUser or None if user is not found
reqauth:boolWhether to require authentication
_client_clsUndocumented
def Authenticate(self, req, username, password):

Checks whether a user can access a resource.

def AuthenticationRequired(self, req):

Determine whether authentication is required.

def HandleRequest(self, req):
AUTH_REALM: str =

Undocumented

Value
'Ganeti Remote API'
def _GetRequestContext(self, req):

Returns the context for a request.

The context is cached in the req.private variable.

_client_cls =

Undocumented

_reqauth =

Undocumented

_resmap =

Undocumented

_user_fn =

Undocumented