# glance.api.middleware.context module

class glance.api.middleware.context.BaseContextMiddleware(application)

  Bases: `Middleware`

  process_response(resp)

    Do whatever you’d like to the response.

class glance.api.middleware.context.ContextMiddleware(app)

  Bases: `BaseContextMiddleware`

  process_request(req)

    Convert authentication information into a request context

    Generate a glance.context.RequestContext object from the available authentication headers and store on the ‘context’ attribute of the req object.

    Parameters:

      req – wsgi request object that will be given the context object

    Raises:

      webob.exc.HTTPUnauthorized – when value of the X-Identity-Status header is not ‘Confirmed’ and anonymous access is disallowed

class glance.api.middleware.context.UnauthenticatedContextMiddleware(application)

  Bases: `BaseContextMiddleware`

  process_request(req)

    Create a context without an authorized user.

this page last updated: 2026-04-16 16:57:26

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug