mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-57085] Remove UseNewSAMLLibrary experimental setting (#26392)
Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
dc3e5b9269
commit
c5cf4101da
@ -59,9 +59,6 @@ context('Okta', () => {
|
|||||||
UsernameAttribute: 'Username',
|
UsernameAttribute: 'Username',
|
||||||
LoginButtonText: loginButtonText,
|
LoginButtonText: loginButtonText,
|
||||||
},
|
},
|
||||||
ExperimentalSettings: {
|
|
||||||
UseNewSAMLLibrary: true,
|
|
||||||
},
|
|
||||||
GuestAccountsSettings: {
|
GuestAccountsSettings: {
|
||||||
Enable: true,
|
Enable: true,
|
||||||
},
|
},
|
||||||
|
@ -55,9 +55,6 @@ context('LDAP SAML - Automated Tests (SAML TESTS)', () => {
|
|||||||
UsernameAttribute: 'Username',
|
UsernameAttribute: 'Username',
|
||||||
LoginButtonText: loginButtonText,
|
LoginButtonText: loginButtonText,
|
||||||
},
|
},
|
||||||
ExperimentalSettings: {
|
|
||||||
UseNewSAMLLibrary: false,
|
|
||||||
},
|
|
||||||
GuestAccountsSettings: {
|
GuestAccountsSettings: {
|
||||||
Enable: true,
|
Enable: true,
|
||||||
},
|
},
|
||||||
|
@ -484,7 +484,6 @@
|
|||||||
"ClientSideCertCheck": "secondary",
|
"ClientSideCertCheck": "secondary",
|
||||||
"LinkMetadataTimeoutMilliseconds": 5000,
|
"LinkMetadataTimeoutMilliseconds": 5000,
|
||||||
"RestrictSystemAdmin": false,
|
"RestrictSystemAdmin": false,
|
||||||
"UseNewSAMLLibrary": false,
|
|
||||||
"EnableSharedChannels": false,
|
"EnableSharedChannels": false,
|
||||||
"EnableRemoteClusterService": false,
|
"EnableRemoteClusterService": false,
|
||||||
"DisableAppBar": false,
|
"DisableAppBar": false,
|
||||||
|
@ -573,7 +573,6 @@ const defaultServerConfig: AdminConfig = {
|
|||||||
ClientSideCertCheck: 'secondary',
|
ClientSideCertCheck: 'secondary',
|
||||||
LinkMetadataTimeoutMilliseconds: 5000,
|
LinkMetadataTimeoutMilliseconds: 5000,
|
||||||
RestrictSystemAdmin: false,
|
RestrictSystemAdmin: false,
|
||||||
UseNewSAMLLibrary: false,
|
|
||||||
EnableSharedChannels: false,
|
EnableSharedChannels: false,
|
||||||
EnableRemoteClusterService: false,
|
EnableRemoteClusterService: false,
|
||||||
DisableAppBar: false,
|
DisableAppBar: false,
|
||||||
|
@ -110,8 +110,8 @@ func NewChannels(s *Server) (*Channels, error) {
|
|||||||
if notificationInterface != nil {
|
if notificationInterface != nil {
|
||||||
ch.Notification = notificationInterface(New(ServerConnector(ch)))
|
ch.Notification = notificationInterface(New(ServerConnector(ch)))
|
||||||
}
|
}
|
||||||
if samlInterfaceNew != nil {
|
if samlInterface != nil {
|
||||||
ch.Saml = samlInterfaceNew(New(ServerConnector(ch)))
|
ch.Saml = samlInterface(New(ServerConnector(ch)))
|
||||||
if err := ch.Saml.ConfigureSP(request.EmptyContext(s.Log())); err != nil {
|
if err := ch.Saml.ConfigureSP(request.EmptyContext(s.Log())); err != nil {
|
||||||
s.Log().Error("An error occurred while configuring SAML Service Provider", mlog.Err(err))
|
s.Log().Error("An error occurred while configuring SAML Service Provider", mlog.Err(err))
|
||||||
}
|
}
|
||||||
|
@ -74,10 +74,10 @@ func RegisterCloudInterface(f func(*Server) einterfaces.CloudInterface) {
|
|||||||
cloudInterface = f
|
cloudInterface = f
|
||||||
}
|
}
|
||||||
|
|
||||||
var samlInterfaceNew func(*App) einterfaces.SamlInterface
|
var samlInterface func(*App) einterfaces.SamlInterface
|
||||||
|
|
||||||
func RegisterNewSamlInterface(f func(*App) einterfaces.SamlInterface) {
|
func RegisterSamlInterface(f func(*App) einterfaces.SamlInterface) {
|
||||||
samlInterfaceNew = f
|
samlInterface = f
|
||||||
}
|
}
|
||||||
|
|
||||||
var notificationInterface func(*App) einterfaces.NotificationInterface
|
var notificationInterface func(*App) einterfaces.NotificationInterface
|
||||||
|
@ -18,37 +18,32 @@ import (
|
|||||||
|
|
||||||
func TestSAMLSettings(t *testing.T) {
|
func TestSAMLSettings(t *testing.T) {
|
||||||
tt := []struct {
|
tt := []struct {
|
||||||
name string
|
name string
|
||||||
setNewInterface bool
|
setInterface bool
|
||||||
useNewSAMLLibrary bool
|
isNil bool
|
||||||
isNil bool
|
metadata string
|
||||||
metadata string
|
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "No SAML Interfaces, default setting",
|
name: "No SAML Interfaces, default setting",
|
||||||
setNewInterface: false,
|
setInterface: false,
|
||||||
useNewSAMLLibrary: false,
|
isNil: true,
|
||||||
isNil: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "No SAML Interfaces, set config true",
|
name: "No SAML Interfaces, set config true",
|
||||||
setNewInterface: false,
|
setInterface: false,
|
||||||
useNewSAMLLibrary: true,
|
isNil: true,
|
||||||
isNil: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Both SAML Interfaces, default setting",
|
name: "Both SAML Interfaces, default setting",
|
||||||
setNewInterface: true,
|
setInterface: true,
|
||||||
useNewSAMLLibrary: false,
|
isNil: false,
|
||||||
isNil: false,
|
metadata: "samlTwo",
|
||||||
metadata: "samlTwo",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Both SAML Interfaces, config true",
|
name: "Both SAML Interfaces, config true",
|
||||||
setNewInterface: true,
|
setInterface: true,
|
||||||
useNewSAMLLibrary: true,
|
isNil: false,
|
||||||
isNil: false,
|
metadata: "samlTwo",
|
||||||
metadata: "samlTwo",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,12 +52,12 @@ func TestSAMLSettings(t *testing.T) {
|
|||||||
saml2 := &mocks.SamlInterface{}
|
saml2 := &mocks.SamlInterface{}
|
||||||
saml2.Mock.On("ConfigureSP", mock.AnythingOfType("*request.Context")).Return(nil)
|
saml2.Mock.On("ConfigureSP", mock.AnythingOfType("*request.Context")).Return(nil)
|
||||||
saml2.Mock.On("GetMetadata", mock.AnythingOfType("*request.Context")).Return("samlTwo", nil)
|
saml2.Mock.On("GetMetadata", mock.AnythingOfType("*request.Context")).Return("samlTwo", nil)
|
||||||
if tc.setNewInterface {
|
if tc.setInterface {
|
||||||
RegisterNewSamlInterface(func(_ *App) einterfaces.SamlInterface {
|
RegisterSamlInterface(func(_ *App) einterfaces.SamlInterface {
|
||||||
return saml2
|
return saml2
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
RegisterNewSamlInterface(nil)
|
RegisterSamlInterface(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
th := SetupEnterpriseWithStoreMock(t)
|
th := SetupEnterpriseWithStoreMock(t)
|
||||||
@ -84,12 +79,6 @@ func TestSAMLSettings(t *testing.T) {
|
|||||||
mockStore.On("Post").Return(&mockPostStore)
|
mockStore.On("Post").Return(&mockPostStore)
|
||||||
mockStore.On("System").Return(&mockSystemStore)
|
mockStore.On("System").Return(&mockSystemStore)
|
||||||
|
|
||||||
if tc.useNewSAMLLibrary {
|
|
||||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
|
||||||
*cfg.ExperimentalSettings.UseNewSAMLLibrary = tc.useNewSAMLLibrary
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.isNil {
|
if tc.isNil {
|
||||||
assert.Nil(t, th.App.Channels().Saml)
|
assert.Nil(t, th.App.Channels().Saml)
|
||||||
} else {
|
} else {
|
||||||
|
@ -775,7 +775,6 @@ func (ts *TelemetryService) trackConfig() {
|
|||||||
"isdefault_client_side_cert_check": isDefault(*cfg.ExperimentalSettings.ClientSideCertCheck, model.ClientSideCertCheckPrimaryAuth),
|
"isdefault_client_side_cert_check": isDefault(*cfg.ExperimentalSettings.ClientSideCertCheck, model.ClientSideCertCheckPrimaryAuth),
|
||||||
"link_metadata_timeout_milliseconds": *cfg.ExperimentalSettings.LinkMetadataTimeoutMilliseconds,
|
"link_metadata_timeout_milliseconds": *cfg.ExperimentalSettings.LinkMetadataTimeoutMilliseconds,
|
||||||
"restrict_system_admin": *cfg.ExperimentalSettings.RestrictSystemAdmin,
|
"restrict_system_admin": *cfg.ExperimentalSettings.RestrictSystemAdmin,
|
||||||
"use_new_saml_library": *cfg.ExperimentalSettings.UseNewSAMLLibrary,
|
|
||||||
"enable_shared_channels": *cfg.ExperimentalSettings.EnableSharedChannels,
|
"enable_shared_channels": *cfg.ExperimentalSettings.EnableSharedChannels,
|
||||||
"enable_remote_cluster_service": *cfg.ExperimentalSettings.EnableRemoteClusterService && cfg.FeatureFlags.EnableRemoteClusterService,
|
"enable_remote_cluster_service": *cfg.ExperimentalSettings.EnableRemoteClusterService && cfg.FeatureFlags.EnableRemoteClusterService,
|
||||||
"enable_app_bar": !*cfg.ExperimentalSettings.DisableAppBar,
|
"enable_app_bar": !*cfg.ExperimentalSettings.DisableAppBar,
|
||||||
|
@ -1009,7 +1009,6 @@ type ExperimentalSettings struct {
|
|||||||
ClientSideCertCheck *string `access:"experimental_features,cloud_restrictable"`
|
ClientSideCertCheck *string `access:"experimental_features,cloud_restrictable"`
|
||||||
LinkMetadataTimeoutMilliseconds *int64 `access:"experimental_features,write_restrictable,cloud_restrictable"`
|
LinkMetadataTimeoutMilliseconds *int64 `access:"experimental_features,write_restrictable,cloud_restrictable"`
|
||||||
RestrictSystemAdmin *bool `access:"experimental_features,write_restrictable"`
|
RestrictSystemAdmin *bool `access:"experimental_features,write_restrictable"`
|
||||||
UseNewSAMLLibrary *bool `access:"experimental_features,cloud_restrictable"`
|
|
||||||
EnableSharedChannels *bool `access:"experimental_features"`
|
EnableSharedChannels *bool `access:"experimental_features"`
|
||||||
EnableRemoteClusterService *bool `access:"experimental_features"`
|
EnableRemoteClusterService *bool `access:"experimental_features"`
|
||||||
DisableAppBar *bool `access:"experimental_features"`
|
DisableAppBar *bool `access:"experimental_features"`
|
||||||
@ -1034,10 +1033,6 @@ func (s *ExperimentalSettings) SetDefaults() {
|
|||||||
s.RestrictSystemAdmin = NewBool(false)
|
s.RestrictSystemAdmin = NewBool(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.UseNewSAMLLibrary == nil {
|
|
||||||
s.UseNewSAMLLibrary = NewBool(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
if s.EnableSharedChannels == nil {
|
if s.EnableSharedChannels == nil {
|
||||||
s.EnableSharedChannels = NewBool(false)
|
s.EnableSharedChannels = NewBool(false)
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,6 @@ export type ExperimentalSettings = {
|
|||||||
ClientSideCertCheck: string;
|
ClientSideCertCheck: string;
|
||||||
LinkMetadataTimeoutMilliseconds: number;
|
LinkMetadataTimeoutMilliseconds: number;
|
||||||
RestrictSystemAdmin: boolean;
|
RestrictSystemAdmin: boolean;
|
||||||
UseNewSAMLLibrary: boolean;
|
|
||||||
EnableSharedChannels: boolean;
|
EnableSharedChannels: boolean;
|
||||||
EnableRemoteClusterService: boolean;
|
EnableRemoteClusterService: boolean;
|
||||||
DisableAppBar: boolean;
|
DisableAppBar: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user