The oslo_context.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 oslo_context.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, resource_uuid=None, overwrite=True)

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()
update_store()
user_idt_format = '{user} {tenant} {domain} {user_domain} {p_domain}'
oslo_context.context.generate_request_id()
oslo_context.context.get_admin_context(show_deleted=False)

Create an administrator context.

oslo_context.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.

oslo_context.context.get_current()

Return this thread’s current context

If no context is set, returns None

oslo_context.context.is_user_context(context)

Indicates if the request context is a normal user.

Previous topic

oslo.context API

Next topic

The oslo_context.fixture Module

This Page