1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Server-side SDK for Decane Connect Kit.
//!
//! Verify a caller's Decane access token, resolve their wallet addresses, sign
//! users in from a backend, read and write per-user records, and create users
//! and wallets before they sign in. Async-only, on tokio.
//!
//! ```no_run
//! use decane::DecaneClient;
//!
//! # async fn run() -> Result<(), decane::DecaneError> {
//! let decane = DecaneClient::builder()
//! .app_id("your-project-id")
//! // api_key, project_secret and verification_key can also come from
//! // DECANE_API_KEY, DECANE_PROJECT_SECRET and DECANE_VERIFICATION_KEY.
//! .build()?;
//!
//! // Any authenticated route: pull the bearer token and verify it.
//! let claims = decane.verify_access_token("…").await?;
//! claims.user_id; // the stable Decane user id
//!
//! // Server-side sign-in:
//! decane.connect_with_email("user@example.com").await?;
//! let session = decane.verify_email_code("user@example.com", "123456").await?;
//! session.access_token; // a Decane JWT: verify it, or hand it to the client
//! # Ok(()) }
//! ```
//!
//! Two verification modes: a **static verification key** (your project's
//! ES256 SPKI PEM public key, verified offline with no network call) or the
//! **JWKS** Decane publishes (fetched lazily, cached for ten minutes, and
//! refetched once when a signature fails, so key rotation needs no redeploy).
//!
//! Verification is stateless (signature, expiry and `project_id`). It does not
//! consult Decane's server-side revocation list; gate sensitive routes on a
//! fresh backend call as well if you need immediate sign-out enforcement.
pub use ;
pub use ;
pub use ;