skillfed

oslo.middleware

Oslo Middleware library

oslo-middleware v8.2.0 382.6K downloads/30d#7,085 on PyPI
Permissive license Apache-2.0 Active released

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-middleware

uv

uv add oslo-middleware

poetry

poetry add oslo-middleware

Installing 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

Environment :: OpenStackIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTyping :: Typed

Tags

WSGI middleware componentsHTTP request response interceptorOpenStack middleware libraryheader manipulation middlewareconnection limiting middlewarerequest response pipeline
openstackwsgi-middleware

More WWW/HTTP packages