mirror of
https://github.com/hanzoai/team.git
synced 2026-10-30 14:49:35 +00:00
* Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <[email protected]> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Stavros Foteinopoulos <[email protected]> Co-authored-by: Hanzo Dev <[email protected]>
576 lines
13 KiB
Go
576 lines
13 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make store-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// OAuthStore is an autogenerated mock type for the OAuthStore type
|
|
type OAuthStore struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// DeleteApp provides a mock function with given fields: id
|
|
func (_m *OAuthStore) DeleteApp(id string) error {
|
|
ret := _m.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeleteApp")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetAccessData provides a mock function with given fields: token
|
|
func (_m *OAuthStore) GetAccessData(token string) (*model.AccessData, error) {
|
|
ret := _m.Called(token)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAccessData")
|
|
}
|
|
|
|
var r0 *model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.AccessData, error)); ok {
|
|
return rf(token)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.AccessData); ok {
|
|
r0 = rf(token)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(token)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAccessDataByRefreshToken provides a mock function with given fields: token
|
|
func (_m *OAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessData, error) {
|
|
ret := _m.Called(token)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAccessDataByRefreshToken")
|
|
}
|
|
|
|
var r0 *model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.AccessData, error)); ok {
|
|
return rf(token)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.AccessData); ok {
|
|
r0 = rf(token)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(token)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAccessDataByUserForApp provides a mock function with given fields: userID, clientID
|
|
func (_m *OAuthStore) GetAccessDataByUserForApp(userID string, clientID string) ([]*model.AccessData, error) {
|
|
ret := _m.Called(userID, clientID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAccessDataByUserForApp")
|
|
}
|
|
|
|
var r0 []*model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string) ([]*model.AccessData, error)); ok {
|
|
return rf(userID, clientID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string) []*model.AccessData); ok {
|
|
r0 = rf(userID, clientID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
r1 = rf(userID, clientID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetApp provides a mock function with given fields: id
|
|
func (_m *OAuthStore) GetApp(id string) (*model.OAuthApp, error) {
|
|
ret := _m.Called(id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetApp")
|
|
}
|
|
|
|
var r0 *model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.OAuthApp, error)); ok {
|
|
return rf(id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.OAuthApp); ok {
|
|
r0 = rf(id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(id)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAppByUser provides a mock function with given fields: userID, offset, limit
|
|
func (_m *OAuthStore) GetAppByUser(userID string, offset int, limit int) ([]*model.OAuthApp, error) {
|
|
ret := _m.Called(userID, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAppByUser")
|
|
}
|
|
|
|
var r0 []*model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OAuthApp, error)); ok {
|
|
return rf(userID, offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.OAuthApp); ok {
|
|
r0 = rf(userID, offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
|
r1 = rf(userID, offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetApps provides a mock function with given fields: offset, limit
|
|
func (_m *OAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, error) {
|
|
ret := _m.Called(offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetApps")
|
|
}
|
|
|
|
var r0 []*model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(int, int) ([]*model.OAuthApp, error)); ok {
|
|
return rf(offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(int, int) []*model.OAuthApp); ok {
|
|
r0 = rf(offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
|
r1 = rf(offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAuthData provides a mock function with given fields: code
|
|
func (_m *OAuthStore) GetAuthData(code string) (*model.AuthData, error) {
|
|
ret := _m.Called(code)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAuthData")
|
|
}
|
|
|
|
var r0 *model.AuthData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string) (*model.AuthData, error)); ok {
|
|
return rf(code)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string) *model.AuthData); ok {
|
|
r0 = rf(code)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AuthData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
r1 = rf(code)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetAuthorizedApps provides a mock function with given fields: userID, offset, limit
|
|
func (_m *OAuthStore) GetAuthorizedApps(userID string, offset int, limit int) ([]*model.OAuthApp, error) {
|
|
ret := _m.Called(userID, offset, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAuthorizedApps")
|
|
}
|
|
|
|
var r0 []*model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.OAuthApp, error)); ok {
|
|
return rf(userID, offset, limit)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.OAuthApp); ok {
|
|
r0 = rf(userID, offset, limit)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
|
r1 = rf(userID, offset, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetPreviousAccessData provides a mock function with given fields: userID, clientID
|
|
func (_m *OAuthStore) GetPreviousAccessData(userID string, clientID string) (*model.AccessData, error) {
|
|
ret := _m.Called(userID, clientID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetPreviousAccessData")
|
|
}
|
|
|
|
var r0 *model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.AccessData, error)); ok {
|
|
return rf(userID, clientID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.AccessData); ok {
|
|
r0 = rf(userID, clientID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
r1 = rf(userID, clientID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// PermanentDeleteAuthDataByUser provides a mock function with given fields: userID
|
|
func (_m *OAuthStore) PermanentDeleteAuthDataByUser(userID string) error {
|
|
ret := _m.Called(userID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for PermanentDeleteAuthDataByUser")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(userID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveAccessData provides a mock function with given fields: token
|
|
func (_m *OAuthStore) RemoveAccessData(token string) error {
|
|
ret := _m.Called(token)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveAccessData")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(token)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveAllAccessData provides a mock function with no fields
|
|
func (_m *OAuthStore) RemoveAllAccessData() error {
|
|
ret := _m.Called()
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveAllAccessData")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func() error); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveAuthData provides a mock function with given fields: code
|
|
func (_m *OAuthStore) RemoveAuthData(code string) error {
|
|
ret := _m.Called(code)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveAuthData")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(code)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveAuthDataByClientId provides a mock function with given fields: clientID, userID
|
|
func (_m *OAuthStore) RemoveAuthDataByClientId(clientID string, userID string) error {
|
|
ret := _m.Called(clientID, userID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveAuthDataByClientId")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
r0 = rf(clientID, userID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// RemoveAuthDataByUserId provides a mock function with given fields: userID
|
|
func (_m *OAuthStore) RemoveAuthDataByUserId(userID string) error {
|
|
ret := _m.Called(userID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for RemoveAuthDataByUserId")
|
|
}
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
r0 = rf(userID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// SaveAccessData provides a mock function with given fields: accessData
|
|
func (_m *OAuthStore) SaveAccessData(accessData *model.AccessData) (*model.AccessData, error) {
|
|
ret := _m.Called(accessData)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAccessData")
|
|
}
|
|
|
|
var r0 *model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.AccessData) (*model.AccessData, error)); ok {
|
|
return rf(accessData)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.AccessData) *model.AccessData); ok {
|
|
r0 = rf(accessData)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok {
|
|
r1 = rf(accessData)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveApp provides a mock function with given fields: app
|
|
func (_m *OAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, error) {
|
|
ret := _m.Called(app)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveApp")
|
|
}
|
|
|
|
var r0 *model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, error)); ok {
|
|
return rf(app)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok {
|
|
r0 = rf(app)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok {
|
|
r1 = rf(app)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// SaveAuthData provides a mock function with given fields: authData
|
|
func (_m *OAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, error) {
|
|
ret := _m.Called(authData)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SaveAuthData")
|
|
}
|
|
|
|
var r0 *model.AuthData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.AuthData) (*model.AuthData, error)); ok {
|
|
return rf(authData)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.AuthData) *model.AuthData); ok {
|
|
r0 = rf(authData)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AuthData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.AuthData) error); ok {
|
|
r1 = rf(authData)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateAccessData provides a mock function with given fields: accessData
|
|
func (_m *OAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.AccessData, error) {
|
|
ret := _m.Called(accessData)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateAccessData")
|
|
}
|
|
|
|
var r0 *model.AccessData
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.AccessData) (*model.AccessData, error)); ok {
|
|
return rf(accessData)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.AccessData) *model.AccessData); ok {
|
|
r0 = rf(accessData)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessData)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.AccessData) error); ok {
|
|
r1 = rf(accessData)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// UpdateApp provides a mock function with given fields: app
|
|
func (_m *OAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, error) {
|
|
ret := _m.Called(app)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for UpdateApp")
|
|
}
|
|
|
|
var r0 *model.OAuthApp
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, error)); ok {
|
|
return rf(app)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok {
|
|
r0 = rf(app)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.OAuthApp) error); ok {
|
|
r1 = rf(app)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewOAuthStore creates a new instance of OAuthStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewOAuthStore(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *OAuthStore {
|
|
mock := &OAuthStore{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|