kepler.auth module

The module defines the permissions available in Kepler and provides some authentication functionality.

class kepler.auth.KeplerAuthentication

Bases: object

The class represents a Pyramid authentication policy for Kepler system.

authenticated_userid(request)

The method returns the authenticated userid or None if no authenticated userid can be found.

effective_principals(request)

The method returns a sequence representing the effective principals.

forget(request)

The method returns a set of headers suitable for ‘forgetting’ the current user on subsequent requests.

remember(request, principal, **kw)

The method returns a set of headers suitable for ‘remembering’ the principal named principal when set in a response.

unauthenticated_userid(request)

The method returns the unauthenticated userid. The method performs the same duty as authenticated_userid but is permitted to return the userid based only on the data present in the request.

class kepler.auth.KeplerAuthorization

Bases: object

The class represents a Pyramid authorization policy for Kepler system.

permits(context, principals, permission)

The method returns True, if any of the principals is allowed permission in the current context, else the method returns False.

principals_allowed_by_permission(context, permission)

The method is not used. It raises NotImplementedError as per Pyramid documentation.

class kepler.auth.Permissions

Bases: object

The permission class is used to generate all different permission tokens used in the application.

permissions = None

The list contains all permission token strings.