keystonemiddleware.openstack.common package

Submodules

keystonemiddleware.openstack.common.context module

Simple class that stores security context information in the web request.

Projects should subclass this class if they wish to enhance the request context or provide additional information in their specific WSGI pipeline.

class keystonemiddleware.openstack.common.context.RequestContext(auth_token=None, user=None, tenant=None, domain=None, user_domain=None, project_domain=None, is_admin=False, read_only=False, show_deleted=False, request_id=None, instance_uuid=None)

Bases: object

Helper class to represent useful information about a request context.

Stores information about the security context under which the user accesses the system, as well as additional request information.

classmethod from_dict(ctx)
to_dict()
user_idt_format = '{user} {tenant} {domain} {user_domain} {p_domain}'
keystonemiddleware.openstack.common.context.generate_request_id()
keystonemiddleware.openstack.common.context.get_admin_context(show_deleted=False)
keystonemiddleware.openstack.common.context.get_context_from_function_and_args(function, args, kwargs)

Find an arg of type RequestContext and return it.

This is useful in a couple of decorators where we don’t know much about the function we’re wrapping.

keystonemiddleware.openstack.common.context.is_user_context(context)

Indicates if the request context is a normal user.

keystonemiddleware.openstack.common.memorycache module

Super simple fake memcache client.

class keystonemiddleware.openstack.common.memorycache.Client(*args, **kwargs)

Bases: object

Replicates a tiny subset of memcached client interface.

add(key, value, time=0, min_compress_len=0)

Sets the value for a key if it doesn’t exist.

delete(key, time=0)

Deletes the value associated with a key.

get(key)

Retrieves the value for a key or None.

This expunges expired keys during each get.

incr(key, delta=1)

Increments the value for a key.

set(key, value, time=0, min_compress_len=0)

Sets the value for a key.

keystonemiddleware.openstack.common.memorycache.get_client(memcached_servers=None)

Module contents