test(32.2-05): unit tests for administrator MCP grants, admin consent, account items and access revocation

- wristband: TestAuthorizeConsentPath, TestAuthorizeDefaultScopes
- pier: TestBackendOnlyGrant, TestLinkedGrantNoScopeLimit (Docker)
- cabana: TestTokenScopeNames, TestMCPAdminConsent, TestAccountContributionItems,
  TestBackendAccessRevokedEvent (Docker); export_test.go exposes the event
  helper for the de-duplication case
This commit is contained in:
Jakub Zych
2026-11-21 02:00:16 +01:00
parent d450a6819e
commit 7ecfa6087d
7 changed files with 1675 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import (
"strings"
"time"
"git.golem15.com/golem15/summercms/modules/backpack"
"git.golem15.com/golem15/summercms/modules/pact"
"git.golem15.com/golem15/summercms/modules/party"
"git.golem15.com/golem15/summercms/modules/phrasebook"
@@ -129,3 +130,10 @@ func LineDiffForTest(a, b []string, context int) string {
}
return strings.Join(out, "|")
}
// FireBackendAccessRevokedForTest is fireBackendAccessRevoked, the helper
// every D-13 site fires BackendAccessRevokedEvent through: it de-duplicates
// and drops zero ids, and fires nothing when no id is left.
func FireBackendAccessRevokedForTest(ctx context.Context, app *backpack.App, tx *gorm.DB, reason string, adminIDs ...uint) error {
return fireBackendAccessRevoked(ctx, app, tx, reason, adminIDs...)
}