MM-13725 Fix client config overriding MFA enforcement set in limited config (#10095)
* Fix client config overriding MFA enforcement set in limited config * Add unit test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
bbee234af0
Коммит
8e9df61934
@@ -505,7 +505,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L
|
|||||||
props["LdapNicknameAttributeSet"] = "false"
|
props["LdapNicknameAttributeSet"] = "false"
|
||||||
props["LdapFirstNameAttributeSet"] = "false"
|
props["LdapFirstNameAttributeSet"] = "false"
|
||||||
props["LdapLastNameAttributeSet"] = "false"
|
props["LdapLastNameAttributeSet"] = "false"
|
||||||
props["EnforceMultifactorAuthentication"] = "false"
|
|
||||||
props["EnableCompliance"] = "false"
|
props["EnableCompliance"] = "false"
|
||||||
props["EnableMobileFileDownload"] = "true"
|
props["EnableMobileFileDownload"] = "true"
|
||||||
props["EnableMobileFileUpload"] = "true"
|
props["EnableMobileFileUpload"] = "true"
|
||||||
@@ -675,6 +674,7 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license *
|
|||||||
props["CustomBrandText"] = *c.TeamSettings.CustomBrandText
|
props["CustomBrandText"] = *c.TeamSettings.CustomBrandText
|
||||||
props["CustomDescriptionText"] = *c.TeamSettings.CustomDescriptionText
|
props["CustomDescriptionText"] = *c.TeamSettings.CustomDescriptionText
|
||||||
props["EnableMultifactorAuthentication"] = strconv.FormatBool(*c.ServiceSettings.EnableMultifactorAuthentication)
|
props["EnableMultifactorAuthentication"] = strconv.FormatBool(*c.ServiceSettings.EnableMultifactorAuthentication)
|
||||||
|
props["EnforceMultifactorAuthentication"] = "false"
|
||||||
|
|
||||||
if license != nil {
|
if license != nil {
|
||||||
if *license.Features.LDAP {
|
if *license.Features.LDAP {
|
||||||
|
|||||||
@@ -487,9 +487,10 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
"",
|
"",
|
||||||
nil,
|
nil,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"DiagnosticId": "",
|
"DiagnosticId": "",
|
||||||
"EmailNotificationContentsType": "full",
|
"EmailNotificationContentsType": "full",
|
||||||
"AllowCustomThemes": "true",
|
"AllowCustomThemes": "true",
|
||||||
|
"EnforceMultifactorAuthentication": "false",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -537,6 +538,23 @@ func TestGetClientConfig(t *testing.T) {
|
|||||||
"AllowCustomThemes": "false",
|
"AllowCustomThemes": "false",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"licensed for enforcement",
|
||||||
|
&model.Config{
|
||||||
|
ServiceSettings: model.ServiceSettings{
|
||||||
|
EnforceMultifactorAuthentication: bToP(true),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"tag1",
|
||||||
|
&model.License{
|
||||||
|
Features: &model.Features{
|
||||||
|
MFA: bToP(true),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
map[string]string{
|
||||||
|
"EnforceMultifactorAuthentication": "true",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, testCase := range testCases {
|
for _, testCase := range testCases {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user