Revert "MM-41211: Adds ability to set SessionLengthSSOInDays to a decimal. (#19396)" (#19563)

This reverts commit 7398451030.
Этот коммит содержится в:
mkraft
2022-02-15 12:50:56 -05:00
коммит произвёл GitHub
родитель 431a5fce59
Коммит 627dd650d6
15 изменённых файлов: 54 добавлений и 76 удалений

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

@@ -320,7 +320,7 @@ type ServiceSettings struct {
ExtendSessionLengthWithActivity *bool `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionLengthWebInDays *int `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionLengthMobileInDays *int `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionLengthSSOInDays *float32 `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionLengthSSOInDays *int `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionCacheInMinutes *int `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
SessionIdleTimeoutInMinutes *int `access:"environment_session_lengths,write_restrictable,cloud_restrictable"`
WebsocketSecurePort *int `access:"write_restrictable,cloud_restrictable"` // telemetry: none
@@ -368,18 +368,6 @@ type ServiceSettings struct {
ManagedResourcePaths *string `access:"environment_web_server,write_restrictable,cloud_restrictable"`
}
func (s *ServiceSettings) SessionLengthWebInHours() *int {
return NewInt(*s.SessionLengthWebInDays * 24)
}
func (s *ServiceSettings) SessionLengthMobileInHours() *int {
return NewInt(*s.SessionLengthMobileInDays * 24)
}
func (s *ServiceSettings) SessionLengthSSOInHours() *int {
return NewInt(int(*s.SessionLengthSSOInDays * 24))
}
func (s *ServiceSettings) SetDefaults(isUpdate bool) {
if s.EnableEmailInvitations == nil {
// If the site URL is also not present then assume this is a clean install
@@ -610,7 +598,7 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
}
if s.SessionLengthSSOInDays == nil {
s.SessionLengthSSOInDays = NewFloat32(30)
s.SessionLengthSSOInDays = NewInt(30)
}
if s.SessionCacheInMinutes == nil {
@@ -3596,10 +3584,6 @@ func (s *ServiceSettings) isValid() *AppError {
return NewAppError("Config.IsValid", "model.config.is_valid.collapsed_threads.app_error", nil, "", http.StatusBadRequest)
}
if *s.SessionLengthSSOInHours() < 1 {
return NewAppError("Config.IsValid", "model.config.is_valid.session_length_sso_in_days.app_error", nil, "", http.StatusBadRequest)
}
return nil
}