mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-24 02:36:44 +00:00
Merge commit from fork
* fix: respect lockout policy on password change (with old password) * add tarpitting * cleanup
This commit is contained in:
@@ -80,6 +80,26 @@ type UserV2WriteModel struct {
|
||||
Metadata map[string][]byte
|
||||
}
|
||||
|
||||
func (wm *UserV2WriteModel) GetUserState() domain.UserState {
|
||||
return wm.UserState
|
||||
}
|
||||
|
||||
func (wm *UserV2WriteModel) GetPasswordCheckFailedCount() uint64 {
|
||||
return wm.PasswordCheckFailedCount
|
||||
}
|
||||
|
||||
func (wm *UserV2WriteModel) GetEncodedHash() string {
|
||||
return wm.PasswordEncodedHash
|
||||
}
|
||||
|
||||
func (wm *UserV2WriteModel) GetResourceOwner() string {
|
||||
return wm.ResourceOwner
|
||||
}
|
||||
|
||||
func (wm *UserV2WriteModel) GetWriteModel() *eventstore.WriteModel {
|
||||
return &wm.WriteModel
|
||||
}
|
||||
|
||||
func NewUserExistsWriteModel(userID, resourceOwner string) *UserV2WriteModel {
|
||||
return newUserV2WriteModel(userID, resourceOwner, WithHuman(), WithMachine())
|
||||
}
|
||||
@@ -292,6 +312,7 @@ func (wm *UserV2WriteModel) Reduce() error {
|
||||
case *user.HumanPasswordChangedEvent:
|
||||
wm.PasswordEncodedHash = crypto.SecretOrEncodedHash(e.Secret, e.EncodedHash)
|
||||
wm.PasswordChangeRequired = e.ChangeRequired
|
||||
wm.PasswordCheckFailedCount = 0
|
||||
wm.EmptyPasswordCode()
|
||||
case *user.HumanPasswordCodeAddedEvent:
|
||||
wm.SetPasswordCode(e)
|
||||
|
||||
Reference in New Issue
Block a user