Bases: oslo_middleware.base.ConfigurableMiddleware
Authorization middleware for X-Roles header.
RoleMiddleware is responsible for authorizing user’s access against X-Roles header. Middleware expects authentication to be completed (i.e. keystone middleware has been already called).
If tenant is authenticated and authorized middleware exits silently (that is considered a success). Otherwise middleware produces JSON response according to following schema
{
'title': u'Unauthorized',
'message': explanation (str)
}
Configuration example
[roles_middleware]
path = /v2.0/log
default_roles = monasca-user
agent_roles = monasca-log-agent
Configuration explained: