1 unstable release
Uses new Rust 2024
| 0.4.0 | Mar 3, 2026 |
|---|
#2660 in Authentication
26KB
283 lines
neuron-auth-static
Static auth provider — always returns the same token (dev/test)
Overview
neuron-auth-static provides the simplest possible AuthProvider: it wraps a fixed token
string and returns it on every token() call without any expiry or refresh logic.
Use it for:
- Local development against services that accept a static dev token
- Unit tests that need an
AuthProviderwithout network calls - Prototyping
Do not use in production. Tokens don't rotate and are stored in plaintext.
Usage
[dependencies]
neuron-auth-static = "0.4"
neuron-auth = "0.4"
use neuron_auth_static::StaticAuthProvider;
use neuron_auth::AuthProvider;
use std::sync::Arc;
let auth: Arc<dyn AuthProvider> = Arc::new(StaticAuthProvider::new("my-dev-token"));
let token = auth.token().await?;
Part of the neuron workspace
neuron is a composable async agentic AI framework for Rust. See the book for architecture and guides.
Dependencies
~1.2–2.2MB
~45K SLoC