MM-40818: Refactor product initialization to happen late (#19658)
This is more of a general refactor of the initialization process which should allow us to pass services more easily. The changes are minimal to keep the scope limited. For now, the objective is to pass the file service to the Channels product. For that, it was required to move some of the enterprise interfaces under Channels from Server. We also create a filestore field in the server to avoid creating filestore reference every time we make a filestore operation. This will be later passed on to the Channels product. Also removed an unnecessary test. The test was working so far because we were creating the filebackend every time for every request. But we should go via UpdateConfig call which would fail, were we to assign an invalid filestore name. So we were actually testing for a different thing. Therefore, removed the test. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
768fe43d3a
Коммит
ab8de49f0a
@@ -75,6 +75,9 @@ type Channels struct {
|
||||
Compliance einterfaces.ComplianceInterface
|
||||
DataRetention einterfaces.DataRetentionInterface
|
||||
MessageExport einterfaces.MessageExportInterface
|
||||
Saml einterfaces.SamlInterface
|
||||
Notification einterfaces.NotificationInterface
|
||||
Ldap einterfaces.LdapInterface
|
||||
|
||||
// These are used to prevent concurrent upload requests
|
||||
// for a given upload session which could cause inconsistencies
|
||||
@@ -145,6 +148,24 @@ func NewChannels(s *Server, services map[ServiceKey]interface{}) (*Channels, err
|
||||
if accountMigrationInterface != nil {
|
||||
ch.AccountMigration = accountMigrationInterface(New(ServerConnector(ch)))
|
||||
}
|
||||
if ldapInterface != nil {
|
||||
ch.Ldap = ldapInterface(New(ServerConnector(ch)))
|
||||
}
|
||||
if notificationInterface != nil {
|
||||
ch.Notification = notificationInterface(New(ServerConnector(ch)))
|
||||
}
|
||||
if samlInterfaceNew != nil {
|
||||
ch.Saml = samlInterfaceNew(New(ServerConnector(ch)))
|
||||
if err := ch.Saml.ConfigureSP(); err != nil {
|
||||
mlog.Error("An error occurred while configuring SAML Service Provider", mlog.Err(err))
|
||||
}
|
||||
|
||||
ch.AddConfigListener(func(_, _ *model.Config) {
|
||||
if err := ch.Saml.ConfigureSP(); err != nil {
|
||||
mlog.Error("An error occurred while configuring SAML Service Provider", mlog.Err(err))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var imgErr error
|
||||
ch.imgDecoder, imgErr = imaging.NewDecoder(imaging.DecoderOptions{
|
||||
|
||||
Ссылка в новой задаче
Block a user