feat: add licensing API token scope #698

Merged
jmiller merged 1 commits from feature/api-token-scopes into main 2026-06-25 14:37:50 +00:00
Owner

Summary

  • Add read:licensing / write:licensing API token scope category
  • Licensing endpoints now require the licensing scope when accessed via token
  • Public-only tokens are rejected for all licensing endpoints
  • Existing tokens with all scope continue to work (backward compatible)

Closes #697

Changes

  • models/auth/access_token_scope.go: New AccessTokenScopeCategoryLicensing enum, bit constants, string constants, and all scope maps
  • models/auth/access_token_scope_test.go: Updated test expectations for new scope
  • routers/api/v1/api.go: Wrapped /licensing group with tokenRequiresScopes(), added public-only rejection

Test plan

  • Token creation UI shows "licensing" scope with read/write options
  • Token with read:licensing can GET licensing endpoints
  • Token with write:licensing can POST/PATCH/DELETE licensing endpoints
  • Token without licensing scope gets 403 on licensing endpoints
  • Token with all scope can access licensing endpoints
  • Public-only token gets 403 on licensing endpoints
  • Existing tokens with broad access are unaffected
## Summary - Add `read:licensing` / `write:licensing` API token scope category - Licensing endpoints now require the licensing scope when accessed via token - Public-only tokens are rejected for all licensing endpoints - Existing tokens with `all` scope continue to work (backward compatible) Closes #697 ## Changes - `models/auth/access_token_scope.go`: New `AccessTokenScopeCategoryLicensing` enum, bit constants, string constants, and all scope maps - `models/auth/access_token_scope_test.go`: Updated test expectations for new scope - `routers/api/v1/api.go`: Wrapped `/licensing` group with `tokenRequiresScopes()`, added public-only rejection ## Test plan - [ ] Token creation UI shows "licensing" scope with read/write options - [ ] Token with `read:licensing` can GET licensing endpoints - [ ] Token with `write:licensing` can POST/PATCH/DELETE licensing endpoints - [ ] Token without licensing scope gets 403 on licensing endpoints - [ ] Token with `all` scope can access licensing endpoints - [ ] Public-only token gets 403 on licensing endpoints - [ ] Existing tokens with broad access are unaffected
jmiller changed target branch from dev to main 2026-06-25 14:27:51 +00:00
jmiller added 1 commit 2026-06-25 14:27:51 +00:00
feat: add licensing API token scope (#697)
Universal: Auto Version Bump / Version Bump (push) Successful in 17s
PR RC Release / Build RC Release (pull_request) Successful in 3s
Universal: PR Check / Branch Policy (pull_request) Failing after 2s
Universal: PR Check / Validate PR (pull_request) Failing after 11s
Universal: PR Check / Secret Scan (pull_request) Successful in 43s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 3s
Universal: Build & Release / Build & Release Pipeline (pull_request) Failing after 1m13s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Failing after 4m6s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
49f6380fa4
Add read:licensing / write:licensing token scope category so licensing
endpoints are guarded by the same permission system as all other API
endpoints. Public-only tokens are rejected for licensing endpoints.
jmiller merged commit 3eb0dfd011 into main 2026-06-25 14:37:50 +00:00
jmiller deleted branch feature/api-token-scopes 2026-06-25 14:37:53 +00:00
Sign in to join this conversation.