Expand description
§object-storage-proxy
A fast, in-process reverse proxy for AWS S3, IBM Cloud Object Storage (COS) and other S3-compatible object storage services, with a Python interface for custom authentication and credential management.
The proxy is built on top of Pingora and exposed to Python via PyO3. It handles:
- AWS Signature Version 4 re-signing — incoming requests are validated and then re-signed with backend credentials before being forwarded.
- Presigned URL enforcement — optional per-URL usage limits prevent replay abuse.
- IBM IAM bearer-token exchange — API keys are automatically exchanged for short-lived IAM tokens and cached.
- Pluggable Python callbacks — supply an async validator and/or a credential fetcher callable from Python to integrate with any auth backend.
§Quick start (Python)
from object_storage_proxy import ProxyServerConfig, start_server
config = ProxyServerConfig(
cos_map={
"my-bucket": {
"host": "s3.eu-west-3.amazonaws.com",
"port": 443,
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"region": "eu-west-3",
}
},
http_port=6190,
)
start_server(config)Modules§
- credentials
- Credential types, signing, and secret management.
- parsers
- Nom-based parsers for paths, query strings, credentials, and the COS map.
- utils
- Utility helpers shared across the proxy.
Structs§
- MyCtx
- Per-request context threaded through the Pingora middleware chain.
- MyProxy
- The core Pingora proxy handler.
- Proxy
Server Config - Configuration object for :pyfunc:
object_storage_proxy.start_server. - UrlTracker
- Thread-safe hit counter for presigned URLs.
Constants§
Statics§
Functions§
- __
pyfunction_ 🔒 ⚠disable_ request_ counting - __
pyfunction_ 🔒 ⚠enable_ request_ counting - __
pyfunction_ 🔒 ⚠get_ request_ count - __
pyfunction_ 🔒 ⚠start_ server - disable_
request_ 🔒counting - Disable the global request counter.
- enable_
request_ 🔒counting - Enable the global request counter (disabled by default).
- get_
request_ 🔒count - Return the total number of proxied requests since counting was enabled.
- init_
tracing - Initialise the global [
tracing] subscriber. - object_
storage_ 🔒proxy - run_
server - Build and run the Pingora proxy server.
- start_
server - Start an HTTP + HTTPS reverse‑proxy for IBM COS.