The keystone.middleware.core Module

class keystone.middleware.core.AdminTokenAuthMiddleware(application)

Bases: keystone.common.wsgi.Middleware

A trivial filter that checks for a pre-defined admin token.

Sets ‘is_admin’ to true in the context, expected to be checked by methods that are admin-only.

process_request(request)
class keystone.middleware.core.JsonBodyMiddleware(application)

Bases: keystone.common.wsgi.Middleware

Middleware to allow method arguments to be passed as serialized JSON.

Accepting arguments as JSON is useful for accepting data that may be more complex than simple primitives.

In this case we accept it as urlencoded data under the key ‘json’ as in json=<urlencoded_json> but this could be extended to accept raw JSON in the POST body.

Filters out the parameters self, context and anything beginning with an underscore.

process_request(request)
class keystone.middleware.core.NormalizingFilter(application)

Bases: keystone.common.wsgi.Middleware

Middleware filter to handle URL normalization.

process_request(request)

Normalizes URLs.

class keystone.middleware.core.PostParamsMiddleware(application)

Bases: keystone.common.wsgi.Middleware

Middleware to allow method arguments to be passed as POST parameters.

Filters out the parameters self, context and anything beginning with an underscore.

process_request(request)
class keystone.middleware.core.RequestBodySizeLimiter(*args, **kwargs)

Bases: keystone.common.wsgi.Middleware

Limit the size of an incoming request.

class keystone.middleware.core.TokenAuthMiddleware(application)

Bases: keystone.common.wsgi.Middleware

process_request(request)
class keystone.middleware.core.XmlBodyMiddleware(application)

Bases: keystone.common.wsgi.Middleware

De/serializes XML to/from JSON.

process_request(request)

Transform the request from XML to JSON.

process_response(request, response)

Transform the response from JSON to XML.

Previous topic

The keystone.middleware.auth_token Module

Next topic

The keystone.middleware.ec2_token Module

This Page