feat(auth): require changing default admin password (#778)

This commit is contained in:
h44z
2026-11-09 19:57:23 +01:00
committed by GitHub
parent 137286d46b
commit 276f120b60
30 changed files with 641 additions and 90 deletions
+7
View File
@@ -31,6 +31,8 @@ type UserManager interface {
RegisterUser(ctx context.Context, user *domain.User) error
// UpdateUserInternal updates an existing user in the database.
UpdateUserInternal(ctx context.Context, user *domain.User) (*domain.User, error)
// IsDefaultPasswordInUse checks if the default admin password is still in use.
IsDefaultPasswordInUse(ctx context.Context) bool
}
type EventBus interface {
@@ -135,6 +137,11 @@ func NewAuthenticator(cfg *config.Auth, extUrl, basePath string, bus EventBus, u
return a, nil
}
// IsDefaultPasswordInUse checks if the default admin password is still in use.
func (a *Authenticator) IsDefaultPasswordInUse(ctx context.Context) bool {
return a.users.IsDefaultPasswordInUse(ctx)
}
// StartBackgroundJobs starts the background jobs for the authenticator.
// It sets up the external authentication providers (OIDC, OAuth, LDAP) and retries in case of errors.
func (a *Authenticator) StartBackgroundJobs(ctx context.Context) {