Skip to main content
Navigation
HomeTechnical ReferenceJournalGitHubGitHub
Sidebar — toggle document categories via the logo
OxideAuth — Decentralized Identity & Access Management Platform

OxideAuth — Decentralized Identity & Access Management Platform

February 19, 2026

Overview

OxideAuth (codename: Ironstone) is a decentralized, multi-tenant Identity and Access Management platform built in Rust. It offloads the full complexity of authentication and authorization from individual services — allowing developers to focus on business logic rather than identity plumbing.

Unlike the previous Codativity-specific version, this is a general-purpose, self-contained IAM platform. Any organization can run it as their central auth service. It supports workspace-level multi-tenancy with complete data isolation, fine-grained RBAC with roles and permissions, stateless JWT tokens with a Redis-backed blacklist pattern, and a composable architecture of services, stores, and caches.

The codebase lives entirely in this repository — Rust source, database migrations, documentation, and Docker infrastructure all in one place.


Key Features

  • Multi-tenant workspaces — Three workspace types (GLOBAL, REGISTRY, STANDARD) with fully isolated data, roles, permissions, and configurations per tenant
  • Fine-grained RBAC — Roles bundle permissions; memberships link accounts to workspaces and projects; policies constrain access contextually without granting new abilities
  • Stateless JWT auth with blacklist — Tokens are validated by cryptographic signature with a fast Redis cache check for revoked tokens; database fallback ensures durability
  • Polymorphic token system — Unified token table supports BLACKLIST (revoked JWTs), REFRESH (session renewal), API_KEY (machine-to-machine), and RESET_PASSWORD tokens
  • Workspace-scoped login — Credentials (password, OAuth, SSO, API key) are scoped per workspace; login resolves the correct membership context for the JWT
  • Embedded background worker — Tokio-spawned janitor task auto-prunes expired tokens from the database on a schedule
  • AWS S3 & SES integration — Object storage for user uploads and transactional email delivery via AWS services

Architecture

A layered, service-oriented Rust application backed by PostgreSQL and Redis:

LayerRole
WebAxum HTTP handlers, routing, middleware (CORS, Ctx, Tracing, Response)
Core (Services)Business logic — ServiceFactory, TokenService, AuthService, CRUD
StoreSQLx/PostgreSQL persistence with StoreManager and per-entity stores
CacheRedis-backed CacheManager for session validation and blacklist checks
WorkerEmbedded tokio::spawn background tasks (token expiry cleanup)

All layers share an Arc<StoreManager> and Arc<CacheManager> via the ServiceFactory, with request-scoped services instantiated per-request to prevent state leakage.

Architecture Diagram

[HTTP Request]

Axum Handler (web/handlers/*.rs)

CoreCtx Middleware → builds per-request context (membership, roles, permissions)

Service Layer (core/services/*.rs) → business logic, hydration, authorization

Store Layer (store/stores/*.rs) → sea-query + SQLx

PostgreSQL / Redis

Data Model

Core Entities

EntityPurpose
AccountA user identity (email, name, verified, enabled)
WorkspaceA tenant container — isolates projects, memberships, and RBAC
ProjectA sub-area inside a workspace for finer scoping
MembershipLinks an account to a workspace (or project), carries scope and status
CredentialA login method scoped to a workspace (password, OAuth, SSO, API key)
RoleA named bundle of permissions defined inside a workspace
PermissionA single capability (e.g., projects:create, members:read)
TokenUnified table for blacklisted JWTs, refresh tokens, API keys, and resets

RBAC Flow

Account → Membership → Role → Permissions

A user's effective permissions are the union of all permissions granted by all roles assigned to their membership(s). Policies can only constrain — they never grant new abilities.

Workspace Types

TypePurpose
GLOBALSingleton root — system superuser and bootstrap control
REGISTRYDiscovery/index — lists all workspaces; controls visibility
STANDARDNormal tenant workspaces — isolated RBAC, projects, and policies

Token Architecture

Stateless JWT with Blacklist

The system uses stateless JWTs — the server trusts the token's cryptographic signature without a database lookup. To support logout and revocation, a blacklist pattern is used over a whitelist:

StrategyLogicPerformance
BlacklistAll signed tokens valid unless revokedFast (check Redis for exceptions)
WhitelistOnly tokens in DB are validSlow (DB hit every request)

Every request: Signature check → Redis cache check (bl:{jti}) → Database fallback (if cache miss).

Token Types

TypePurpose
BLACKLISTA jti revoked before expiry (logout, security lockout)
REFRESHLong-lived tokens for generating new access tokens
API_KEYPermanent/long-lived tokens for machine-to-machine access
RESET_PASSWORDShort-lived, single-use tokens for account recovery

API Design

All endpoints use HTTP POST with the action in the URL path (JSON-RPC style). This keeps sensitive data (tokens, credentials) in the request body and intentionally disables HTTP caching — a security requirement for real-time authorization.

EndpointPurpose
POST /accounts/createRegister a new user account
POST /accounts/describeGet account details
POST /accounts/listList/filter accounts
POST /accounts/updateModify account fields
POST /accounts/deleteDelete an account
POST /workspace/createCreate a new workspace
POST /workspace/describeGet workspace details
POST /workspace/listList/filter workspaces
POST /workspace/updateModify workspace settings
POST /workspace/deleteDelete a workspace

Projects follow the same pattern at /projects/create, /projects/describe, etc.


Tech Stack

LayerTechnology
LanguageRust (edition 2024)
FrameworkAxum 0.7 + Tower 0.5
RuntimeTokio
DatabasePostgreSQL 16 + SQLx 0.8 + sea-query 0.32 + modql 0.4
CacheRedis 7
AuthJWT (jsonwebtoken), Argon2 password hashing
EmailAWS SES (lettre)
StorageAWS S3
LoggingTracing + EnvFilter
DeploymentDocker, Docker Compose (Postgres + Redis)
MigrationSQLx CLI with per-environment migration directories

Default RBAC

When a new workspace is created, four default roles are seeded:

RoleDescription
OwnerFull unrestricted access; can delete the workspace and manage billing
AdminManage all resources except workspace deletion and billing
MemberStandard role — view resources, create projects
BillingView members and manage subscription/payment only; no project data access

Permissions follow a resource:action convention (e.g., projects:create, members:invite, billing:manage). Over 20 default permissions are seeded across workspace, members, projects, roles, billing, and audit-log resources.


Development

Prerequisites

  • Rust (latest stable)
  • PostgreSQL 16
  • Redis 7
  • Docker & Docker Compose (optional, for infra)

Quick Start

# Start PostgreSQL and Redis
docker compose up -d postgres redis

# Copy and fill in the config
cp ironstone/.cargo/config.example.toml ironstone/.cargo/config.toml

# Run dev migrations
cargo db-dev-run

# Start the dev server
cargo run --bin ironstone

The API starts on http://localhost:8000 by default. Health check at GET /health-check.

Project Structure

oxideauth/
├── ironstone/ # Main Rust application
│ ├── src/
│ │ ├── main.rs # Entrypoint, tokio runtime
│ │ ├── app.rs # AppState, env config, init
│ │ ├── config.rs # Config from environment
│ │ ├── web/ # Axum handlers, router, middleware, DTOs
│ │ ├── core/ # Services, models, traits, context, worker
│ │ ├── store/ # StoreManager, entities, stores, query traits
│ │ ├── cache/ # CacheManager, Redis, cache stores
│ │ ├── macros/ # Custom derive macros (filters)
│ │ ├── dev/ # Dev environment fixtures & seeding
│ │ └── utils/ # Shared utilities
│ └── sql/
│ ├── migrations/dev/ # Development schema migrations
│ ├── migrations/prod/# Production schema migrations
│ └── fixtures/ # Bootstrap data (accounts, workspaces, roles, etc.)
├── ironstone-macros/ # Procedural macro crate
├── docs/ # Architecture & design documentation (24 docs)
├── docker-compose.yaml # PostgreSQL + Redis infra
└── Dockerfile.dev # Dev container with cargo-watch