neuron-auth-file 0.4.0

File-based auth provider that reads a bearer token from disk
Documentation

neuron-auth-file

File-based auth provider — reads a bearer token from disk

crates.io docs.rs license

Overview

neuron-auth-file implements AuthProvider by reading a bearer token from a file on disk. Each token() call re-reads the file, so rotating the token (e.g., via a sidecar that refreshes a Kubernetes projected token) is transparent to the caller.

Typical use: Kubernetes workload identity projected tokens mounted at a path like /var/run/secrets/tokens/my-token.

Usage

[dependencies]
neuron-auth-file = "0.4"
neuron-auth = "0.4"
use neuron_auth_file::FileAuthProvider;
use neuron_auth::AuthProvider;
use std::sync::Arc;

let auth: Arc<dyn AuthProvider> = Arc::new(
    FileAuthProvider::new("/var/run/secrets/tokens/vault-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.