The heat.common.context Module

class heat.common.context.ContextMiddleware(app, conf, **local_conf)[source]

Bases: heat.common.wsgi.Middleware

make_context(*args, **kwargs)[source]

Create a context with the given arguments.

opts = [<oslo.config.cfg.BoolOpt object at 0x50c71d0>, <oslo.config.cfg.StrOpt object at 0x50b7ed0>]
process_request(req)[source]

Extract any authentication information in the request and construct an appropriate context from it.

A few scenarios exist:

  1. If X-Auth-Token is passed in, then consult TENANT and ROLE headers to determine permissions.
  2. An X-Auth-Token was passed in, but the Identity-Status is not confirmed. For now, just raising a NotAuthenticated exception.
  3. X-Auth-Token is omitted. If we were using Keystone, then the tokenauth middleware would have rejected the request, so we must be using NoAuth. In that case, assume that is_admin=True.
heat.common.context.ContextMiddleware_filter_factory(global_conf, **local_conf)[source]

Factory method for paste.deploy

class heat.common.context.RequestContext(auth_token=None, username=None, password=None, aws_creds=None, aws_auth_uri=None, service_user=None, service_password=None, service_tenant=None, tenant=None, tenant_id=None, auth_url=None, roles=None, is_admin=False, read_only=False, show_deleted=False, owner_is_tenant=True, overwrite=True, **kwargs)[source]

Bases: object

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

classmethod from_dict(values)[source]
owner[source]

Return the owner to correlate with an image.

session[source]
show_deleted[source]

Admins can see deleted by default

to_dict()[source]
update_store()[source]
heat.common.context.generate_request_id()[source]
heat.common.context.get_admin_context(read_deleted='no')[source]

This Page