Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions core/jobs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,13 @@ func initializeInternalServiceAccounts() {
}

if sa.Scope != authz.SentinelInternalScope {
if err := database.DB.Model(&model.ServiceAccount{}).
Where("id = ?", sa.ID).
Updates(map[string]any{
"scope": authz.SentinelInternalScope,
"signed_token": "",
}).Error; err != nil {
logger.SugarLogger.Errorf("Failed to migrate internal SA %s scope: %v", name, err)
continue
}
sa.Scope = authz.SentinelInternalScope
sa.SignedToken = ""
logger.SugarLogger.Errorf(
"Internal service account %s has scope %q; expected %q",
name,
sa.Scope,
authz.SentinelInternalScope,
)
continue
Comment on lines 251 to +258

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retain the scope migration for skipped releases

When an installation upgrades directly from v5.10.7 or earlier to a release containing this commit, its existing internal service accounts still have the previously seeded sentinel:all scope because it never ran the migration introduced immediately before v5.11.0. This branch now only logs the mismatch; BootstrapToken rejects the account at core/api/bootstrap.go:82-85, and every non-core service treats bootstrap failure as fatal, leaving OAuth, Discord, SAML, and Google in restart loops. Keep the idempotent migration, or otherwise support skipped releases without rotating tokens whose scope is already correct.

Useful? React with 👍 / 👎.

}

if sa.SignedToken == "" {
Expand Down
Loading