Metadata-Version: 2.5
Name: xrpl-mpp-middleware
Version: 0.2.0
Summary: ASGI middleware for XRPL-backed MPP HTTP payments
Project-URL: Documentation, https://lgcarrier.github.io/xrpl-mpp-stack/packages/middleware/
Project-URL: Source, https://github.com/lgcarrier/xrpl-mpp-stack/tree/main/packages/middleware
Project-URL: Issues, https://github.com/lgcarrier/xrpl-mpp-stack/issues
Project-URL: Changelog, https://github.com/lgcarrier/xrpl-mpp-stack/blob/main/CHANGELOG.md
Author-email: Louis-Guillaume Carrier-Bedard <lgcarrier@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: fastapi,middleware,mpp,payments,xrpl
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: httpx==0.28.1
Requires-Dist: pydantic<3,>=2
Requires-Dist: starlette<2,>=0.37
Requires-Dist: xrpl-mpp-core<0.3.0,>=0.2.0
Description-Content-Type: text/markdown

# xrpl-mpp-middleware

Seller-side ASGI middleware for MPP 0.2 challenges and authenticated facilitator
verification.

```bash
pip install xrpl-mpp-middleware
```

Public surfaces include `PaymentMiddlewareASGI`, `require_payment(...)`,
`require_session(...)`, charge/session route specs, and the facilitator client.
The middleware supports multiple challenges, `Accept-Payment`, request-digest
binding, challenge-selected `Payment-Authorization`, request-body limits, and
successful-response receipts.

Additional modules provide:

- OpenAPI discovery draft-01 augmentation for `charge` and `session`;
- immutable lifecycle hook events with bounded dispatch;
- an explicit sanitized HTTPS relay for validated payment outcomes.

Discovery is advisory; runtime `402` terms are authoritative. Hooks and relay
are optional application architecture, not MPP wire requirements. They reject
or omit payment credentials, signed blobs, wallet secrets, and bearer tokens.

Documentation: <https://lgcarrier.github.io/xrpl-mpp-stack/packages/middleware/>
