[MM-15490] Rework default password requirements (#10844)
* Rework default password requirements * Update API Test Lib Default User PW * Remove unused function; Disable password reqs in dev mode * Disable strict password requirements for unit tests * Update unit tests
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
0b6acaa9ba
Коммит
d269891476
@@ -37,6 +37,11 @@ func (tl TokenLocation) String() string {
|
||||
}
|
||||
|
||||
func (a *App) IsPasswordValid(password string) *model.AppError {
|
||||
|
||||
if *a.Config().ServiceSettings.EnableDeveloper {
|
||||
return nil
|
||||
}
|
||||
|
||||
return utils.IsPasswordValidWithSettings(password, &a.Config().PasswordSettings)
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,15 @@ func setupTestHelper(enterprise bool, tb testing.TB) *TestHelper {
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.EnableOpenServer = true })
|
||||
|
||||
// Disable strict password requirements for test
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.PasswordSettings.MinimumLength = 5
|
||||
*cfg.PasswordSettings.Lowercase = false
|
||||
*cfg.PasswordSettings.Uppercase = false
|
||||
*cfg.PasswordSettings.Symbol = false
|
||||
*cfg.PasswordSettings.Number = false
|
||||
})
|
||||
|
||||
if enterprise {
|
||||
th.App.SetLicense(model.NewTestLicense())
|
||||
} else {
|
||||
|
||||
Ссылка в новой задаче
Block a user