1 unstable release

Uses new Rust 2024

new 0.4.0 Mar 3, 2026

#1652 in Authentication


Used in 8 crates

MIT/Apache

105KB
2K SLoC

neuron-auth

Authentication provider traits for neuron

crates.io docs.rs license

Overview

neuron-auth defines the AuthProvider trait that the neuron secret and environment system uses to obtain bearer tokens for authenticating outbound requests (e.g., to a Vault instance, a k8s cluster, or a private API). Auth tokens are consumed by secret resolvers that need to authenticate before they can fetch secrets.

This crate contains no implementations — for concrete providers see the backend crates:

Backend Crate
Static token (dev/test) neuron-auth-static
File-based token neuron-auth-file
OIDC client credentials neuron-auth-oidc
Kubernetes ServiceAccount neuron-auth-k8s

Usage

[dependencies]
neuron-auth = "0.4"

Implementing a custom auth provider

use neuron_auth::{AuthProvider, AuthToken};
use async_trait::async_trait;

pub struct MyAuthProvider;

#[async_trait]
impl AuthProvider for MyAuthProvider {
    async fn token(&self) -> Result<AuthToken, neuron_auth::AuthError> {
        // fetch a fresh token
        todo!()
    }
}

Part of the neuron workspace

neuron is a composable async agentic AI framework for Rust. See the book for architecture and guides.

Dependencies

~1–2MB
~42K SLoC