Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
API Token Scope And Assignment Record
- Date:
2026-03-12 - Gate:
api-token-scope-and-assignment - Environment:
- Managed local backend:
http://127.0.0.1:61530 - Multi-tenant entitlement profile:
multi-tenant - Authenticated user under test:
admin
- Managed local backend:
Automated Proof Baseline
go test ./internal/api -run 'Test(APIToken|SecurityTokens|SystemSettings|MultiTenant)' -count=1go test ./internal/api -run 'TestNormalizeRequestedScopesCanonicalizesLegacyUnifiedAgentAliases|TestUnifiedAgentEndpointsAcceptLegacyUnifiedAgentReportScopeAlias|TestContract_APITokenScopeAliasNormalization' -count=1cd frontend-modern && npx vitest run src/components/Settings/__tests__/APITokenManager.test.tsx src/utils/__tests__/apiClient.org.test.ts src/utils/__tests__/apiTokenPresentation.test.ts src/utils/__tests__/frontendResourceTypeBoundaries.test.tscd tests/integration && PULSE_E2E_USE_LOCAL_BACKEND=1 PULSE_E2E_SKIP_PLAYWRIGHT_INSTALL=1 PULSE_MULTI_TENANT_ENABLED=true npm test -- tests/13-api-token-scope.spec.ts --project=chromium- Result: pass
Manual Exercise
- Logged into the managed local backend as
adminthroughPOST /api/loginand used the issued session plus CSRF cookies for token-management requests. - Created an owner-bound API token with
settings:readand confirmed the create response boundownerUserId=admin. - Used that token to read
GET /api/system/settingssuccessfully. - Confirmed the same token was denied on:
POST /api/security/tokenswithrequiredScope=settings:writePOST /api/ai/execute/streamwithrequiredScope=ai:executePATCH /api/agents/agent/host-1/configwithrequiredScope=agent:manage
- Revoked the owner-bound token through
DELETE /api/security/tokens/{id}and confirmed the stale bearer token immediately failed onGET /api/system/settingswith401. - Created two orgs:
manual-token-org-a-1773352558099-998718manual-token-org-b-1773352558099-245536
- Created an org-bound token while scoped to org A and confirmed the create response still bound
ownerUserId=admin. - Confirmed that org-bound token could read
GET /api/orgs/{orgA}/memberswith200but failed againstGET /api/orgs/{orgB}/memberswith403andToken is not authorized for this organization. - Created a token using legacy scope
host-agent:reportand confirmed the stored scope canonicalized toagent:report. - Used that legacy-report token against both:
POST /api/agents/agent/reportPOST /api/agents/host/reportBoth requests reached the handler and failed only on intentionally invalid JSON with400, not on scope authorization.
- Created a token using legacy scope
host-agent:config:readand confirmed the stored scope canonicalized toagent:config:read. - Used that legacy-config token against both:
GET /api/agents/agent/host-1/configGET /api/agents/host/host-1/configBoth requests passed scope authorization and failed only because the synthetic host had not registered yet, returning404 agent_not_found, not403.
- Deleted the temporary org-bound and legacy-alias tokens and removed both temporary orgs after the exercise.
Outcome
- Session-created API tokens stayed bound to the authenticated user identity.
- Org-bound tokens stayed confined to the issuing org.
- Read, mutate, and exec scope enforcement returned the expected
missing_scopefailures with the canonical required scope names. - Revocation invalidated bearer tokens immediately.
- Legacy persisted
host-agent:*scope aliases canonicalized to the intended v6agent:*scopes and passed the canonical report/config scope gates.