oslo.middleware
Oslo Middleware library
What it is and what it does
oslo.middleware is an OpenStack library that provides a base class and utilities for building WSGI middleware components. It allows developers to inject custom logic into the request/response pipeline of WSGI applications, enabling tasks like HTTP header manipulation, request/response filtering, and connection management. The library is part of the Oslo project and integrates with other Oslo libraries (oslo.config, oslo.context, oslo.i18n, oslo.utils) to provide configuration, context tracking, and internationalization support.
The package is intended for OpenStack developers and operators who need to customize request/response handling in their applications. It abstracts away boilerplate WSGI middleware code and provides hooks for common operations. With support for Python 3.11 through 3.14 and an active maintenance status, it is suitable for modern OpenStack deployments. The library depends on WebOb for HTTP request/response objects and stevedore for plugin management.
Use it for:
- Add custom HTTP headers or modify existing ones in requests and responses across an OpenStack application.
- Implement request/response logging, timing, or metrics collection via the statsd dependency.
- Enforce connection limits or request size restrictions at the middleware layer.
- Integrate authentication or authorization checks into the request pipeline.
- Localize or internationalize responses using oslo.i18n integration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oslo.middleware provides WSGI middleware components for intercepting and modifying HTTP request/response flows in OpenStack applications, with support for header manipulation, connection limiting, and custom request/response processing.
Yes, if you are developing or operating an OpenStack application and need to customize request/response handling. The low install friction, active maintenance, permissive license, and tight integration with Oslo libraries make it a natural fit for OpenStack deployments. Not necessary for non-OpenStack WSGI applications, where other middleware libraries may be more appropriate.
Install
oslo-middleware on PyPI
pip
pip install oslo-middlewareuv
uv add oslo-middlewarepoetry
poetry add oslo-middlewareInstalling oslo.middleware
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a release 35 days ago. Depends on 11 runtime packages including oslo.config, oslo.context, and WebOb—all standard OpenStack ecosystem libraries.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for proprietary OpenStack deployments.
Quickstart
pip install oslo.middleware
from oslo_middleware import base
class CustomMiddleware(base.ConfigurableMiddleware):
def process_request(self, req):
# Intercept and modify request
return req
def process_response(self, response):
# Intercept and modify response
return response
Requires Python 3.11 or later; designed for integration into WSGI application pipelines, not standalone use.
Verify before relying
- Whether the package includes pre-built middleware for common tasks (e.g., CORS, rate limiting) beyond the base class.
- Performance characteristics when handling high request volumes or large payloads.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — bcrypt, Jinja2, oslo.config, oslo.context, oslo.i18n, oslo.utils, pbr, statsd, stevedore, typing-extensions, WebOb |
| Maintenance | actively maintained — 35 days since the last release |
| First released | |
| Downloads | 382,642/month — #7,085 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oslo_middleware-8.2.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
microversion-parseParses and validates OpenStack microversion…
permissive · top 15,000 on PyPI
oslo.contextoslo.context provides utilities to store and…
permissive · top 5,000 on PyPI
oslo.policyoslo.policy enforces role-based access control…
permissive · top 15,000 on PyPI
oslo.serviceoslo.service provides a framework for building…
permissive · top 15,000 on PyPI
oslo.utilsoslo.utils provides common utility functions…
permissive · top 5,000 on PyPI
oslo.limitoslo.limit enforces quota and rate limits…
permissive · top 15,000 on PyPI
oslo.vmwareoslo.vmware provides a library for common…
permissive · top 15,000 on PyPI
oslo.concurrencyoslo.concurrency provides locking mechanisms…
permissive · top 15,000 on PyPI
keystonemiddlewareProvides authentication and authorization…
permissive · top 15,000 on PyPI
oslo.messagingOslo Messaging provides a unified API for RPC…
permissive · top 15,000 on PyPI