authx-identity / Architecture / AuthX — Trust Boundaries
DocsAuthx-IdentityArchitectureAuthX — Trust Boundaries

AuthX — Trust Boundaries

AuthX separates authentication responsibilities through explicit trust boundaries.

6 min readApplies to v1.1.1
On this page ▾
  1. 1. Overview
  2. Trust rule
  3. Trust requirements
  4. Critical rule
  5. AuthXClient
  6. AuthXJWT
  7. Least Privilege
  8. Server-Side Secrets
  9. Cryptographic Key Separation
  10. Identity Authority Separation
  11. API Boundary Enforcement
  12. Database Isolation

1. Overview

The boundaries define which components are considered untrusted, which operations require backend authentication, and where sensitive credentials or cryptographic material are allowed to exist.

The primary boundaries are:

  1. Public client → AuthX
  2. Trusted backend → AuthX
  3. AuthX → PostgreSQL
  4. AuthX → JWT consumers
  5. Django application → AuthX integration layer

These boundaries are important because authentication-related responsibilities should not leak across system boundaries.


2. Trust Model

At a high level:

The important distinction is between public authentication operations and privileged internal identity operations.


3. Boundary 1 — Public Client → AuthX

Public clients are considered untrusted.

text
UNTRUSTED CLIENT
       │
       │ Public authentication request
       ▼
┌─────────────────────┐
│       AuthX         │
│                     │
│ Public OIDC/Auth    │
│ Endpoints           │
└─────────────────────┘

Public clients may interact with the authentication endpoints exposed for normal user authentication.

Typical operations include:

  • Login
  • Signup
  • Authentication flows
  • Token acquisition
  • Public identity operations exposed by AuthX

The client must not be trusted simply because it successfully reaches an AuthX endpoint.

Trust rule

text
Public client
    ≠
Trusted backend

A public authentication request must not provide access to privileged internal identity-management operations.


4. Boundary 2 — Trusted Backend → AuthX

Backend consumers operate across a separate trust boundary.

text
TRUSTED BACKEND
       │
       │ X-Service-Token
       ▼
┌─────────────────────┐
│       AuthX         │
│                     │
│ /internal/*         │
└─────────────────────┘

Internal AuthX endpoints require a service-level authentication mechanism.

The X-Service-Token is intended for trusted backend services rather than browser clients.

Trust requirements

The service token should:

  • Remain server-side.
  • Never be embedded in frontend code.
  • Never be exposed to browser clients.
  • Never be committed to source control.
  • Be supplied through protected configuration.
  • Be rotated when necessary.

The internal API therefore establishes a stronger trust boundary than the public authentication API.


5. Public vs Internal API Boundary

The distinction can be represented as:

This prevents the public authentication surface from becoming an implicit identity-administration interface.


6. Boundary 3 — AuthX → PostgreSQL

The AuthX runtime is trusted to access its persistence layer.

text
┌───────────────┐
│     AuthX     │
│   Runtime     │
└───────┬───────┘
        │
        │ Database credentials
        ▼
┌───────────────┐
│  PostgreSQL   │
│               │
│ Identity Data │
│ Token State   │
└───────────────┘

Database credentials belong only to the AuthX runtime.

Neither:

  • Public clients
  • Browser applications
  • JWT consumers
  • External API consumers

should have direct access to the AuthX PostgreSQL database.

The database is therefore behind the AuthX application boundary.


7. Database Trust Boundary

The intended relationship is:

Application consumers should use AuthX's supported API boundaries rather than connecting directly to its database.


8. Boundary 4 — JWT Signing and Verification

JWT signing creates a separate cryptographic trust boundary.

text
                 AuthX
                   │
                   │ Private signing key
                   ▼
             JWT Signing
                   │
                   ▼
              Signed JWT
                   │
                   ▼
          Consumer Application
                   │
                   │ Public key
                   ▼
             JWT Verification

AuthX holds the private signing key.

JWT consumers require only the corresponding public verification key.

Critical rule

text
Signing Private Key
        │
        └── AuthX only

Verification Public Key
        │
        └── JWT consumers

A consumer must never require the private signing key merely to validate a JWT.


9. Cryptographic Trust Boundary

The private key is a high-value secret and must be protected accordingly.


10. Boundary 5 — DjangoPlay → AuthX

DjangoPlay integrates with AuthX through two conceptually different mechanisms.

text
                     DjangoPlay
                         │
             ┌───────────┴───────────┐
             │                       │
             ▼                       ▼
       AuthXClient               AuthXJWT
             │                       │
             │ HTTP                  │ Local verification
             ▼                       ▼
           AuthX                JWT validation

AuthXClient

AuthXClient handles HTTP-based identity operations between DjangoPlay and AuthX.

It is used when DjangoPlay needs to communicate with the identity service.

AuthXJWT

AuthXJWT handles JWT validation within the consuming application.

This allows DjangoPlay to validate authentication credentials without implementing AuthX's identity persistence or password-management mechanisms itself.


11. Responsibility Boundary

DjangoPlay should not duplicate AuthX's identity authority.

The consuming Django application should not independently implement:

  • AuthX password hashing
  • AuthX identity persistence
  • AuthX refresh-token persistence
  • AuthX identity-management semantics

Those responsibilities belong to AuthX.


12. Trust Boundary Summary

Boundary Source Destination Trust Mechanism
Public authentication Public client AuthX Public authentication endpoints
Internal API Backend service AuthX X-Service-Token
Persistence AuthX PostgreSQL Private database credentials
JWT signing AuthX JWT consumer Private signing key / public verification key
Django integration DjangoPlay AuthX AuthXClient / AuthXJWT

13. Security Principles

The trust-boundary design follows several important principles:

Least Privilege

A component receives only the credentials and access required for its responsibility.

Server-Side Secrets

Service tokens, database credentials, and private signing keys remain server-side.

Cryptographic Key Separation

JWT consumers receive verification capability, not signing capability.

Identity Authority Separation

AuthX remains responsible for identity persistence and authentication authority.

API Boundary Enforcement

Public clients and trusted backend services use different access paths.

Database Isolation

Consumers interact with identity data through AuthX rather than directly accessing its database.


14. Summary

AuthX establishes explicit trust boundaries between public clients, trusted backend services, persistent identity data, JWT consumers, and integrating Django applications.

The most important boundary is the distinction between:

text
Public Client
     │
     ▼
Public AuthX API

and:

text
Trusted Backend
     │
     │ X-Service-Token
     ▼
AuthX Internal API

Similarly, cryptographic trust is separated so that:

text
AuthX
  │
  └── Private signing key

Consumer
  │
  └── Public verification key

This keeps identity authority, privileged backend operations, database access, and JWT signing responsibilities separated across well-defined security boundaries.