feat(16.3-01): tracer — g15_ token scopes through composite backend guard

- Add pact.TokenScope/HasTokenScopes and bouncer.ScopeLimit on Principal
- Append backend_api_tokens migration; Allows evaluates scope before superuser
- Composite guard routes Bearer g15_… to token lookup; smoke tests cover path

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-11 01:46:32 +02:00
parent 4d107f4ccb
commit b9273c1da7
12 changed files with 1190 additions and 13 deletions

View File

@@ -505,6 +505,21 @@ type HasPermissions interface {
Permissions() []Permission
}
// TokenScope is one personal API token scope a plugin registers at boot.
// Label and Description are phrase keys (containing "::") or literal text.
type TokenScope struct {
Name string
Label string
Description string
Permissions []string
Methods []string
}
// HasTokenScopes is implemented by plugins that declare personal API token scopes.
type HasTokenScopes interface {
TokenScopes() []TokenScope
}
// NavigationItem is one registerNavigation() entry. Controller is the admin
// controller ID; the SPA derives its route from that ID.
type NavigationItem struct {