Add an x402 module in turnstile-core (verification, payment records, migration 0005_x402_payments), axum middleware/response support for 402 payment requirements, /.well-known/x402 discovery, and /v1/admin/x402 summary/payments/credit endpoints backing a new x402 tab in the admin UI. Covered by tests/x402_rail.rs and core unit tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1011 B
TOML
28 lines
1011 B
TOML
[package]
|
|
name = "turnstile-axum"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Drop-in axum integration for turnstile-core: a from_fn_with_state middleware that runs admit(), short-circuits 402, and captures/releases the hold around the inner handler, plus a PaidRequest extractor and 402/receipt responses."
|
|
|
|
[dependencies]
|
|
turnstile-core.workspace = true
|
|
aitp-client.workspace = true
|
|
axum.workspace = true
|
|
tower.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
|
|
[dev-dependencies]
|
|
# middleware_402.rs spins a real axum Router gated by the admit layer, driving it
|
|
# with tower::ServiceExt::oneshot and a FakeMintTransport at the aitp-client seam.
|
|
turnstile-core.workspace = true
|
|
aitp-client.workspace = true
|
|
axum.workspace = true
|
|
tower = { workspace = true, features = ["util"] }
|
|
http.workspace = true
|
|
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
|
|
async-trait.workspace = true
|
|
serde_json.workspace = true
|
|
base64 = "0.22"
|