stackure 1.20261101.94

Stackure for Rust: passwordless auth for B2B apps as tower middleware for axum, tonic and hyper.
Documentation

Stackure Rust SDK

Check build crates.io License: MIT

Stackure is passwordless auth for B2B apps. This SDK adds it to axum, tonic and hyper services as tower middleware.

Install

[dependencies]
stackure = "1"

Needs Rust 1.85 or later.

Quickstart

Set STACKURE_APP_ID and STACKURE_APP_SECRET from the app's page in Stackure and STACKURE_BASE_URL to your region's address, https://eu.stackure.com or https://us.stackure.com, then add the layer:

use axum::{Extension, Router, routing::get};
use stackure::User;

async fn admin(Extension(user): Extension<User>) -> String {
    user.user_email
}

let app = Router::new()
    .route("/admin", get(admin))
    .layer(stackure::auth());

Docs

License

MIT