MM-25762 - Moved password settings to client limited configuration (#14777)
* Moved password settings to limited configuration * Added unit test Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8dc7c5762f
Коммит
085ab2c60a
@@ -114,11 +114,6 @@ func GenerateClientConfig(c *model.Config, diagnosticID string, license *model.L
|
|||||||
props["SamlPositionAttributeSet"] = "false"
|
props["SamlPositionAttributeSet"] = "false"
|
||||||
props["EnableCluster"] = "false"
|
props["EnableCluster"] = "false"
|
||||||
props["EnableMetrics"] = "false"
|
props["EnableMetrics"] = "false"
|
||||||
props["PasswordMinimumLength"] = "0"
|
|
||||||
props["PasswordRequireLowercase"] = "false"
|
|
||||||
props["PasswordRequireUppercase"] = "false"
|
|
||||||
props["PasswordRequireNumber"] = "false"
|
|
||||||
props["PasswordRequireSymbol"] = "false"
|
|
||||||
props["EnableBanner"] = "false"
|
props["EnableBanner"] = "false"
|
||||||
props["BannerText"] = ""
|
props["BannerText"] = ""
|
||||||
props["BannerColor"] = ""
|
props["BannerColor"] = ""
|
||||||
@@ -132,11 +127,6 @@ func GenerateClientConfig(c *model.Config, diagnosticID string, license *model.L
|
|||||||
props["DataRetentionMessageRetentionDays"] = "0"
|
props["DataRetentionMessageRetentionDays"] = "0"
|
||||||
props["DataRetentionEnableFileDeletion"] = "false"
|
props["DataRetentionEnableFileDeletion"] = "false"
|
||||||
props["DataRetentionFileRetentionDays"] = "0"
|
props["DataRetentionFileRetentionDays"] = "0"
|
||||||
props["PasswordMinimumLength"] = fmt.Sprintf("%v", *c.PasswordSettings.MinimumLength)
|
|
||||||
props["PasswordRequireLowercase"] = strconv.FormatBool(*c.PasswordSettings.Lowercase)
|
|
||||||
props["PasswordRequireUppercase"] = strconv.FormatBool(*c.PasswordSettings.Uppercase)
|
|
||||||
props["PasswordRequireNumber"] = strconv.FormatBool(*c.PasswordSettings.Number)
|
|
||||||
props["PasswordRequireSymbol"] = strconv.FormatBool(*c.PasswordSettings.Symbol)
|
|
||||||
props["CustomUrlSchemes"] = strings.Join(c.DisplaySettings.CustomUrlSchemes, ",")
|
props["CustomUrlSchemes"] = strings.Join(c.DisplaySettings.CustomUrlSchemes, ",")
|
||||||
props["IsDefaultMarketplace"] = strconv.FormatBool(*c.PluginSettings.MarketplaceUrl == model.PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL)
|
props["IsDefaultMarketplace"] = strconv.FormatBool(*c.PluginSettings.MarketplaceUrl == model.PLUGIN_SETTINGS_DEFAULT_MARKETPLACE_URL)
|
||||||
|
|
||||||
@@ -264,6 +254,12 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticID string, license *
|
|||||||
|
|
||||||
props["PluginsEnabled"] = strconv.FormatBool(*c.PluginSettings.Enable)
|
props["PluginsEnabled"] = strconv.FormatBool(*c.PluginSettings.Enable)
|
||||||
|
|
||||||
|
props["PasswordMinimumLength"] = fmt.Sprintf("%v", *c.PasswordSettings.MinimumLength)
|
||||||
|
props["PasswordRequireLowercase"] = strconv.FormatBool(*c.PasswordSettings.Lowercase)
|
||||||
|
props["PasswordRequireUppercase"] = strconv.FormatBool(*c.PasswordSettings.Uppercase)
|
||||||
|
props["PasswordRequireNumber"] = strconv.FormatBool(*c.PasswordSettings.Number)
|
||||||
|
props["PasswordRequireSymbol"] = strconv.FormatBool(*c.PasswordSettings.Symbol)
|
||||||
|
|
||||||
// Set default values for all options that require a license.
|
// Set default values for all options that require a license.
|
||||||
props["EnableCustomBrand"] = "false"
|
props["EnableCustomBrand"] = "false"
|
||||||
props["CustomBrandText"] = ""
|
props["CustomBrandText"] = ""
|
||||||
|
|||||||
@@ -236,6 +236,27 @@ func TestGetLimitedClientConfig(t *testing.T) {
|
|||||||
"WebsocketSecurePort": "443",
|
"WebsocketSecurePort": "443",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"password settings",
|
||||||
|
&model.Config{
|
||||||
|
PasswordSettings: model.PasswordSettings{
|
||||||
|
MinimumLength: iToP(15),
|
||||||
|
Lowercase: bToP(true),
|
||||||
|
Uppercase: bToP(true),
|
||||||
|
Number: bToP(true),
|
||||||
|
Symbol: bToP(false),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
nil,
|
||||||
|
map[string]string{
|
||||||
|
"PasswordMinimumLength": "15",
|
||||||
|
"PasswordRequireLowercase": "true",
|
||||||
|
"PasswordRequireUppercase": "true",
|
||||||
|
"PasswordRequireNumber": "true",
|
||||||
|
"PasswordRequireSymbol": "false",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user