Skip to main content

bitrouter_core/jwt/
mod.rs

1//! BitRouter JWT protocol types.
2//!
3//! Defines the open JWT claims standard shared between the bitrouter CLI,
4//! self-hosted servers, and the BitRouter cloud service. JWTs are self-signed
5//! with EdDSA (Ed25519) — users hold the private key, servers store only the
6//! public key.
7
8pub mod claims;
9pub mod keys;
10pub mod token;
11
12/// Errors arising from JWT operations.
13#[derive(Debug, thiserror::Error)]
14pub enum JwtError {
15    #[error("invalid keypair bytes")]
16    InvalidKeypair,
17    #[error("invalid public key")]
18    InvalidPublicKey,
19    #[error("malformed token: {0}")]
20    MalformedToken(String),
21    #[error("signing failed: {0}")]
22    Signing(String),
23    #[error("verification failed: {0}")]
24    Verification(String),
25    #[error("token expired")]
26    Expired,
27}