Skip to main content
← Back to list
01Issue
FeatureShippedSwamp Club
Assigneesstack72

Relationships

#1232 Expand token scope registry to full taxonomy (phase 1 addendum, #960)

Opened by stack72 · 7/18/2026· Shipped 7/18/2026

Context

Phase 1 of #960 shipped the TokenScopes value object with only extension scopes in the registry. Before phase 2 (enforcement), we need the full scope taxonomy registered so tokens can carry any valid scope from day one.

This is a one-file change to the registry + test coverage. No enforcement, no UI, no API changes.

What to change

lib/domain/collective-api-token/token-scope.ts

Add to VALID_SCOPES:

  • lab:read, lab:write, lab:*
  • profile:read, profile:write, profile:*
  • collective:read, collective:write, collective:*
  • billing:manage
  • feed:write
  • notifications:read, notifications:write, notifications:*
  • oauth:manage

Add to WILDCARD_EXPANSIONS:

  • lab:*["lab:read", "lab:write"]
  • profile:*["profile:read", "profile:write"]
  • collective:*["collective:read", "collective:write"]
  • notifications:*["notifications:read", "notifications:write"]

No wildcard for billing:manage, feed:write, or oauth:manage — single scopes don't need one.

tests/domain/collective_api_token_test.ts

Add test cases for:

  • New scopes are accepted by TokenScopes.create()
  • New wildcards expand correctly (e.g. lab:* covers lab:read and lab:write)
  • Mixed resource scopes work (e.g. ["extensions:push", "lab:write", "profile:read"])
  • Invalid scopes still rejected (e.g. admin:read, *:*, extensions:delete)

What this does NOT change

  • No enforcement at routes — phase 2
  • No UI changes — phase 3
  • No API changes to token creation
  • No changes to the entity, MongoDB, middleware, or cache — they pass through string[] and don't care about specific values

Verification

  • deno task check passes
  • deno task test passes (excluding pre-existing extension_tarball_analyzer failures)
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

7/18/2026, 12:50:47 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/18/2026, 12:24:49 AM

Sign in to post a ripple.