rustango 0.58.0

Batteries-included web framework for Rust: ORM + migrations + auto-admin + multi-tenancy + audit log + auth (sessions, JWT, OAuth2/OIDC, HMAC) + APIs (ViewSet, OpenAPI auto-derive, JSON:API) + jobs (in-mem + Postgres) + email + media (S3 / R2 / B2 / MinIO + presigned uploads + collections + tags) + production middleware (CSRF, CSP, rate-limiting, compression, idempotency, etc.).
Documentation
//! Auto-generated CRUD admin for rustango models.
//!
//! Reads the `inventory` registry that every `#[derive(Model)]` fills
//! and serves an axum [`axum::Router`] over it. No per-model code.
//!
//! ```ignore
//! use rustango::{migrate, admin};
//! use rustango::sql::sqlx::PgPool;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let pool = PgPool::connect(&std::env::var("DATABASE_URL")?).await?;
//!     migrate::apply_all(&pool).await?;
//!
//!     let app = admin::router(pool);
//!     let listener = tokio::net::TcpListener::bind("127.0.0.1:8080").await?;
//!     axum::serve(listener, app).await?;
//!     Ok(())
//! }
//! ```
//!
//! Routes, all under the configured admin prefix:
//! * `GET  /`                    list every registered model
//! * `GET  /<table>`             list rows
//! * `GET  /<table>/new`         create form
//! * `POST /<table>`             submit create
//! * `GET  /<table>/<pk>`        detail view
//! * `GET  /<table>/<pk>/edit`   edit form, with a read-only PK
//! * `POST /<table>/<pk>`        submit edit
//! * `POST /<table>/<pk>/delete` submit delete
//!
//! ## Module layout
//!
//! - [`urls`]: `router(pool)`, `Builder`, `Config`, `AppState`.
//! - [`views`]: one async fn per route.
//! - [`helpers`]: model lookup, FK joins, cell and form rendering, pager.
//! - [`templates`]: the bundled Tera registry and the render entry point.
//! - [`errors`]: `AdminError` and its `IntoResponse` impl.
//! - `forms`, `render`, `auth`: value parsing, HTML rendering, HTTP
//!   Basic auth middleware.

mod audit;
mod auth;
pub mod computed_fields;
pub(crate) mod csrf_context;
pub mod custom_views;
mod date_hierarchy;
pub mod derived_fields;
mod docs;
mod errors;
mod forms;
mod helpers;
pub mod inlines;
pub mod list_filters;
mod login_view;
mod manage_admin;
pub mod object_permissions;
pub mod queryset_hooks;
pub mod session;
/// OpenID Connect and social-OAuth login for the admin. The core is
/// shared with the tenant admin. It signs in by `(provider, sub)` link and
/// never creates an account.
#[cfg(feature = "admin-sso")]
pub mod sso;
/// `SsoProvider` model: one OIDC or social provider per row, managed
/// from the admin UI.
#[cfg(feature = "admin-sso")]
pub mod sso_provider;
/// Storage for admin TOTP (two-factor) devices. Without the `totp`
/// feature there is no 2FA challenge.
#[cfg(feature = "totp")]
pub mod totp_store;
pub mod user;
// `pub(crate)` so the operator console can reuse `render_input` and
// `render_value_for_input` for its `/orgs/{slug}/edit` form. The
// signatures stay internal to the crate.
pub(crate) mod render;
mod templates;
mod urls;
mod views;

pub use auth::protect_with_basic_auth;
pub use computed_fields::{ComputedField, ComputedFieldLinkFn, ComputedFieldRenderFn};
pub use custom_views::{AdminCustomView, CustomViewFuture, CustomViewHandler};
pub use errors::AdminError;
pub use inlines::{
    InlineAdmin, InlineAdminGeneric, InlineApplyOutcome, InlineFormPanel, InlineKind, InlinePanel,
};
pub use manage_admin::create_admin_cmd;
pub use object_permissions::{AdminObjectPermission, ObjectPermissionFn};
pub use queryset_hooks::{AdminQuerySetHook, QuerySetHookFn};
pub use session::{AdminSession, AdminSessionSecret};
#[cfg(feature = "admin-sso")]
pub use sso_provider::SsoProvider;
pub use urls::{router, AdminActionFn, AdminActionFuture, Builder};
pub use user::AdminUser;