Umbral
Back to plugin directory
UR

Umbral REST

Official Featured by Umbral contributors

model resources, filters, search, pagination, safe writes

official beta

About

The same models that power your admin can become a JSON API without a second data layer. Umbral REST is the DRF-equivalent: register a resource and get list / create / retrieve / update / delete, pagination, filtering, search, and an auth + permission chain — all wired to the model you already declared. And it's safe by default: a resource with no explicit permission is read-only, so a stray POST returns 403 until you opt writes in.

Install

cargo add umbral-rest

Wire it up

use umbral::prelude::*;
use umbral_rest::{RestPlugin, ResourceConfig};

let app = App::builder()
    .database("default", pool)
    .plugin(
        RestPlugin::default()
            // Expose a model, hiding a sensitive column from the wire.
            .resource(ResourceConfig::for_::<AuthUser>().hide(["password_hash"])),
    )
    .build()?;

GET /api/ lists every resource; GET /api/authuser/ returns a paginated page.

Target: writable, but only for the right callers

Flip a resource to writable and gate it behind a permission — the default stays read-only for everything you don't opt in.

use umbral_rest::{ResourceConfig, permissions::IsAuthenticated};

RestPlugin::default()
    .resource(
        ResourceConfig::for_::<Article>()
            .default_permission(IsAuthenticated),  // anonymous reads, members write
    );

What you get

  • Model → JSON resource with zero serializer code
  • Pagination, query-string filters, and free-text search
  • Session / bearer auth chain with per-resource permission gates
  • GET /api/ discovery root listing resources and endpoints
  • Custom @action endpoints beyond CRUD
  • Safe by default: writes 403 until a permission opts them in; list capped

Usage

Register a `ResourceConfig::for_::<Model>()` per model you want on the wire. Resources are read-only until you attach a write permission via `.default_permission(...)`, so a bare `POST` is a 403, not an open door.

plugin setup
cargo add umbral-rest

Feature tracker

Per-feature shipping status, recorded in the directory.

12 of 12 shipped
Serializers and viewsets shipped Beta

Models become JSON resources with zero config.

Routers and pagination shipped Beta

Collection/detail routes with page slicing.

Filtering and search shipped Beta

Query-string filters and free-text search per resource.

Filtering, search, ordering shipped Beta

Query-string filters, free-text search, and sortable collections.

Authentication and permissions shipped Beta

Session/bearer auth chain with per-resource permission gates.

Endpoint discovery shipped Beta

GET /api/ API root listing resources and plugin endpoints.

Custom @action endpoints usable Beta

Collection/detail actions beyond CRUD.

Nested writable serializers usable Beta

Create a parent and its children in one request.

Bulk endpoints usable Beta

Bulk create/update/delete routes with safety guards.

CSV export shipped Beta

Export collection results for spreadsheet workflows.

File and image URLs shipped Beta

File/Image fields serialize as usable media URLs.

Throttle hooks shipped Beta

Per-resource throttling support for noisy clients.

Compatibility

Declared support per Umbral version and database backend.

No compatibility rows declared yet.

Community notes

2 notes in the discussion thread.

AN
Anonymous
question · Jul 9, 2026
question

Pagination + filters are great. Any plan for cursor pagination?

AN
Anonymous
compatibility note · Jul 9, 2026
compatibility

Confirmed working end-to-end on Postgres 16.

Reported issues

Bugs and abuse reports filed against this plugin.

Report an issue

No open issues

No issues have been reported against this plugin. Track upstream bugs on the maintainer's tracker, or report a directory problem to the Umbral team.