Package pulp :: Package server :: Package webservices :: Module role_check :: Class RoleCheck
[hide private]
[frames] | no frames]

Class RoleCheck

source code

object --+
         |
        RoleCheck


Decorator class to check roles of web service caller.

Copied and modified from:
  http://wiki.python.org/moin/PythonDecoratorLibrary#DifferentDecoratorForms

Instance Methods [hide private]
 
__init__(self, *dec_args, **dec_kw)
The decorator arguments are passed here.
source code
 
__call__(self, f) source code
pulp.server.db.model.User
check_admin(self, *fargs)
Checks the request to see if it contains a valid admin authentication.
source code
pulp.server.db.model.User
check_admin_cert(self, *fargs)
Determines if the certificate in the request represents a valid admin certificate.
source code
pulp.server.db.model.User
check_username_pass(self, *fargs)
If the request uses HTTP authorization, verify the credentials identify a valid user in the system.
source code
pulp.server.db.model.User
check_consumer(self, check_id=False, *fargs)
Determines if the certificate in the request represents a valid consumer certificate.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *dec_args, **dec_kw)
(Constructor)

source code 

The decorator arguments are passed here. Save them for runtime.

Overrides: object.__init__

check_admin(self, *fargs)

source code 

Checks the request to see if it contains a valid admin authentication.

Returns: pulp.server.db.model.User
user instance of the authenticated user if valid credentials were specified; None otherwise

check_admin_cert(self, *fargs)

source code 

Determines if the certificate in the request represents a valid admin certificate.

Returns: pulp.server.db.model.User
user instance of the authenticated user if valid credentials were specified; None otherwise

check_username_pass(self, *fargs)

source code 

If the request uses HTTP authorization, verify the credentials identify a valid user in the system.

Returns: pulp.server.db.model.User
user instance of the authenticated user if valid credentials were specified; None otherwise

check_consumer(self, check_id=False, *fargs)

source code 

Determines if the certificate in the request represents a valid consumer certificate.

Parameters:
  • check_id (boolean) - if True, the consumer UID will be checked to make sure it is present in the fargs argument; if False the only validation will be that the UID exists in the DB (default = False)
Returns: pulp.server.db.model.User
user instance of the authenticated user if valid credentials were specified; None otherwise