feat(session): Password Check API with relation tables (#11804)

# Which Problems Are Solved

As part of #11035 , this PR implements the password check logic for
session validation

# How the Problems Are Solved

- Add system config to default configuration of `domain` package for
easy initialization. Intialize the system settings when Zitadel starts
up
- Add password hasher verify logic to the default configuration of
`domain` package. Initialize it when Zitadel starts up.
  - Add settings repositories with their mocks
  - Implement the logic for doing a password check

# Additional Context

This is a cherry-picked PR + minor changes, coming from
https://github.com/zitadel/zitadel/pull/11164
- Relates to #11035
- Depends on https://github.com/zitadel/zitadel/pull/11777
This commit is contained in:
Marco A.
2026-03-13 11:40:48 +01:00
committed by GitHub
parent d08779e279
commit 3c3201e5a0
26 changed files with 12932 additions and 2 deletions
+10
View File
@@ -162,6 +162,7 @@ type LoginSettingsAttributes struct {
SecondFactorTypes []SecondFactorType `json:"secondFactors,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/login_settings.mock.go . LoginSettingsRepository
type LoginSettingsRepository interface {
settingsRepository[LoginSettings]
loginSettingsJSONChanges
@@ -228,6 +229,7 @@ type BrandingSettingsAttributes struct {
FontURL *url.URL `json:"fontUrl,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/branding_settings.mock.go . BrandingSettingsRepository
type BrandingSettingsRepository interface {
settingsRepository[BrandingSettings]
brandingSettingsJSONChanges
@@ -261,6 +263,7 @@ type PasswordComplexitySettingsAttributes struct {
HasSymbol *bool `json:"hasSymbol,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/password_complexity_settings.mock.go . PasswordComplexitySettingsRepository
type PasswordComplexitySettingsRepository interface {
settingsRepository[PasswordComplexitySettings]
passwordComplexitySettingsJSONChanges
@@ -283,6 +286,7 @@ type PasswordExpirySettingsAttributes struct {
MaxAgeDays *uint64 `json:"maxAgeDays,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/password_expiry_settings.mock.go . PasswordExpirySettingsRepository
type PasswordExpirySettingsRepository interface {
settingsRepository[PasswordExpirySettings]
passwordExpirySettingsJSONChanges
@@ -307,6 +311,7 @@ type LockoutSettingsAttributes struct {
ShowLockOutFailures *bool `json:"showLockOutFailures,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/lockout_settings.mock.go . LockoutSettingsRepository
type LockoutSettingsRepository interface {
settingsRepository[LockoutSettings]
lockoutSettingsJSONChanges
@@ -331,6 +336,7 @@ type SecuritySettingsAttributes struct {
EnableImpersonation *bool `json:"enableImpersonation,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/security_settings.mock.go . SecuritySettingsRepository
type SecuritySettingsRepository interface {
settingsRepository[SecuritySettings]
securitySettingsJSONChanges
@@ -354,6 +360,7 @@ type DomainSettingsAttributes struct {
SMTPSenderAddressMatchesInstanceDomain *bool `json:"smtpSenderAddressMatchesInstanceDomain,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/domain_settings.mock.go . DomainSettingsRepository
type DomainSettingsRepository interface {
settingsRepository[DomainSettings]
domainSettingsJSONChanges
@@ -373,6 +380,7 @@ type OrganizationSettingsAttributes struct {
OrganizationScopedUsernames *bool `json:"organizationScopedUsernames,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/organization_settings.mock.go . OrganizationSettingsRepository
type OrganizationSettingsRepository interface {
settingsRepository[OrganizationSettings]
organizationSettingsJSONChanges
@@ -393,6 +401,7 @@ type NotificationSettingsAttributes struct {
PasswordChange *bool `json:"passwordChange,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/notification_settings.mock.go . NotificationSettingsRepository
type NotificationSettingsRepository interface {
settingsRepository[NotificationSettings]
notificationSettingsJSONChanges
@@ -425,6 +434,7 @@ type LegalAndSupportSettingsAttributes struct {
CustomLinkText *string `json:"customLinkText,omitempty"`
}
//go:generate mockgen -typed -package domainmock -destination ./mock/legal_and_support_settings.mock.go . LegalAndSupportSettingsRepository
type LegalAndSupportSettingsRepository interface {
settingsRepository[LegalAndSupportSettings]
legalAndSupportSettingsJSONChanges