Add config settings for additional security features on mobile (#30411)

Этот коммит содержится в:
Elias Nahum
2025-03-13 19:39:19 +08:00
коммит произвёл GitHub
родитель 84fa496c69
Коммит 3af8d50bbe
2 изменённых файлов: 32 добавлений и 5 удалений

Просмотреть файл

@@ -227,6 +227,12 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
props["PostAcknowledgements"] = "true" props["PostAcknowledgements"] = "true"
props["ScheduledPosts"] = strconv.FormatBool(*c.ServiceSettings.ScheduledPosts) props["ScheduledPosts"] = strconv.FormatBool(*c.ServiceSettings.ScheduledPosts)
} }
if license.SkuShortName == model.LicenseShortSkuEnterprise {
props["MobileEnableBiometrics"] = strconv.FormatBool(*c.NativeAppSettings.MobileEnableBiometrics)
props["MobilePreventScreenCapture"] = strconv.FormatBool(*c.NativeAppSettings.MobilePreventScreenCapture)
props["MobileJailbreakProtection"] = strconv.FormatBool(*c.NativeAppSettings.MobileJailbreakProtection)
}
} }
return props return props
@@ -388,6 +394,12 @@ func GenerateLimitedClientConfig(c *model.Config, telemetryID string, license *m
props["OpenIdButtonColor"] = *c.OpenIdSettings.ButtonColor props["OpenIdButtonColor"] = *c.OpenIdSettings.ButtonColor
props["OpenIdButtonText"] = *c.OpenIdSettings.ButtonText props["OpenIdButtonText"] = *c.OpenIdSettings.ButtonText
} }
if license.SkuShortName == model.LicenseShortSkuEnterprise {
props["MobileEnableBiometrics"] = strconv.FormatBool(*c.NativeAppSettings.MobileEnableBiometrics)
props["MobilePreventScreenCapture"] = strconv.FormatBool(*c.NativeAppSettings.MobilePreventScreenCapture)
props["MobileJailbreakProtection"] = strconv.FormatBool(*c.NativeAppSettings.MobileJailbreakProtection)
}
} }
for key, value := range c.FeatureFlags.ToMap() { for key, value := range c.FeatureFlags.ToMap() {

Просмотреть файл

@@ -2849,11 +2849,14 @@ func (s *SamlSettings) SetDefaults() {
} }
type NativeAppSettings struct { type NativeAppSettings struct {
AppCustomURLSchemes []string `access:"site_customization,write_restrictable,cloud_restrictable"` // telemetry: none AppCustomURLSchemes []string `access:"site_customization,write_restrictable,cloud_restrictable"` // telemetry: none
AppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"` AppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"`
AndroidAppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"` AndroidAppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"`
IosAppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"` IosAppDownloadLink *string `access:"site_customization,write_restrictable,cloud_restrictable"`
MobileExternalBrowser *bool `access:"site_customization,write_restrictable,cloud_restrictable"` MobileExternalBrowser *bool `access:"site_customization,write_restrictable,cloud_restrictable"`
MobileEnableBiometrics *bool `access:"site_customization,write_restrictable"`
MobilePreventScreenCapture *bool `access:"site_customization,write_restrictable"`
MobileJailbreakProtection *bool `access:"site_customization,write_restrictable"`
} }
func (s *NativeAppSettings) SetDefaults() { func (s *NativeAppSettings) SetDefaults() {
@@ -2876,6 +2879,18 @@ func (s *NativeAppSettings) SetDefaults() {
if s.MobileExternalBrowser == nil { if s.MobileExternalBrowser == nil {
s.MobileExternalBrowser = NewPointer(false) s.MobileExternalBrowser = NewPointer(false)
} }
if s.MobileEnableBiometrics == nil {
s.MobileEnableBiometrics = NewPointer(false)
}
if s.MobilePreventScreenCapture == nil {
s.MobilePreventScreenCapture = NewPointer(false)
}
if s.MobileJailbreakProtection == nil {
s.MobileJailbreakProtection = NewPointer(false)
}
} }
type ElasticsearchSettings struct { type ElasticsearchSettings struct {