Console

ScalWS Console: roles and capabilities

Roles are fixed sets of capabilities (cmd/scalws-console/src/rbac.rs). Every API handler names the capability it needs and checks it on the server; the browser only hides what the session cannot do. Sensitive actions also need a password confirmation within the last 5 minutes (re-authentication).

CapabilityWhat it allowsViewerDeveloperOperatorAdministrator
server.readOverview, Traffic (live statistics), Adaptive Runtime, Listeners, Aboutyesyesyesyes
config.readcurrent configuration, history, drafts, operations (secrets redacted)yesyesyesyes
config.draftcreate, edit, validate, diff and discard own draftsyesyesyes
config.applyapply a draft as a new generation (re-auth)yesyes
config.rollbackrestore a history entry as a new generation (re-auth)yesyes
runtime.managedesired instance count, autoscaling mode, run-time tenant limitsyesyes
cache.purgepurge cached responses on every instance (re-auth)yesyes
logs.readcontroller logyesyesyes
audit.readaudit logyesyes
users.readlist console accountsyes

Draft ownership: a draft can be edited, applied or discarded by its owner or an administrator; others with config.read can view it.

Accounts are managed in the credentials file on the server (docs/console-operations.md); there is no account editing in the browser, so there is no users.manage capability yet.

Control → capability → backing (capability matrix)

Every control in the UI and what implements it. Unsupported controls are not shown.

UI controlCapabilityBacked byShown
Health strip, instance table, decision explanation, distributionserver.readcontroller GET /statusyes
Listener sockets and generations, QUIC demuxserver.readstatus.listeners, status.quicyes
Desired instancesruntime.managePOST /scale/N (within instances.min..max)yes
Autoscaling moderuntime.managePOST /autoscaling/MODEyes
Tenant usage (CPU, memory, I/O)server.readcontroller GET /tenants/usageyes
Tenant limits at run time (audited as tenant.limits)runtime.managecontroller POST /tenants/{t}/limitsyes
Cache purgecache.purgePOST /cache/purgeAPI only (no page yet)
Live traffic (per site, listener, instance, method; latency, errors, bandwidth)server.readinstance /metrics, aggregated by the consoleyes
Settings pages for every field of scalws.yamlconfig.draftJSON Schema of the config structs (scalws-config, feature schema)yes
Settings pages for controller.yamlconfig.draftscalws-controller config-schema / check-configyes
Raw configuration editorconfig.draftdraft in console memoryyes
Validateconfig.draftscalws-config + scalwsd --checkyes
Applyconfig.applyfile transaction + POST /reload + health checkyes
Restore from historyconfig.rollbacksame transactionyes
Logslogs.readcontroller log file (--controller-log)yes
Audit logaudit.readaudit.jsonlyes
Drain / restart one instanceno controller endpointno
Apply controller.yamlconfig.applyfile transaction + --controller-restart-command + settle checkyes
Per-domain or per-HTTP-version countsnot reported by the data plane (proposal in console-architecture.md)no
Certificate upload / renewalnone (paths in the configuration; ACME automatic)no
Account managementcredentials fileread-only (About)

Future scopes

Capabilities are global today. The model leaves room for a scope (tenant or site) per grant: sites.manage@tenant-a. Drafts already carry an owner; per-tenant drafts would add a scope check on save and apply.