Use request.CTX instead of *request.Context (#24877)
* Use request.CTX instead of *request.Context * Fix tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
37dc35c1a1
Коммит
c7461751f2
@@ -9,6 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type AccountMigrationInterface interface {
|
||||
MigrateToLdap(c *request.Context, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToSaml(c *request.Context, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||
MigrateToLdap(c request.CTX, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||
MigrateToSaml(c request.CTX, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||
}
|
||||
|
||||
@@ -13,5 +13,5 @@ import (
|
||||
type Scheduler interface {
|
||||
Enabled(cfg *model.Config) bool
|
||||
NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time
|
||||
ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)
|
||||
}
|
||||
|
||||
@@ -9,22 +9,22 @@ import (
|
||||
)
|
||||
|
||||
type LdapInterface interface {
|
||||
DoLogin(c *request.Context, id string, password string) (*model.User, *model.AppError)
|
||||
GetUser(c *request.Context, id string) (*model.User, *model.AppError)
|
||||
DoLogin(c request.CTX, id string, password string) (*model.User, *model.AppError)
|
||||
GetUser(c request.CTX, id string) (*model.User, *model.AppError)
|
||||
GetUserAttributes(id string, attributes []string) (map[string]string, *model.AppError)
|
||||
CheckPassword(c *request.Context, id string, password string) *model.AppError
|
||||
CheckPasswordAuthData(c *request.Context, authData string, password string) *model.AppError
|
||||
CheckProviderAttributes(c *request.Context, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
SwitchToLdap(c *request.Context, userID, ldapID, ldapPassword string) *model.AppError
|
||||
StartSynchronizeJob(c *request.Context, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError)
|
||||
CheckPassword(c request.CTX, id string, password string) *model.AppError
|
||||
CheckPasswordAuthData(c request.CTX, authData string, password string) *model.AppError
|
||||
CheckProviderAttributes(c request.CTX, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
SwitchToLdap(c request.CTX, userID, ldapID, ldapPassword string) *model.AppError
|
||||
StartSynchronizeJob(c request.CTX, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError)
|
||||
RunTest() *model.AppError
|
||||
GetAllLdapUsers(c *request.Context) ([]*model.User, *model.AppError)
|
||||
MigrateIDAttribute(c *request.Context, toAttribute string) error
|
||||
GetAllLdapUsers(c request.CTX) ([]*model.User, *model.AppError)
|
||||
MigrateIDAttribute(c request.CTX, toAttribute string) error
|
||||
GetGroup(groupUID string) (*model.Group, *model.AppError)
|
||||
GetAllGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)
|
||||
FirstLoginSync(c *request.Context, user *model.User, userAuthService, userAuthData, email string) *model.AppError
|
||||
UpdateProfilePictureIfNecessary(*request.Context, model.User, model.Session)
|
||||
GetADLdapIdFromSAMLId(c *request.Context, authData string) string
|
||||
GetSAMLIdFromADLdapId(c *request.Context, authData string) string
|
||||
FirstLoginSync(c request.CTX, user *model.User, userAuthService, userAuthData, email string) *model.AppError
|
||||
UpdateProfilePictureIfNecessary(request.CTX, model.User, model.Session)
|
||||
GetADLdapIdFromSAMLId(c request.CTX, authData string) string
|
||||
GetSAMLIdFromADLdapId(c request.CTX, authData string) string
|
||||
GetVendorNameAndVendorVersion() (string, string)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type MessageExportInterface interface {
|
||||
StartSynchronizeJob(c *request.Context, exportFromTimestamp int64) (*model.Job, *model.AppError)
|
||||
RunExport(c *request.Context, format string, since int64, limit int) (int64, *model.AppError)
|
||||
StartSynchronizeJob(c request.CTX, exportFromTimestamp int64) (*model.Job, *model.AppError)
|
||||
RunExport(c request.CTX, format string, since int64, limit int) (int64, *model.AppError)
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ type AccountMigrationInterface struct {
|
||||
}
|
||||
|
||||
// MigrateToLdap provides a mock function with given fields: c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(c *request.Context, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
func (_m *AccountMigrationInterface) MigrateToLdap(c request.CTX, fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(c, fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,11 +32,11 @@ func (_m *AccountMigrationInterface) MigrateToLdap(c *request.Context, fromAuthS
|
||||
}
|
||||
|
||||
// MigrateToSaml provides a mock function with given fields: c, fromAuthService, usersMap, auto, dryRun
|
||||
func (_m *AccountMigrationInterface) MigrateToSaml(c *request.Context, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError {
|
||||
func (_m *AccountMigrationInterface) MigrateToSaml(c request.CTX, fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError {
|
||||
ret := _m.Called(c, fromAuthService, usersMap, auto, dryRun)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string, bool, bool) *model.AppError); ok {
|
||||
r0 = rf(c, fromAuthService, usersMap, auto, dryRun)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
|
||||
@@ -16,11 +16,11 @@ type LdapInterface struct {
|
||||
}
|
||||
|
||||
// CheckPassword provides a mock function with given fields: c, id, password
|
||||
func (_m *LdapInterface) CheckPassword(c *request.Context, id string, password string) *model.AppError {
|
||||
func (_m *LdapInterface) CheckPassword(c request.CTX, id string, password string) *model.AppError {
|
||||
ret := _m.Called(c, id, password)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,11 +32,11 @@ func (_m *LdapInterface) CheckPassword(c *request.Context, id string, password s
|
||||
}
|
||||
|
||||
// CheckPasswordAuthData provides a mock function with given fields: c, authData, password
|
||||
func (_m *LdapInterface) CheckPasswordAuthData(c *request.Context, authData string, password string) *model.AppError {
|
||||
func (_m *LdapInterface) CheckPasswordAuthData(c request.CTX, authData string, password string) *model.AppError {
|
||||
ret := _m.Called(c, authData, password)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, authData, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -48,11 +48,11 @@ func (_m *LdapInterface) CheckPasswordAuthData(c *request.Context, authData stri
|
||||
}
|
||||
|
||||
// CheckProviderAttributes provides a mock function with given fields: c, LS, ouser, patch
|
||||
func (_m *LdapInterface) CheckProviderAttributes(c *request.Context, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
func (_m *LdapInterface) CheckProviderAttributes(c request.CTX, LS *model.LdapSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
ret := _m.Called(c, LS, ouser, patch)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.LdapSettings, *model.User, *model.UserPatch) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.LdapSettings, *model.User, *model.UserPatch) string); ok {
|
||||
r0 = rf(c, LS, ouser, patch)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -62,15 +62,15 @@ func (_m *LdapInterface) CheckProviderAttributes(c *request.Context, LS *model.L
|
||||
}
|
||||
|
||||
// DoLogin provides a mock function with given fields: c, id, password
|
||||
func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string) (*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) DoLogin(c request.CTX, id string, password string) (*model.User, *model.AppError) {
|
||||
ret := _m.Called(c, id, password)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, id, password)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.User); ok {
|
||||
r0 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -78,7 +78,7 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
||||
r1 = rf(c, id, password)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -90,11 +90,11 @@ func (_m *LdapInterface) DoLogin(c *request.Context, id string, password string)
|
||||
}
|
||||
|
||||
// FirstLoginSync provides a mock function with given fields: c, user, userAuthService, userAuthData, email
|
||||
func (_m *LdapInterface) FirstLoginSync(c *request.Context, user *model.User, userAuthService string, userAuthData string, email string) *model.AppError {
|
||||
func (_m *LdapInterface) FirstLoginSync(c request.CTX, user *model.User, userAuthService string, userAuthData string, email string) *model.AppError {
|
||||
ret := _m.Called(c, user, userAuthService, userAuthData, email)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.User, string, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, string, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, user, userAuthService, userAuthData, email)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -106,11 +106,11 @@ func (_m *LdapInterface) FirstLoginSync(c *request.Context, user *model.User, us
|
||||
}
|
||||
|
||||
// GetADLdapIdFromSAMLId provides a mock function with given fields: c, authData
|
||||
func (_m *LdapInterface) GetADLdapIdFromSAMLId(c *request.Context, authData string) string {
|
||||
func (_m *LdapInterface) GetADLdapIdFromSAMLId(c request.CTX, authData string) string {
|
||||
ret := _m.Called(c, authData)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(c, authData)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -155,15 +155,15 @@ func (_m *LdapInterface) GetAllGroupsPage(page int, perPage int, opts model.Ldap
|
||||
}
|
||||
|
||||
// GetAllLdapUsers provides a mock function with given fields: c
|
||||
func (_m *LdapInterface) GetAllLdapUsers(c *request.Context) ([]*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) GetAllLdapUsers(c request.CTX) ([]*model.User, *model.AppError) {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 []*model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) ([]*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) ([]*model.User, *model.AppError)); ok {
|
||||
return rf(c)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) []*model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) []*model.User); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -171,7 +171,7 @@ func (_m *LdapInterface) GetAllLdapUsers(c *request.Context) ([]*model.User, *mo
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) *model.AppError); ok {
|
||||
r1 = rf(c)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -211,11 +211,11 @@ func (_m *LdapInterface) GetGroup(groupUID string) (*model.Group, *model.AppErro
|
||||
}
|
||||
|
||||
// GetSAMLIdFromADLdapId provides a mock function with given fields: c, authData
|
||||
func (_m *LdapInterface) GetSAMLIdFromADLdapId(c *request.Context, authData string) string {
|
||||
func (_m *LdapInterface) GetSAMLIdFromADLdapId(c request.CTX, authData string) string {
|
||||
ret := _m.Called(c, authData)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) string); ok {
|
||||
r0 = rf(c, authData)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -225,15 +225,15 @@ func (_m *LdapInterface) GetSAMLIdFromADLdapId(c *request.Context, authData stri
|
||||
}
|
||||
|
||||
// GetUser provides a mock function with given fields: c, id
|
||||
func (_m *LdapInterface) GetUser(c *request.Context, id string) (*model.User, *model.AppError) {
|
||||
func (_m *LdapInterface) GetUser(c request.CTX, id string) (*model.User, *model.AppError) {
|
||||
ret := _m.Called(c, id)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, id)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.User); ok {
|
||||
r0 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -241,7 +241,7 @@ func (_m *LdapInterface) GetUser(c *request.Context, id string) (*model.User, *m
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
||||
r1 = rf(c, id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -305,11 +305,11 @@ func (_m *LdapInterface) GetVendorNameAndVendorVersion() (string, string) {
|
||||
}
|
||||
|
||||
// MigrateIDAttribute provides a mock function with given fields: c, toAttribute
|
||||
func (_m *LdapInterface) MigrateIDAttribute(c *request.Context, toAttribute string) error {
|
||||
func (_m *LdapInterface) MigrateIDAttribute(c request.CTX, toAttribute string) error {
|
||||
ret := _m.Called(c, toAttribute)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) error); ok {
|
||||
r0 = rf(c, toAttribute)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
@@ -335,15 +335,15 @@ func (_m *LdapInterface) RunTest() *model.AppError {
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, waitForJobToFinish, includeRemovedMembers
|
||||
func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
func (_m *LdapInterface) StartSynchronizeJob(c request.CTX, waitForJobToFinish bool, includeRemovedMembers bool) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, waitForJobToFinish, includeRemovedMembers)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, bool, bool) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, bool, bool) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, bool, bool) *model.Job); ok {
|
||||
r0 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -351,7 +351,7 @@ func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFin
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, bool, bool) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, bool, bool) *model.AppError); ok {
|
||||
r1 = rf(c, waitForJobToFinish, includeRemovedMembers)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -363,11 +363,11 @@ func (_m *LdapInterface) StartSynchronizeJob(c *request.Context, waitForJobToFin
|
||||
}
|
||||
|
||||
// SwitchToLdap provides a mock function with given fields: c, userID, ldapID, ldapPassword
|
||||
func (_m *LdapInterface) SwitchToLdap(c *request.Context, userID string, ldapID string, ldapPassword string) *model.AppError {
|
||||
func (_m *LdapInterface) SwitchToLdap(c request.CTX, userID string, ldapID string, ldapPassword string) *model.AppError {
|
||||
ret := _m.Called(c, userID, ldapID, ldapPassword)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, string, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, string, string) *model.AppError); ok {
|
||||
r0 = rf(c, userID, ldapID, ldapPassword)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -379,7 +379,7 @@ func (_m *LdapInterface) SwitchToLdap(c *request.Context, userID string, ldapID
|
||||
}
|
||||
|
||||
// UpdateProfilePictureIfNecessary provides a mock function with given fields: _a0, _a1, _a2
|
||||
func (_m *LdapInterface) UpdateProfilePictureIfNecessary(_a0 *request.Context, _a1 model.User, _a2 model.Session) {
|
||||
func (_m *LdapInterface) UpdateProfilePictureIfNecessary(_a0 request.CTX, _a1 model.User, _a2 model.Session) {
|
||||
_m.Called(_a0, _a1, _a2)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,21 +16,21 @@ type MessageExportInterface struct {
|
||||
}
|
||||
|
||||
// RunExport provides a mock function with given fields: c, format, since, limit
|
||||
func (_m *MessageExportInterface) RunExport(c *request.Context, format string, since int64, limit int) (int64, *model.AppError) {
|
||||
func (_m *MessageExportInterface) RunExport(c request.CTX, format string, since int64, limit int) (int64, *model.AppError) {
|
||||
ret := _m.Called(c, format, since, limit)
|
||||
|
||||
var r0 int64
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int64, int) (int64, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int64, int) (int64, *model.AppError)); ok {
|
||||
return rf(c, format, since, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, int64, int) int64); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, int64, int) int64); ok {
|
||||
r0 = rf(c, format, since, limit)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, int64, int) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, int64, int) *model.AppError); ok {
|
||||
r1 = rf(c, format, since, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -42,15 +42,15 @@ func (_m *MessageExportInterface) RunExport(c *request.Context, format string, s
|
||||
}
|
||||
|
||||
// StartSynchronizeJob provides a mock function with given fields: c, exportFromTimestamp
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(c *request.Context, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
func (_m *MessageExportInterface) StartSynchronizeJob(c request.CTX, exportFromTimestamp int64) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, exportFromTimestamp)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) (*model.Job, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, exportFromTimestamp)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, int64) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, int64) *model.Job); ok {
|
||||
r0 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -58,7 +58,7 @@ func (_m *MessageExportInterface) StartSynchronizeJob(c *request.Context, export
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, int64) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, int64) *model.AppError); ok {
|
||||
r1 = rf(c, exportFromTimestamp)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -32,15 +32,15 @@ func (_m *NotificationInterface) CheckLicense() *model.AppError {
|
||||
}
|
||||
|
||||
// GetNotificationMessage provides a mock function with given fields: c, ack, userID
|
||||
func (_m *NotificationInterface) GetNotificationMessage(c *request.Context, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError) {
|
||||
func (_m *NotificationInterface) GetNotificationMessage(c request.CTX, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError) {
|
||||
ret := _m.Called(c, ack, userID)
|
||||
|
||||
var r0 *model.PushNotification
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.PushNotificationAck, string) (*model.PushNotification, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.PushNotificationAck, string) (*model.PushNotification, *model.AppError)); ok {
|
||||
return rf(c, ack, userID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.PushNotificationAck, string) *model.PushNotification); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.PushNotificationAck, string) *model.PushNotification); ok {
|
||||
r0 = rf(c, ack, userID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -48,7 +48,7 @@ func (_m *NotificationInterface) GetNotificationMessage(c *request.Context, ack
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.PushNotificationAck, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.PushNotificationAck, string) *model.AppError); ok {
|
||||
r1 = rf(c, ack, userID)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -19,15 +19,15 @@ type OAuthProvider struct {
|
||||
}
|
||||
|
||||
// GetSSOSettings provides a mock function with given fields: c, config, service
|
||||
func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
func (_m *OAuthProvider) GetSSOSettings(c request.CTX, config *model.Config, service string) (*model.SSOSettings, error) {
|
||||
ret := _m.Called(c, config, service)
|
||||
|
||||
var r0 *model.SSOSettings
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, string) (*model.SSOSettings, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, string) (*model.SSOSettings, error)); ok {
|
||||
return rf(c, config, service)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, string) *model.SSOSettings); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, string) *model.SSOSettings); ok {
|
||||
r0 = rf(c, config, service)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -35,7 +35,7 @@ func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Config, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Config, string) error); ok {
|
||||
r1 = rf(c, config, service)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -45,15 +45,15 @@ func (_m *OAuthProvider) GetSSOSettings(c *request.Context, config *model.Config
|
||||
}
|
||||
|
||||
// GetUserFromIdToken provides a mock function with given fields: c, idToken
|
||||
func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string) (*model.User, error) {
|
||||
func (_m *OAuthProvider) GetUserFromIdToken(c request.CTX, idToken string) (*model.User, error) {
|
||||
ret := _m.Called(c, idToken)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.User, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.User, error)); ok {
|
||||
return rf(c, idToken)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.User); ok {
|
||||
r0 = rf(c, idToken)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -61,7 +61,7 @@ func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) error); ok {
|
||||
r1 = rf(c, idToken)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -71,15 +71,15 @@ func (_m *OAuthProvider) GetUserFromIdToken(c *request.Context, idToken string)
|
||||
}
|
||||
|
||||
// GetUserFromJSON provides a mock function with given fields: c, data, tokenUser
|
||||
func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
func (_m *OAuthProvider) GetUserFromJSON(c request.CTX, data io.Reader, tokenUser *model.User) (*model.User, error) {
|
||||
ret := _m.Called(c, data, tokenUser)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, io.Reader, *model.User) (*model.User, error)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, io.Reader, *model.User) (*model.User, error)); ok {
|
||||
return rf(c, data, tokenUser)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, io.Reader, *model.User) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, io.Reader, *model.User) *model.User); ok {
|
||||
r0 = rf(c, data, tokenUser)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -87,7 +87,7 @@ func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tok
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, io.Reader, *model.User) error); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, io.Reader, *model.User) error); ok {
|
||||
r1 = rf(c, data, tokenUser)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
@@ -97,11 +97,11 @@ func (_m *OAuthProvider) GetUserFromJSON(c *request.Context, data io.Reader, tok
|
||||
}
|
||||
|
||||
// IsSameUser provides a mock function with given fields: c, dbUser, oAuthUser
|
||||
func (_m *OAuthProvider) IsSameUser(c *request.Context, dbUser *model.User, oAuthUser *model.User) bool {
|
||||
func (_m *OAuthProvider) IsSameUser(c request.CTX, dbUser *model.User, oAuthUser *model.User) bool {
|
||||
ret := _m.Called(c, dbUser, oAuthUser)
|
||||
|
||||
var r0 bool
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.User, *model.User) bool); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.User) bool); ok {
|
||||
r0 = rf(c, dbUser, oAuthUser)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
|
||||
@@ -16,15 +16,15 @@ type SamlInterface struct {
|
||||
}
|
||||
|
||||
// BuildRequest provides a mock function with given fields: c, relayState
|
||||
func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*model.SamlAuthRequest, *model.AppError) {
|
||||
func (_m *SamlInterface) BuildRequest(c request.CTX, relayState string) (*model.SamlAuthRequest, *model.AppError) {
|
||||
ret := _m.Called(c, relayState)
|
||||
|
||||
var r0 *model.SamlAuthRequest
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) (*model.SamlAuthRequest, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.SamlAuthRequest, *model.AppError)); ok {
|
||||
return rf(c, relayState)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string) *model.SamlAuthRequest); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.SamlAuthRequest); ok {
|
||||
r0 = rf(c, relayState)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -32,7 +32,7 @@ func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*m
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
||||
r1 = rf(c, relayState)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -44,11 +44,11 @@ func (_m *SamlInterface) BuildRequest(c *request.Context, relayState string) (*m
|
||||
}
|
||||
|
||||
// CheckProviderAttributes provides a mock function with given fields: c, SS, ouser, patch
|
||||
func (_m *SamlInterface) CheckProviderAttributes(c *request.Context, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
func (_m *SamlInterface) CheckProviderAttributes(c request.CTX, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string {
|
||||
ret := _m.Called(c, SS, ouser, patch)
|
||||
|
||||
var r0 string
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.SamlSettings, *model.User, *model.UserPatch) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.SamlSettings, *model.User, *model.UserPatch) string); ok {
|
||||
r0 = rf(c, SS, ouser, patch)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
@@ -58,11 +58,11 @@ func (_m *SamlInterface) CheckProviderAttributes(c *request.Context, SS *model.S
|
||||
}
|
||||
|
||||
// ConfigureSP provides a mock function with given fields: c
|
||||
func (_m *SamlInterface) ConfigureSP(c *request.Context) error {
|
||||
func (_m *SamlInterface) ConfigureSP(c request.CTX) error {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) error); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) error); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
@@ -72,15 +72,15 @@ func (_m *SamlInterface) ConfigureSP(c *request.Context) error {
|
||||
}
|
||||
|
||||
// DoLogin provides a mock function with given fields: c, encodedXML, relayState
|
||||
func (_m *SamlInterface) DoLogin(c *request.Context, 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, *model.AppError) {
|
||||
ret := _m.Called(c, encodedXML, relayState)
|
||||
|
||||
var r0 *model.User
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) (*model.User, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) (*model.User, *model.AppError)); ok {
|
||||
return rf(c, encodedXML, relayState)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, string, map[string]string) *model.User); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, string, map[string]string) *model.User); ok {
|
||||
r0 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -88,7 +88,7 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, string, map[string]string) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, string, map[string]string) *model.AppError); ok {
|
||||
r1 = rf(c, encodedXML, relayState)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
@@ -100,21 +100,21 @@ func (_m *SamlInterface) DoLogin(c *request.Context, encodedXML string, relaySta
|
||||
}
|
||||
|
||||
// GetMetadata provides a mock function with given fields: c
|
||||
func (_m *SamlInterface) GetMetadata(c *request.Context) (string, *model.AppError) {
|
||||
func (_m *SamlInterface) GetMetadata(c request.CTX) (string, *model.AppError) {
|
||||
ret := _m.Called(c)
|
||||
|
||||
var r0 string
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) (string, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) (string, *model.AppError)); ok {
|
||||
return rf(c)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context) string); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX) string); ok {
|
||||
r0 = rf(c)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX) *model.AppError); ok {
|
||||
r1 = rf(c)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -48,15 +48,15 @@ func (_m *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, pendingJ
|
||||
}
|
||||
|
||||
// ScheduleJob provides a mock function with given fields: c, cfg, pendingJobs, lastSuccessfulJob
|
||||
func (_m *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
func (_m *Scheduler) ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
|
||||
ret := _m.Called(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
|
||||
var r0 *model.Job
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, bool, *model.Job) (*model.Job, *model.AppError)); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, bool, *model.Job) (*model.Job, *model.AppError)); ok {
|
||||
return rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*request.Context, *model.Config, bool, *model.Job) *model.Job); ok {
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, *model.Config, bool, *model.Job) *model.Job); ok {
|
||||
r0 = rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
@@ -64,7 +64,7 @@ func (_m *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJ
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(*request.Context, *model.Config, bool, *model.Job) *model.AppError); ok {
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, *model.Config, bool, *model.Job) *model.AppError); ok {
|
||||
r1 = rf(c, cfg, pendingJobs, lastSuccessfulJob)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
|
||||
@@ -9,6 +9,6 @@ import (
|
||||
)
|
||||
|
||||
type NotificationInterface interface {
|
||||
GetNotificationMessage(c *request.Context, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError)
|
||||
GetNotificationMessage(c request.CTX, ack *model.PushNotificationAck, userID string) (*model.PushNotification, *model.AppError)
|
||||
CheckLicense() *model.AppError
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
)
|
||||
|
||||
type OAuthProvider interface {
|
||||
GetUserFromJSON(c *request.Context, data io.Reader, tokenUser *model.User) (*model.User, error)
|
||||
GetSSOSettings(c *request.Context, config *model.Config, service string) (*model.SSOSettings, error)
|
||||
GetUserFromIdToken(c *request.Context, idToken string) (*model.User, error)
|
||||
IsSameUser(c *request.Context, dbUser, oAuthUser *model.User) bool
|
||||
GetUserFromJSON(c request.CTX, data io.Reader, tokenUser *model.User) (*model.User, error)
|
||||
GetSSOSettings(c request.CTX, config *model.Config, service string) (*model.SSOSettings, error)
|
||||
GetUserFromIdToken(c request.CTX, idToken string) (*model.User, error)
|
||||
IsSameUser(c request.CTX, dbUser, oAuthUser *model.User) bool
|
||||
}
|
||||
|
||||
var oauthProviders = make(map[string]OAuthProvider)
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
)
|
||||
|
||||
type SamlInterface interface {
|
||||
ConfigureSP(c *request.Context) error
|
||||
BuildRequest(c *request.Context, relayState string) (*model.SamlAuthRequest, *model.AppError)
|
||||
DoLogin(c *request.Context, encodedXML string, relayState map[string]string) (*model.User, *model.AppError)
|
||||
GetMetadata(c *request.Context) (string, *model.AppError)
|
||||
CheckProviderAttributes(c *request.Context, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
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)
|
||||
GetMetadata(c request.CTX) (string, *model.AppError)
|
||||
CheckProviderAttributes(c request.CTX, SS *model.SamlSettings, ouser *model.User, patch *model.UserPatch) string
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user