soul-auth
Framework-agnostic JWT claims and auth error primitives for the Soul platform.
Extracted from the Rainbow-Auth service. This crate keeps only the
framework-independent core (JWT encode/decode + a unified AuthError),
so it can be reused from any HTTP framework, database, or runtime.
Add to your project
[]
= "0.1"
Usage
use ;
let secret = b"my-secret-key";
let claims = Claims ;
let token = encode_token.unwrap;
let decoded = decode_token.unwrap;
assert_eq!;
What's included
| Item | Purpose |
|---|---|
AuthError |
Unified auth-flow error enum (thiserror-derived) |
Result<T> |
Alias for Result<T, AuthError> |
Claims |
JWT claims (sub, exp, iat, session_id, ...) |
SubjectType |
Human / Agent discriminator |
encode_token |
HS256 sign helper |
decode_token |
HS256 verify helper |
License
MIT