einterfaces: simply saml.ConfigureSP error handling (#10306)

Этот коммит содержится в:
Jesse Hallam
2019-02-21 13:51:25 -04:00
коммит произвёл Miguel Alatzar
родитель 659af08ee4
Коммит 7150b9aada
3 изменённых файлов: 5 добавлений и 6 удалений

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

@@ -7,6 +7,7 @@ import (
"github.com/mattermost/mattermost-server/einterfaces" "github.com/mattermost/mattermost-server/einterfaces"
ejobs "github.com/mattermost/mattermost-server/einterfaces/jobs" ejobs "github.com/mattermost/mattermost-server/einterfaces/jobs"
tjobs "github.com/mattermost/mattermost-server/jobs/interfaces" tjobs "github.com/mattermost/mattermost-server/jobs/interfaces"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/model"
) )
@@ -128,7 +129,9 @@ func (s *Server) initEnterprise() {
if samlInterface != nil { if samlInterface != nil {
s.Saml = samlInterface(s.FakeApp()) s.Saml = samlInterface(s.FakeApp())
s.AddConfigListener(func(_, cfg *model.Config) { s.AddConfigListener(func(_, cfg *model.Config) {
s.Saml.ConfigureSP() if err := s.Saml.ConfigureSP(); err != nil {
mlog.Error("An error occurred while configuring SAML Service Provider", mlog.Err(err))
}
}) })
} }
if dataRetentionInterface != nil { if dataRetentionInterface != nil {

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

@@ -8,7 +8,7 @@ import (
) )
type SamlInterface interface { type SamlInterface interface {
ConfigureSP() *model.AppError ConfigureSP() error
BuildRequest(relayState string) (*model.SamlAuthRequest, *model.AppError) BuildRequest(relayState string) (*model.SamlAuthRequest, *model.AppError)
DoLogin(encodedXML string, relayState map[string]string) (*model.User, *model.AppError) DoLogin(encodedXML string, relayState map[string]string) (*model.User, *model.AppError)
GetMetadata() (string, *model.AppError) GetMetadata() (string, *model.AppError)

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

@@ -3654,10 +3654,6 @@
"id": "ent.saml.build_request.encoding.app_error", "id": "ent.saml.build_request.encoding.app_error",
"translation": "An error occurred while encoding the request for the Identity Provider. Please contact your System Administrator." "translation": "An error occurred while encoding the request for the Identity Provider. Please contact your System Administrator."
}, },
{
"id": "ent.saml.configure.app_error",
"translation": "An error occurred while configuring SAML Service Provider, err=%v"
},
{ {
"id": "ent.saml.configure.encryption_not_enabled.app_error", "id": "ent.saml.configure.encryption_not_enabled.app_error",
"translation": "SAML login was unsuccessful because encryption is not enabled. Please contact your System Administrator." "translation": "SAML login was unsuccessful because encryption is not enabled. Please contact your System Administrator."