From 7150b9aada568f5fd9f674c27beaa5890bb53183 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Thu, 21 Feb 2019 13:51:25 -0400 Subject: [PATCH] einterfaces: simply saml.ConfigureSP error handling (#10306) --- app/enterprise.go | 5 ++++- einterfaces/saml.go | 2 +- i18n/en.json | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/enterprise.go b/app/enterprise.go index a0bfb8cd29..f7459c9551 100644 --- a/app/enterprise.go +++ b/app/enterprise.go @@ -7,6 +7,7 @@ import ( "github.com/mattermost/mattermost-server/einterfaces" ejobs "github.com/mattermost/mattermost-server/einterfaces/jobs" tjobs "github.com/mattermost/mattermost-server/jobs/interfaces" + "github.com/mattermost/mattermost-server/mlog" "github.com/mattermost/mattermost-server/model" ) @@ -128,7 +129,9 @@ func (s *Server) initEnterprise() { if samlInterface != nil { s.Saml = samlInterface(s.FakeApp()) 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 { diff --git a/einterfaces/saml.go b/einterfaces/saml.go index 833a3d43fc..b94726a617 100644 --- a/einterfaces/saml.go +++ b/einterfaces/saml.go @@ -8,7 +8,7 @@ import ( ) type SamlInterface interface { - ConfigureSP() *model.AppError + ConfigureSP() error BuildRequest(relayState string) (*model.SamlAuthRequest, *model.AppError) DoLogin(encodedXML string, relayState map[string]string) (*model.User, *model.AppError) GetMetadata() (string, *model.AppError) diff --git a/i18n/en.json b/i18n/en.json index 415de58ab0..e0e2b4d501 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -3654,10 +3654,6 @@ "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." }, - { - "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", "translation": "SAML login was unsuccessful because encryption is not enabled. Please contact your System Administrator."