Plugin groups (#30320)
* add new pluginapi methods * SAML login hook * set ReAddRemovedMembers to true for plugin groups * change to DoLogin signature for SAML
Этот коммит содержится в:
@@ -8,6 +8,8 @@ import (
|
||||
model "github.com/mattermost/mattermost/server/public/model"
|
||||
request "github.com/mattermost/mattermost/server/public/shared/request"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
saml2 "github.com/mattermost/gosaml2"
|
||||
)
|
||||
|
||||
// SamlInterface is an autogenerated mock type for the SamlInterface type
|
||||
@@ -84,7 +86,7 @@ func (_m *SamlInterface) ConfigureSP(c request.CTX) error {
|
||||
}
|
||||
|
||||
// DoLogin provides a mock function with given fields: c, encodedXML, relayState
|
||||
func (_m *SamlInterface) DoLogin(c request.CTX, encodedXML string, relayState map[string]string) (*model.User, *model.AppError) {
|
||||
func (_m *SamlInterface) DoLogin(c request.CTX, encodedXML string, relayState map[string]string) (*model.User, *saml2.AssertionInfo, *model.AppError) {
|
||||
ret := _m.Called(c, encodedXML, relayState)
|
||||
|
||||
if len(ret) == 0 {
|
||||
@@ -92,8 +94,9 @@ func (_m *SamlInterface) DoLogin(c request.CTX, encodedXML string, relayState ma
|
||||
}
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) (*model.User, *model.AppError)); ok {
|
||||
var r1 *saml2.AssertionInfo
|
||||
var r2 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) (*model.User, *saml2.AssertionInfo, *model.AppError)); ok {
|
||||
return rf(c, encodedXML, relayState)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) *model.User); ok {
|
||||
@@ -104,15 +107,23 @@ func (_m *SamlInterface) DoLogin(c request.CTX, encodedXML string, relayState ma
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, map[string]string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, map[string]string) *saml2.AssertionInfo); ok {
|
||||
r1 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
r1 = ret.Get(1).(*saml2.AssertionInfo)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
if rf, ok := ret.Get(2).(func(request.CTX, string, map[string]string) *model.AppError); ok {
|
||||
r2 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(2) != nil {
|
||||
r2 = ret.Get(2).(*model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GetMetadata provides a mock function with given fields: c
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
package einterfaces
|
||||
|
||||
import (
|
||||
saml2 "github.com/mattermost/gosaml2"
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
"github.com/mattermost/mattermost/server/public/shared/request"
|
||||
)
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
type SamlInterface interface {
|
||||
ConfigureSP(c request.CTX) error
|
||||
BuildRequest(c request.CTX, relayState string) (*model.SamlAuthRequest, *model.AppError)
|
||||
DoLogin(c request.CTX, encodedXML string, relayState map[string]string) (*model.User, *model.AppError)
|
||||
DoLogin(c request.CTX, encodedXML string, relayState map[string]string) (*model.User, *saml2.AssertionInfo, *model.AppError)
|
||||
GetMetadata(c request.CTX) (string, *model.AppError)
|
||||
CheckProviderAttributes(c request.CTX, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user