Configuration Guide
1. Environment Variable Injection
The application supports overriding key configuration items with environment variables. This matters
especially in Docker/Kubernetes environments — sensitive values should not be hardcoded in
config.json.
Supported Environment Variables
| Variable | Description | Config path overridden | Example |
|---|---|---|---|
FULLA_DB_HOST | Database host | db_clients[0].host | postgres |
FULLA_DB_NAME | Database name | db_clients[0].dbname | fulla_db |
FULLA_DB_PASSWORD | Database password | db_clients[0].passwd | secret |
FULLA_REDIS_HOST | Redis host | redis_clients[0].host | redis |
FULLA_REDIS_PASSWORD | Redis password | redis_clients[0].passwd | secret |
FULLA_PORTAL_CLIENT_SECRET | Portal client secret (legacy alias: FULLA_VUE_CLIENT_SECRET) | plugins[OAuth2Plugin].config.clients.fulla-portal.secret | ... |
For the full production environment variable list (30+ entries), see the variable table in Production Deployment; this table lists only the six core items of the injection mechanism.
How It Works
- Load hook: at startup,
loadConfiguration()inmain.ccfirst callscommon::config::ConfigManager::load(), thenConfigManager::validate(). - Parse: the base
config.jsonis read into aJson::Valueobject. - Inject: the environment variables above are checked; when present, the corresponding nodes in the
Json::Valueare updated in place. - Load: Drogon loads the modified configuration object directly via
drogon::app().loadConfigJson(config); no temporary files are written to disk.
Verification
A dedicated test, EnvInjectionVerify (EnvConfigTest.cc), guarantees this logic is correct.
.env file vs. process environment
loadDotEnv() parses a .env file (searched as .env, ../.env, ../../.env
relative to the working directory) into memory; it never exports the values
into the process environment. Two accessors read the result, and every read in
production code goes through one of them (arch-guard rule R5):
.env-aware (ConfigManager::getEnv):.envwins over the process environment. The config overrides above andFULLA_ENVuse it.- Process environment only (
ConfigManager::getProcessEnv): the.envfile is not consulted. This is deliberate for the keys that carry credentials or decide startup behavior and must be real environment variables (container / orchestrator injection):FULLA_SIGNING_KEY,FULLA_JWT_KEY_PATH,FULLA_AUTO_MIGRATE,FULLA_BOOTSTRAP_ADMIN_PASSWORD,FULLA_BOOTSTRAP_ADMIN_EMAIL, theFULLA_SMTP_*family andDETAILED_VALIDATION_ERRORS.
A key of the second group that is set in .env is ignored, and startup
reports it:
[ConfigManager] WARNING: FULLA_AUTO_MIGRATE is set in .env but is read from the process environment only; export it as a real environment variable (the .env value is ignored)
It used to be ignored silently. The production signing-key error says the
same for FULLA_SIGNING_KEY / FULLA_JWT_KEY_PATH.
FULLA_ENV is read the same way everywhere. It used to honor .env in two
places and ignore it in two others, so a .env-only production skipped the
signing-key and client-registry checks. When .env and the process
environment disagree on it, the .env value applies to every reader and
startup reports the disagreement — keep FULLA_ENV in one place.
2. Docker Deployment
The repository ships a docker-compose.yml that orchestrates the full stack (see Docker Deployment for details).
Service Stack
- fulla-frontend: Vue SPA + Nginx (built from the
frontend-runtimestage ofdeploy/docker/Dockerfile). - fulla-admin: admin console frontend (built from
frontends/admin/Dockerfile). - fulla-backend: Drogon backend (built from the
backend-runtimestage ofdeploy/docker/Dockerfile). - fulla-postgres: PostgreSQL 17 (schema under
apps/server/migrations/applied at backend startup viaFULLA_AUTO_MIGRATE=true). - fulla-redis: password-protected Redis 7.
- fulla-prometheus: metrics collection.
Quick Start
# 构建并启动(在仓库根目录执行)
docker compose -f deploy/docker/docker-compose.yml up -d --build
# 查看日志
docker compose -f deploy/docker/docker-compose.yml logs -f fulla-backend
# 停止
docker compose -f deploy/docker/docker-compose.yml down
Configuration Handling under Docker
docker-compose.yml mounts apps/server/config/config.json into the container read-only;
the environment section injects environment variables (see §1), and at runtime
ConfigManager::load() plus environment injection override the file defaults.
3. Storage Backend Selection
The OAuth2 plugin's config.storage_type determines the persistence backend:
storage_type | Status | Notes |
|---|---|---|
postgres | Supported (the only production backend) | Full token persistence, refresh token rotation and reuse detection. |
redis | Deprecated | Never persisted refresh tokens historically (saveRefreshToken/getRefreshToken are no-ops), so rotation and reuse detection silently fail. The mode still starts (for compatibility; it logs an ERROR at startup), but the refresh_token grant is rejected with unsupported_grant_type. Do not use in new deployments. |
memory | Test only | For unit/integration tests; not for production. |
Target architecture: Postgres as the storage layer, fronted by an online Redis L2 cache
(keyspace fulla:cache:*, configured via the cache block in config.json — enabled /
ttl_seconds / invalidation_double_delete_delay_ms; invalidation uses the delayed
double-delete, see DelayedDoubleDelete). There is no standalone Redis storage mode.
4. Issuer Configuration
config.metadata.issuer (custom config) is the single source of truth for the server's issuer
URL. OAuth2Plugin reads it once at startup and uses it consistently for:
- the
issclaim stamped on issued access tokens (authorization_code / refresh_token / client_credentials / device_code grants); issin introspection responses (backfilled from the configured value when the stored row carries none);- the discovery documents (
/.well-known/openid-configuration,/.well-known/oauth-authorization-server).
Constraints:
- Trailing slashes are normalized away automatically; do not rely on them.
- Defaults to
http://localhost:5555when unset, with aLOG_WARN. - Production deployments must configure an
https://issuer; a plaintext http issuer on a non-loopback host triggers a startup warning. - Introspection
issand the discovery documents'issuerare guaranteed byte-for-byte identical (as OIDC Discovery §3 requires).
4a. Admin Console Origin & Device Verification URI (#146)
config.admin_console.url (custom config) is the ORIGIN (scheme + host [+ port], no
path) of the admin console SPA — https://admin.example.com in production,
default http://localhost:5174 (the dev vite server). It feeds exactly one
consumer today: the RFC 8628 device-authorization response's
verification_uri/verification_uri_complete, which default to
{admin_console.url}/admin/devices — the real device-approval page. Before #146
the default pointed at /oauth2/device, a path with no page behind it.
- Explicit override:
config.device_authorization.verification_uri(full URL) wins over the derived default;verification_uri_completeis always derived (verification_uri+?user_code=<code>). - Trailing slashes on
admin_console.urlare normalized away.
4b. Forced First-Login Password Change (#145)
Accounts created with users.must_change_password = true — the bootstrap admin
(both the random and the FULLA_BOOTSTRAP_ADMIN_PASSWORD variants) and users
created/updated via the admin API with must_change_password: true — must
change the password before any authorization code is issued:
/oauth2/loginanswers200 {"password_change_required": true, ...}instead of issuing a code;/oauth2/authorizeredirects to the frontend login page (which renders the change-password form);prompt=noneanswerserror=login_required;POST /oauth2/consentanswers 403AUTH_PASSWORD_CHANGE_REQUIRED.
The change path is POST /oauth2/password/change (session-authenticated,
requires old_password, enforces auth.min_password_length, revokes all
tokens, clears the flag). PUT /api/me/password also clears the flag. An
admin-set flag on an existing account takes effect at that user's next login.
4c. Authorize Login/Consent Redirect Targets
When /oauth2/authorize must involve the user (not logged in, re-auth forced,
or consent required), it redirects to the login/consent screen. The target is
resolved like this:
config.oauth2.login_url/config.oauth2.consent_url— a non-empty value wins. Both can be set from the environment withFULLA_OAUTH2_LOGIN_URLandFULLA_OAUTH2_CONSENT_URL.- Otherwise the backend-relative
/login|/consent— the unchanged default. The backend serves/loginitself; it serves noGET /consent(that page is a SPA route).
The defaults only reach the SPA where a gateway fronts both on one origin.
Behind the production stack's nginx or a Helm ingress, /login and
/consent are routed to the frontend, so nothing needs to be configured
there. A stack without a shared gateway — deploy/docker/docker-compose.yml
(the backend on 5555, the SPA on 8080) — has to tell the backend where the
two pages are, which is why that file sets both variables to the SPA's
address. Do the same for any deployment where the SPA is on another origin
than the one /oauth2/authorize is reached on:
FULLA_OAUTH2_LOGIN_URL=https://portal.example.com/login
FULLA_OAUTH2_CONSENT_URL=https://portal.example.com/consent
Left at the defaults in such a deployment, the authorize endpoint sends the browser to the backend's own login page (unstyled: its inline styles are blocked by the backend CSP) and, when consent is required, to a 404.
A configured URL may already carry a query string; the authorize parameters
are then appended with & instead of ?. Non-string and empty values count
as "not set" rather than being thrown from asString(). An override never
creates a key, which is why every shipped config carries both keys as empty
strings. A variable whose key the loaded config file lacks is reported at
startup instead of being silently ignored (see deployment.md, "Backend
configuration").
Related: the SPA consent page submits POST /oauth2/consent with json=true
and navigates the browser itself from the JSON location field — a native
form POST + 302 is killed by Chrome's form-action enforcement (which also
checks the redirect following a form submission). The 302 contract remains the
default for non-JSON callers.
5. Client Token-Endpoint Authentication Methods (F-017)
Each client declares, via the oauth2_clients.token_endpoint_auth_method column, how it
authenticates at /oauth2/token, /oauth2/introspect, and /oauth2/revoke:
| Value | Semantics |
|---|---|
client_secret_basic | The secret must be sent in the Authorization: Basic header; a client_secret in the body is rejected. |
client_secret_post | The secret must be sent in the POST body; the Basic header is rejected. |
none | PUBLIC client; any client_secret present is rejected. |
| NULL / empty | Legacy lenient fallback: accepts the Basic header and also a body secret (Basic→body fallback). |
When the field is omitted at creation through the registration/admin endpoints, the following defaults are stored:
PUBLICclients →none(they have no secret to begin with).CONFIDENTIALclients →client_secret_basic.
Seed clients declare it explicitly: fulla-portal and fulla-admin-console → none;
backend-svc → client_secret_basic. Existing clients with NULL values keep their
pre-upgrade behavior; the upgrade does not break existing deployments.
Config seeding and the admin API honor the key:
- Config seeding honors the key. The bootstrap seeder now reads
token_endpoint_auth_methodfrom eachplugins.OAuth2Plugin.config.clientsentry (previously it ignored the key entirely and always wroteclient_secret_basicfor CONFIDENTIAL clients, so an RP that authenticates with a body secret could not be seeded from config). Combination rule:PUBLICaccepts onlynone;CONFIDENTIALaccepts onlyclient_secret_basic/client_secret_post— an illegal explicit combination fails that client's seed with a startup ERROR (the client is NOT seeded). The in-memory repository applies the same rule. - The admin API can change it.
PUT /api/admin/clients/{clientId}acceptstoken_endpoint_auth_method(same value domain + combination rule, checked against the row'sclient_type), and the admin console's application detail page exposes it as a dropdown. Changes take effect immediately at the token/introspect/revoke endpoints (F-017 reads the client row; the client cache is invalidated on write).
6. OIDC prompt / max_age / auth_time (F-022)
The authorization endpoint supports the prompt and max_age parameters from OIDC Core
§3.1.2.1:
prompt=none: no UI of any kind. No session → 302error=login_required; consent required →error=consent_required. Errors redirect back to the validatedredirect_uricarrying the echoedstate. Combiningnonewith other values (such asnone login) is self-contradictory and returns 400 outright.prompt=login: forces re-authentication even when a session already exists.prompt=consent: forces the consent page even when existing consent already covers the requested scopes.max_age=<seconds>: forces re-authentication if the session'sauth_time(set at login / MFA verification) is older thanmax_age.
auth_time and amr are persisted with the authorization code and included in the id_token
at redemption: auth_time (when greater than 0), amr (a JSON array when set), acr
(1 = password only, 2 = MFA). The discovery document advertises
prompt_values_supported, acr_values_supported, and related claims.
7. RP-Initiated Logout (F-027) and Session Invalidation (F-028)
/oauth2/end_session (GET + POST) terminates the server-side session. To redirect after
logout, the client must supply a post_logout_redirect_uri, and it must be one of the
client's registered redirect URIs; the client is identified by the aud claim of the
id_token_hint. The hint's signature is verified (RS256 + kid + iss/exp/sub policy,
issue #78); failed verification is rejected with 400 AUTH_INVALID_ID_TOKEN_HINT. Without
a valid hint plus a registered URI, the request is rejected with 400; on success a 302
redirect carries the echoed state, and a 200 is returned when no redirect URI is provided.
POST /oauth2/logout (the existing API logout) additionally calls session()->clear()
(F-028), so the server-side session is terminated together with access-token revocation.
8. Authentication Failure Rate Limiting (F-018)
The token / introspect / revoke / device-code polling endpoints share one in-process
sliding-window rate limiter, bucketed by (client_ip, client_id). Once failed attempts
within the rolling window (default 60s) reach max_failures (default 30), subsequent
requests return HTTP 429 with a Retry-After header and an OAuth2-style
{error, error_description} body. Only failures count; a single success resets the
counter, so normal load (and integration suites making many consecutive successful requests)
is never rate-limited.
Configured via custom_config.auth.rate_limit (all config*.json carry the defaults
explicitly):
"custom_config": {
"auth": {
"require_pkce": true,
"allow_http_redirect_uri": true,
"rate_limit": {
"max_failures": 30,
"window_seconds": 60
}
}
}
PKCE at the authorize endpoint is S256-only (P0-5, RFC 9700 §2.1.1): a
code_challenge_method=plain request (or an omitted method, which RFC 7636
§4.3 would default to plain) is rejected with invalid_request. The
auth.allow_pkce_plain escape hatch that shipped in v1.5.0 as a one-release
transition for legacy PUBLIC clients was removed in v1.6.0 (see §14) — the
config key no longer exists, and code_challenge_method=plain is rejected
regardless of configuration.
The rate_limit object may be omitted; when it is missing, built-in defaults are used
(30 / 60). The limiter is a function-local singleton (RateLimiter::instance() from
libs/common/include/fulla/common/utils/RateLimiter.h); the four protected endpoints share
one counter table within the same process. This is minimal brute-force / token-probing
protection; multi-instance deployments require shared storage (Redis), which is future work.
9. JWKS Key Rotation (#110 — keystore directory)
plugins.OAuth2Plugin.config.oidc.signing_keystore_dir points at a keystore directory
and is the key-rotation mechanism:
<path>/
2026-09.pem # one RSA private key per file; FILENAME (minus .pem) = kid
2026-12.pem
active_kid # one-line text file naming the signing kid (e.g. "2026-12")
Semantics:
- Signing always uses the key named by
active_kid; the JWT header carries that kid. - Verification routes on the token's header kid across ALL loaded keys, and the JWKS
endpoint (
/.well-known/jwks.json) publishes every loaded public key — so outstanding tokens keep resolving while their key remains in the directory. GET /api/admin/oidc/keysreports the live state: every kid, which one isactive, which are merelypublished.- The keystore takes precedence over
FULLA_SIGNING_KEY/FULLA_JWT_KEY_PATH/signing_key_path, and a configured-but-broken directory is a hard startup failure (never a silent fallback to a different key source).
Rotation procedure (JwkManager is init-once/read-only by design, so each step is a restart — three restarts per cycle):
- Publish: drop the new
<kid>.peminto the directory, restart. Both keys are now in the JWKS; the OLD key keeps signing. Wait at least the JWKSCache-Controlmax-age (1 h) before step 2 — a strictly-caching RP otherwise cannot resolve the new kid yet. - Switch: edit
active_kidto the new kid, restart. New tokens carry the new kid; old tokens still verify (old key still published). - Retire: after the maximum token lifetime has elapsed (access + refresh chain —
size this from your token TTLs, not the clock of step 2), delete the old
<kid>.pemand restart. Tokens from the old key now fail verification with an unknown-kid error.
Skipping step 3 leaves the old key published forever (harmless, but keeps the compromise surface open); performing it early invalidates outstanding old-key tokens.
Key generation is standard tooling, e.g.
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out 2026-12.pem.
Protect the directory like any private-key material (file permissions / secret mounts).
10. Legacy Password-Hash Migration Window (#103)
fulla verifies passwords exclusively through PBKDF2-SHA256
($pbkdf2-sha256$310000$<salt>$<hash>). The pre-1.0 unsalted-SHA256 format
is retired and rejected by default on every path:
auth.allow_legacy_hashisfalsein all shipped configs, and a missing key also meansfalse(assembly-level default). Whilefalse, a login attempt against a legacy-format hash is denied before any password verification — with the correct password too.- The denial is a policy rejection, not a wrong password: it does not
advance the account-lockout counter (a username alone must not let an
attacker lock a legacy user out, and a later window reopen must not be
blocked by
locked_until). - Each denial logs
AUTH_LEGACY_HASH_REJECTED(WARN) with the internal user id — the operator-facing signal for who still needs migration. The client always receives the genericAUTH_INVALID_CREDENTIALS; nothing distinguishes "legacy denied" from "wrong password" from the outside.
Who is affected? Only databases seeded before v1.0.1 that still hold legacy-format rows. Inventory SQL:
SELECT count(*) FROM users WHERE password_hash NOT LIKE '$pbkdf2-sha256$%';
Migration paths that need no window:
- Email password reset — the reset flow always writes PBKDF2, so a legacy user who resets migrates transparently on completion.
- Administrator-triggered reset — same effect.
Change-password does NOT migrate a legacy user: it verifies the old password through the same retired branch and therefore fails; use a reset instead.
Reopening the window (temporary, login-only): set
auth.allow_legacy_hash: true and restart. Legacy users can then log in
and are transparently rehashed to PBKDF2 on that first successful login
(identity login path only). Because policy rejections never advanced the
lockout counter, no unlock is required before reopening. Close the window
again once the inventory query returns 0; the window (and the
identity-side rehash code) is scheduled for removal in v1.1.
11. WebAuthn / Passkeys (#142)
Passkey registration and authentication perform REAL cryptographic
verification (W3C WebAuthn Level 2 §7.1/§6.1): ES256 only, fmt="none"
attestations only, and the assertion signature is checked against the COSE
public key stored at registration time. Configuration:
"webauthn": {
"rp_id": "localhost",
"rp_name": "OAuth2 Server",
"rp_origins": ["http://localhost:5173"]
}
rp_id— Relying Party id (the registrable domain the credential is scoped to;localhostfor local development).rp_origins— STRICT allowlist of acceptedclientDataJSONorigins. Required before the finish endpoints accept anything: while the list is empty (or the key absent), registration/authentication finish fail closed. Production must list the exact portal origin(s), e.g.["https://auth.example.com"].- Challenge lifetime is 300 seconds (code-enforced). The REGISTRATION
challenge is bound to the Bearer subject (the register endpoints sit
behind the token filter; the SPA sends no session cookie); the
AUTHENTICATION challenge is bound to the caller's session — the login
flow requires cookies (
credentials: 'include'). userVerificationisrequiredin both begin responses and enforced (UV=1) on authentication — authenticators without user-verification capability cannot register credentials here (they would never authenticate). Sign-count regression is treated as authenticator cloning: the assertion is rejected and awebauthn_clone_detectedaudit action is recorded.- V028 cleared all pre-existing credential rows: every stored row was client-asserted material that never passed attestation verification (and authenticateFinish used to accept a bare credential id as proof of possession). Users re-register their passkeys after upgrading.
- Single-instance deployments: the subject-bound registration challenge store is in-process (same limitation class as the consent_csrf nonce). Multi-instance deployments need shared challenge storage (follow-up).
12. Email Templates (P1-2, #278)
The three production emails (email verification, password reset, org
invitation) render from DB-backed, editable, localized templates
(V040 email_templates: 3 keys × en/zh-CN seeds, each row carrying
subject + HTML + plain-text). Sending stays env-driven (FULLA_SMTP_*
variables select Console vs SMTP); templates add localization, editability
and multipart/alternative HTML delivery on top.
Admin API (admin role + roles:read/roles:write scopes):
GET /api/admin/email-templates, GET|PUT /api/admin/email-templates/{key}/{locale},
POST /api/admin/email-templates/{key}/{locale}/test-send. Postgres only —
memory deployments answer 404 (no template store; the engine falls back to
compile-time built-ins for actual sends).
Template variables use {{name}} placeholders; every substituted value is
HTML-escaped by the engine (org names are unfiltered free text). Save-time
content policy rejects <script>/<iframe>/<form>/<object>/<embed>/<base>
tags, javascript:/data:/vbscript: URLs, and any outbound http(s)
href outside the configured allowlist (see allowed_link_domains below)
with EMAIL_TEMPLATE_CONTENT_REJECTED (400).
Configuration (custom_config):
"email": {
"allowed_link_domains": ["portal.example.com"],
"test_send_quota_per_day": 10,
"allow_org_logo": false
}
allowed_link_domains— hosts permitted in literalhttp(s)hrefs of saved templates (exact or subdomain match; entries accept bare hosts orhttps://host/spellings). Empty/absent = no external links allowed; variable links ({{verify_link}},{{reset_link}}) are engine-supplied and unaffected.test_recipients— extra addresses authorized for the admin test-send endpoint, in addition to each admin's own account email.test_send_quota_per_day— rolling-24h per-admin test-send quota (default 10; counted fromemail_test_sentaudit rows in the last 24 hours — deliberately NOT a calendar day).allow_org_logo— placeholder for org-branding variables in invitation templates; remote org logos in email are a recipient-tracking privacy surface and stay off by default. No seeded template references org logo variables.
Link trust anchor (D8 red line): verification and reset link domains
derive ONLY from the global frontend.url key — org-controlled input is
never interpolated into a security link, and verification/reset emails
carry no org branding regardless of configuration.
13. Audit Log Export & Retention (P1-6, #283)
GET /api/admin/logs/export (admin role + audit:read scope) streams the
audit trail as CSV (attachment). Same filters as the list endpoint
(action/outcome/actor_id) plus a mandatory time window
(from/to, unix epoch seconds) unless the caller explicitly opts into
the full table with all=true; a hard row cap guards unbounded exports.
Cells are formula-injection hardened: any cell starting with
= + - @ or a tab/CR gets an apostrophe prefix (OWASP) — user_agent,
ip and details are fully user-controlled and the export is the
injection egress. Every export is audited (audit_exported).
Configuration (custom_config):
"audit": {
"retention_months": 0,
"export_max_rows": 500000
}
retention_months— audit retention window (default 0 = keep forever). The cleanup cycle (the same one that advances the partition horizon) drops monthlyaudit_logs_pYYYY_MMpartitions whose whole month lies before the window. Only partitions matching that exact naming pattern are ever candidates; the DEFAULT partition is never dropped. Recovery from dropped history = re-import the exported CSVs.export_max_rows— export row cap (default 500k). The per-requestlimitparameter may only LOWER it; over-cap exports answer 400AUDIT_EXPORT_TOO_LARGEwith a hint to narrow the window.
14. Branding consumption chain + PKCE plain removal (P1-1, #279)
PKCE plain is now unconditionally rejected. The
auth.allow_pkce_plain escape hatch that shipped in v1.5.0 as a
one-release transition for legacy PUBLIC clients is REMOVED (the window
has closed). The config key is gone: code_challenge_method=plain at
authorize answers invalid_request regardless of configuration, and
discovery keeps advertising S256 only. Deployments that still relied on
plain must migrate clients to S256 before upgrading to v1.6.0.
Branding consumption. Org and client brand fields now reach the user-facing screens:
GET /oauth2/authorize-context(additive): clientlogo_uriplus the owning organization's{org_name, logo_uri?, primary_color?}when the application is org-owned.GET /oauth2/consent/context(additive): client display block, localizedscope_descriptions(see below), and the org brand fields on the org banner. Branding is display-only and untrusted — it always renders paired with the owner attribution label.- The consent screen renders logos ONLY via
<img src>(SVG in an img context does not execute scripts; never wrapped in an anchor). The nginx layer (user + admin SPA) now sets a Content-Security-Policy (img-src 'self' data: https:) — previously the SPAs carried no CSP at all.
Write paths & validation (V041 adds oauth2_clients.logo_uri and
oauth2_scopes.description_zh): admin client create/edit, portal
My Applications create/edit accept logo_uri; org self-service create
validates both brand fields. Rules (deliberately NOT the redirect
registration rule):
logo_uri: https-only, loopback hosts exempted for dev, no userinfo/fragment, ≤512 chars — does NOT inheritauth.allow_http_redirect_uri.primary_color:^#[0-9a-fA-F]{3,6}$(the previous acceptance was unbounded; the column is VARCHAR(7)).description_zh(scope admin CRUD, ≤512 chars): the zh-CN consent-screen copy. The consent context serves it for zh pages (server-side locale dimension); the frontend dictionary is only the missing-key fallback. Description changes are audited with a before/after diff (scope_updated).
15. RBAC permission enforcement (P1-8, #285)
Delegated administration is live: the three-gate RBAC model (ADR-0014
rev.1) — scope tiering (chain①), IdentityService scope checks (chain②),
and the AuthorizationFilter role/permission gate (gate③) — now resolves
permissions from the role_permissions catalog (V043 seed; legacy V005
names marked retired in place).
- rbac_rules object form (additive): an entry may be
{"permissions": ["users:read"]}instead of a role array — the caller's role→permission union must cover every listed name. Specific rules match BEFORE the/api/admin/.* -> ["admin"]catch-all (most-specific-first ordering is enforced at load). The shipped config demonstrates the helpdesk shape:/api/admin/users.*requiresusers:read. - Classification vs determination decoupled: which scopes are
admin-class still comes from
oauth2_scopes.requires_admin_role(deprecated column, read this release); WHETHER a user passes is now permission-based (or the literal admin super-role). Granting a role a scope never de-classifies it. - Login path tiers scopes too: the 2-step portal login mints codes with ONLY the scopes the three-tier engine validates (previously unfiltered — a delegated console received admin-class scopes its user held no permission for).
- Role permission administration:
GET/PUT /api/admin/roles/{id}/permissions(full-replace; every listed name must exist; auditedrole_permissions_updated; single-instance cache invalidation on commit — multi-instance drift is a known limitation until P3 shared storage). - Memory mode: the compile-time default map (admin → full ten-set, user → none) mirrors the V043 seed.