Configuration & environment variables
This is the single reference for every ARCHENSTACK_RBAC_* variable the libraries read — which are required (the process fails loudly if unset), which are optional feature toggles, and what each one means. It complements Deployment modes (which mode reads which knob) and the per-library backend pages.
The posture: env is the single source of truth, and it fails loud
Every library follows the same discipline for its deployment knobs:
- No inline fallback for a required knob. A required var carries no code default. If it is unset (or blank / malformed), the library fails loudly — at boot, at config-load, or when the Spring context refuses to start — rather than silently substituting a literal. That crash is the discoverability mechanism.
- One reader. Each library centralises env reads in a single config module (Django
conf.py, Nodeconfig.ts, Goconfig_env.go, RustWebConfig::from_env, JavaArchenstackRbacProperties). No other module reads the environment directly. - Optional toggles carry a documented default. An opt-in feature (the built-in claims resolver, the bootstrap bind) is the one place a default is legitimate — its "off" state is an explicit empty value, never inferred from a var's absence.
- Ships in
.env.example. Every required var is listed in the library's committed.env.example, socp .env.example .envyields a bootable config.
The anti-lock-out check feature (rbac.manage) and its minimum level (FULL) are spec-pinned in the core and deliberately not exposed as a knob in any library. No environment variable can repoint them. See Security §2.1.
Python (pure core)
archenstack-rbac is the framework-agnostic core — roles × features → level, canonical JSON, resolve/validate. It ships no web layer, no cache, and no database, so it reads no environment variables at all. You bring your own storage, cache, and HTTP layer, and any configuration (batch bounds, base path, tenancy) is entirely your host's concern.
This is intentional and consistent with the env-single-source posture: the core has no hidden env reads. The ARCHENSTACK_RBAC_* variables below belong to the adapters (Django, Node, Go, Rust, Java) that wrap a core.
Django (archenstack-rbac-django)
The adapter reads each knob from the ARCHENSTACK_RBAC settings dict or, as a fallback, the matching ARCHENSTACK_RBAC_* environment variable — with no code default for the required ones. ARCHENSTACK_RBAC_DEFAULT_ORG is a top-level Django setting the host wires from the environment.
| Variable | Required? | Meaning |
|---|---|---|
ARCHENSTACK_RBAC_DEFAULT_ORG | Required | The dev / seed / migration-backfill org slug (e.g. root). No code fallback — an unset value raises. Never a request-time substitute for a missing org claim. |
ARCHENSTACK_RBAC_CACHE_TTL | Required | Compiled-matrix cache TTL, seconds. 0 / empty ⇒ Django's "never expire" (rely on version-stamped invalidation). No code default. |
ARCHENSTACK_RBAC_CHECK_BATCH_MAX | Required | Max items a single POST /check/ batch may carry (SPEC §15.1). No code default. |
ARCHENSTACK_RBAC_AUDIT_DEFAULT_PAGE_SIZE | Required | Audit-log page size when a request omits ?page_size= (SPEC §11). No code default. |
ARCHENSTACK_RBAC_AUDIT_MAX_PAGE_SIZE | Required | Maximum audit-log page size a single request may ask for. No code default. |
ARCHENSTACK_RBAC_PLATFORM_SUBJECTS | Optional | Platform-admin allowlist — comma-separated stable sub strings granted cross-org authority. Empty ⇒ no platform-admin operator (fails closed). |
ARCHENSTACK_RBAC_PLATFORM_SUBJECTS_EXPIRES_AT | Required once the allowlist is non-empty | ISO-8601 instant after which the allowlist stops being honored. An armed allowlist with no expiry refuses to boot, so the grant cannot outlive the incident that justified it. |
ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_SUBJECT | Optional | Stable subject bound to the admin role in the default org at startup. Empty ⇒ no bootstrap (opt-in). |
ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_ROLE | Optional | Role slug the bootstrap subject is bound to. Empty ⇒ the seeded administrator management-FULL holder. |
Django's opt-in claims resolver is configured through the ARCHENSTACK_RBAC settings dict (JWT_SUBJECT_CLAIM, JWT_ORG_CLAIM, JWT_EMAIL_CLAIM, JWT_PLATFORM_CLAIM, JWT_PLATFORM_VALUE, JWT_CLAIMS_ATTR), not ARCHENSTACK_RBAC_* env vars. They name claims and where the validated claims mapping lives on the principal — structural, not operator-tuned. See Wiring multi-tenancy.
Node (@archenstack/rbac-node)
loadAdapterConfig() (in src/adapter/config.ts) is the single reader. It throws a single error listing every missing/invalid required var, so whoever is deploying fixes them in one pass.
| Variable | Required? | Meaning |
|---|---|---|
ARCHENSTACK_RBAC_DEFAULT_ORG | Required | The tenant/org slug the single-org in-memory matrix serves. Blank/unset throws. |
ARCHENSTACK_RBAC_CHECK_BATCH_MAX | Required | Max items per POST /check/ batch (positive integer). Blank/non-positive throws. |
ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_ROLE | Required | The role slug that MUST resolve rbac.manage FULL at startup (lock-out safety). |
ARCHENSTACK_RBAC_JWT_RESOLVER_ENABLED | Optional | Wire the built-in jwtClaimsRoleResolver. Default false (off). |
ARCHENSTACK_RBAC_JWT_ROLE_CLAIM | Optional | The claim holding the caller's role slug (direct path). Default role. |
Go (archenstack-rbac-go)
adapter.ConfigFromEnv() (in adapter/config_env.go) is the single reader; the claims resolver is opt-in, and when it is off the server applies the fail-closed DenyAllResolver (never a header default).
| Variable | Required? | Meaning |
|---|---|---|
ARCHENSTACK_RBAC_CHECK_BATCH_MAX | Required | Max items per POST /check/ batch (positive integer). Unset/blank/non-positive fails. |
ARCHENSTACK_RBAC_CLAIMS_RESOLVER_ENABLED | Optional | Wire the ClaimsRoleResolver. Default false (off ⇒ deny-all). |
ARCHENSTACK_RBAC_ROLE_CLAIM | Optional | Role claim name. Default role. |
ARCHENSTACK_RBAC_ROLE_CLAIM_VALUE | Optional | Membership-match value when the role claim is an array/scope string. Default empty. |
ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_SUBJECT | Optional | Subject bound at startup. Empty ⇒ no bootstrap. |
ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_ROLE | Optional | Role slug for the bootstrap subject. Default administrator. |
Rust (archenstack_rbac, web feature)
WebConfig::from_env() reads the one deployment knob; the claims resolver's role-claim is a struct field (ClaimsResolverConfig, default "role"), not an env read in the core. ARCHENSTACK_RBAC_BIND_ADDR belongs to the runnable serve example, not the library.
| Variable | Required? | Meaning |
|---|---|---|
ARCHENSTACK_RBAC_CHECK_BATCH_MAX | Required | Max items per POST /check/ batch (SPEC §15.1). Unset / non-numeric / zero is a hard error at boot. |
ARCHENSTACK_RBAC_BIND_ADDR | Optional (example) | host:port the serve demo binds (e.g. 127.0.0.1:8080). Example-only, not read by the library. |
Java / Spring (archenstack-rbac-spring-boot-starter)
ArchenstackRbacProperties binds from the archenstack-rbac.* property namespace; Spring's relaxed binding lets the corresponding ARCHENSTACK_RBAC_* environment variable override each one. The required knobs are @NotBlank / @NotNull validated, so a missing one makes the context fail to start.
| Property | Env var | Required? | Meaning |
|---|---|---|---|
archenstack-rbac.base-path | ARCHENSTACK_RBAC_BASE_PATH | Required | URL prefix the management routes mount under (before /permissions/...), e.g. /api/v1. |
archenstack-rbac.check-batch-max | ARCHENSTACK_RBAC_CHECK_BATCH_MAX | Required | Max items per POST /check/ batch (SPEC §15.1). |
archenstack-rbac.audit-default-page-size | ARCHENSTACK_RBAC_AUDIT_DEFAULT_PAGE_SIZE | Required | Audit-log page size when a request omits ?page_size=. |
archenstack-rbac.audit-max-page-size | ARCHENSTACK_RBAC_AUDIT_MAX_PAGE_SIZE | Required | Maximum audit-log page size a single request may ask for. |
archenstack-rbac.default-org | ARCHENSTACK_RBAC_DEFAULT_ORG | Required when seeding | Dev / seed / backfill org slug. No inline default — unset with seeding on fails loudly. Never a request-time fallback. |
archenstack-rbac.seed-on-startup | ARCHENSTACK_RBAC_SEED_ON_STARTUP | Optional | Seed the sample catalogue on startup when the matrix is empty. Default true. |
archenstack-rbac.member-jit | ARCHENSTACK_RBAC_MEMBER_JIT | Optional | JIT-register a valid (org, sub) as an assignable member on the resolve path. Default true. |
archenstack-rbac.platform-subjects | ARCHENSTACK_RBAC_PLATFORM_SUBJECTS | Optional | Platform-admin allowlist — a last-resort set of sub strings granted cross-org authority (comma-separated). Empty ⇒ no platform-admin operator (fails closed). Prefer a bounded IdP grant; see incident access. |
archenstack-rbac.bootstrap-admin-subject | ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_SUBJECT | Optional | Subject bound to the admin role in the default org at startup. Empty ⇒ no bootstrap. |
archenstack-rbac.bootstrap-admin-role | ARCHENSTACK_RBAC_BOOTSTRAP_ADMIN_ROLE | Optional | Role slug the bootstrap subject binds to. Default administrator. |
archenstack-rbac.scope-include-department | ARCHENSTACK_RBAC_SCOPE_INCLUDE_DEPARTMENT | Optional | Add the own_department scope atom to the served pack. Default false. |
archenstack-rbac.scope-include-subtree | ARCHENSTACK_RBAC_SCOPE_INCLUDE_SUBTREE | Optional | Add the transitive own_subtree chain-of-command atom to the served pack. Default false. |
archenstack-rbac.scope-owner-fields | ARCHENSTACK_RBAC_SCOPE_OWNER_FIELDS | Optional | Object FK field names tried in order for own_record. Default owner, created_by, user. |
archenstack-rbac.scope-department-field | ARCHENSTACK_RBAC_SCOPE_DEPARTMENT_FIELD | Optional | Object FK field name for own_department. Default department. |
archenstack-rbac.enforcement-mode | ARCHENSTACK_RBAC_ENFORCEMENT_MODE (Django ENFORCEMENT_MODE) | Optional | shadow makes the object authorizer and the coarse check (@Can / MatrixPermission) log a would-be denial and allow it through instead of blocking — for staging enforcement onto a live app (enforcement mode); rbac.manage is never shadowed. Default enforce. |
archenstack-rbac.host-exception-advice | ARCHENSTACK_RBAC_HOST_EXCEPTION_ADVICE | Optional | Render a ScopeAuthorizer denial thrown from the host's own layer as a 403/401 instead of a 500. Default false. |
archenstack-rbac.host-exception-advice-order | ARCHENSTACK_RBAC_HOST_EXCEPTION_ADVICE_ORDER | Optional | The advice's @Order. Default HIGHEST_PRECEDENCE, so it wins over a host's generic @ExceptionHandler(Exception.class). |
archenstack-rbac.tenant-context | ARCHENSTACK_RBAC_TENANT_CONTEXT | Optional | Publish the request's active org to ArchenstackTenantContext for the @PrePersist write-stamp (write-side only; does not scope reads). Default false. |
archenstack-rbac.tenant-default-org | ARCHENSTACK_RBAC_TENANT_DEFAULT_ORG | Optional | Fallback tenant for the @PrePersist stamp off a request (a seeder/cron). Empty ⇒ leave null and let NOT NULL/RLS reject it. |
The JWT-claims resolver group (archenstack-rbac.jwt-resolver.*)
Off by default; the built-in JwtClaimsRoleResolver reads identity claims off a Spring-Security-authenticated principal (Archenstack never validates the token). Overridable via ARCHENSTACK_RBAC_JWT_* env vars.
| Property | Env var | Meaning |
|---|---|---|
archenstack-rbac.jwt-resolver.enabled | ARCHENSTACK_RBAC_JWT_RESOLVER_ENABLED | Register the built-in resolver. Default false. |
archenstack-rbac.jwt-resolver.subject-claim | ARCHENSTACK_RBAC_JWT_SUBJECT_CLAIM | Claim holding the stable subject id (the assignment key). Default sub. |
archenstack-rbac.jwt-resolver.org-claim | ARCHENSTACK_RBAC_JWT_ORG_CLAIM | Claim holding the active org slug. Default org. |
archenstack-rbac.jwt-resolver.email-claim | ARCHENSTACK_RBAC_JWT_EMAIL_CLAIM | Claim holding the caller's email (member reconciliation). Default email. |
archenstack-rbac.jwt-resolver.platform-claim | ARCHENSTACK_RBAC_JWT_PLATFORM_CLAIM | Claim asserting platform-admin authority. Empty ⇒ none consulted. |
archenstack-rbac.jwt-resolver.platform-value | ARCHENSTACK_RBAC_JWT_PLATFORM_VALUE | Value to match when the platform claim is an array / scope string. Empty ⇒ treat it as a plain boolean. |
archenstack-rbac.jwt-resolver.platform-orgs-claim | ARCHENSTACK_RBAC_JWT_PLATFORM_ORGS_CLAIM | Claim bounding the platform grant to a set of org slugs (array or space-delimited) — a parent governing only its subsidiaries. Empty ⇒ the grant stays unbounded. See Hierarchical organizations. |
See also
- Deployment modes — which mode reads which knob (IdP vs standalone, single-org vs multi-tenant).
- Installation — pinning each library at version
1.0.0. - Organizations (multi-tenancy) — where
ARCHENSTACK_RBAC_DEFAULT_ORGand the org claim fit. - Security — the fail-closed threat model these defaults enforce.