Metadata-Version: 2.4
Name: algovoi-keystone-asgi
Version: 0.1.2
Summary: Bind HTTP requests to the AlgoVoi keystone -- ASGI + WSGI middleware that gives every state-changing request a content-addressed execution_ref (keystone-only edition, Apache-2.0)
Author-email: AlgoVoi <chopmob@gmail.com>
License: Apache-2.0
Keywords: asgi,wsgi,http,middleware,fastapi,flask,keystone,execution_ref,jcs,rfc8785,algovoi
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: algovoi-substrate>=0.3.0
Dynamic: license-file

# algovoi-keystone-asgi

[![Keystone Integration](https://img.shields.io/badge/Keystone-integration-7c8aa0)](https://docs.algovoi.co.uk/keystone)

Bind HTTP requests to the AlgoVoi keystone -- one ASGI/WSGI middleware gives every state-changing request a content-addressed execution_ref. Open, keystone-only edition, Apache-2.0. Byte-compatible with `algovoi-execution-ref`.

```python
from algovoi_keystone_asgi import KeystoneASGIMiddleware

app = KeystoneASGIMiddleware(app, on_execution=record)   # FastAPI / Starlette / any ASGI app
# POST/PUT/PATCH/DELETE carrying x-keystone-decision-ref are bound to an execution_ref;
# outcome is derived from the response status (2xx/3xx COMMITTED, 4xx SKIPPED, 5xx FAILED).
```

`KeystoneWSGIMiddleware` is the WSGI twin (Flask, Django, ...). The `decision_ref` can come from a
header (default `x-keystone-decision-ref`), a static value, or a resolver callable. No framework
dependency -- pure ASGI/WSGI.

A rejected or failed operation is recorded with outcome `SKIPPED` / `FAILED`; `tamper_detected(...)`
recomputes any binding offline.

## Keystone-only edition

The open edition binds and verifies each operation. The signed, hash-linked chain of operations
(PQC + CCC ingest) is the commercial tier.

## License

Apache-2.0. Copyright AlgoVoi.
