mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05: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 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * 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. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
402 lines
12 KiB
Go
402 lines
12 KiB
Go
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
|
|
|
// Regenerate this file using `make einterfaces-mocks`.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
|
request "github.com/mattermost/mattermost/server/public/shared/request"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// AccessControlServiceInterface is an autogenerated mock type for the AccessControlServiceInterface type
|
|
type AccessControlServiceInterface struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AccessEvaluation provides a mock function with given fields: rctx, accessRequest
|
|
func (_m *AccessControlServiceInterface) AccessEvaluation(rctx request.CTX, accessRequest model.AccessRequest) (model.AccessDecision, *model.AppError) {
|
|
ret := _m.Called(rctx, accessRequest)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AccessEvaluation")
|
|
}
|
|
|
|
var r0 model.AccessDecision
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessRequest) (model.AccessDecision, *model.AppError)); ok {
|
|
return rf(rctx, accessRequest)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, model.AccessRequest) model.AccessDecision); ok {
|
|
r0 = rf(rctx, accessRequest)
|
|
} else {
|
|
r0 = ret.Get(0).(model.AccessDecision)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, model.AccessRequest) *model.AppError); ok {
|
|
r1 = rf(rctx, accessRequest)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CheckExpression provides a mock function with given fields: rctx, expression
|
|
func (_m *AccessControlServiceInterface) CheckExpression(rctx request.CTX, expression string) ([]model.CELExpressionError, *model.AppError) {
|
|
ret := _m.Called(rctx, expression)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for CheckExpression")
|
|
}
|
|
|
|
var r0 []model.CELExpressionError
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]model.CELExpressionError, *model.AppError)); ok {
|
|
return rf(rctx, expression)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) []model.CELExpressionError); ok {
|
|
r0 = rf(rctx, expression)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]model.CELExpressionError)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
|
r1 = rf(rctx, expression)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeletePolicy provides a mock function with given fields: rctx, id
|
|
func (_m *AccessControlServiceInterface) DeletePolicy(rctx request.CTX, id string) *model.AppError {
|
|
ret := _m.Called(rctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for DeletePolicy")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AppError); ok {
|
|
r0 = rf(rctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// ExpressionToVisualAST provides a mock function with given fields: rctx, expression
|
|
func (_m *AccessControlServiceInterface) ExpressionToVisualAST(rctx request.CTX, expression string) (*model.VisualExpression, *model.AppError) {
|
|
ret := _m.Called(rctx, expression)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ExpressionToVisualAST")
|
|
}
|
|
|
|
var r0 *model.VisualExpression
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.VisualExpression, *model.AppError)); ok {
|
|
return rf(rctx, expression)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.VisualExpression); ok {
|
|
r0 = rf(rctx, expression)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.VisualExpression)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
|
r1 = rf(rctx, expression)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetChannelMembersToRemove provides a mock function with given fields: rctx, channelID
|
|
func (_m *AccessControlServiceInterface) GetChannelMembersToRemove(rctx request.CTX, channelID string) ([]*model.ChannelMember, *model.AppError) {
|
|
ret := _m.Called(rctx, channelID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetChannelMembersToRemove")
|
|
}
|
|
|
|
var r0 []*model.ChannelMember
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) ([]*model.ChannelMember, *model.AppError)); ok {
|
|
return rf(rctx, channelID)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) []*model.ChannelMember); ok {
|
|
r0 = rf(rctx, channelID)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.ChannelMember)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
|
r1 = rf(rctx, channelID)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetPolicy provides a mock function with given fields: rctx, id
|
|
func (_m *AccessControlServiceInterface) GetPolicy(rctx request.CTX, id string) (*model.AccessControlPolicy, *model.AppError) {
|
|
ret := _m.Called(rctx, id)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetPolicy")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) (*model.AccessControlPolicy, *model.AppError)); ok {
|
|
return rf(rctx, id)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string) *model.AccessControlPolicy); ok {
|
|
r0 = rf(rctx, id)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string) *model.AppError); ok {
|
|
r1 = rf(rctx, id)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetPolicyRuleAttributes provides a mock function with given fields: rctx, policyID, action
|
|
func (_m *AccessControlServiceInterface) GetPolicyRuleAttributes(rctx request.CTX, policyID string, action string) (map[string][]string, *model.AppError) {
|
|
ret := _m.Called(rctx, policyID, action)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetPolicyRuleAttributes")
|
|
}
|
|
|
|
var r0 map[string][]string
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (map[string][]string, *model.AppError)); ok {
|
|
return rf(rctx, policyID, action)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string) map[string][]string); ok {
|
|
r0 = rf(rctx, policyID, action)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(map[string][]string)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
|
|
r1 = rf(rctx, policyID, action)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Init provides a mock function with given fields: rctx
|
|
func (_m *AccessControlServiceInterface) Init(rctx request.CTX) *model.AppError {
|
|
ret := _m.Called(rctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Init")
|
|
}
|
|
|
|
var r0 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX) *model.AppError); ok {
|
|
r0 = rf(rctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// NormalizePolicy provides a mock function with given fields: rctx, policy
|
|
func (_m *AccessControlServiceInterface) NormalizePolicy(rctx request.CTX, policy *model.AccessControlPolicy) (*model.AccessControlPolicy, *model.AppError) {
|
|
ret := _m.Called(rctx, policy)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for NormalizePolicy")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) (*model.AccessControlPolicy, *model.AppError)); ok {
|
|
return rf(rctx, policy)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) *model.AccessControlPolicy); ok {
|
|
r0 = rf(rctx, policy)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.AccessControlPolicy) *model.AppError); ok {
|
|
r1 = rf(rctx, policy)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// QueryUsersForExpression provides a mock function with given fields: rctx, expression, opts
|
|
func (_m *AccessControlServiceInterface) QueryUsersForExpression(rctx request.CTX, expression string, opts model.SubjectSearchOptions) ([]*model.User, int64, *model.AppError) {
|
|
ret := _m.Called(rctx, expression, opts)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for QueryUsersForExpression")
|
|
}
|
|
|
|
var r0 []*model.User
|
|
var r1 int64
|
|
var r2 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) ([]*model.User, int64, *model.AppError)); ok {
|
|
return rf(rctx, expression, opts)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, model.SubjectSearchOptions) []*model.User); ok {
|
|
r0 = rf(rctx, expression, opts)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, model.SubjectSearchOptions) int64); ok {
|
|
r1 = rf(rctx, expression, opts)
|
|
} else {
|
|
r1 = ret.Get(1).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(request.CTX, string, model.SubjectSearchOptions) *model.AppError); ok {
|
|
r2 = rf(rctx, expression, opts)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// QueryUsersForResource provides a mock function with given fields: rctx, resourceID, action, opts
|
|
func (_m *AccessControlServiceInterface) QueryUsersForResource(rctx request.CTX, resourceID string, action string, opts model.SubjectSearchOptions) ([]*model.User, int64, *model.AppError) {
|
|
ret := _m.Called(rctx, resourceID, action, opts)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for QueryUsersForResource")
|
|
}
|
|
|
|
var r0 []*model.User
|
|
var r1 int64
|
|
var r2 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, model.SubjectSearchOptions) ([]*model.User, int64, *model.AppError)); ok {
|
|
return rf(rctx, resourceID, action, opts)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, string, string, model.SubjectSearchOptions) []*model.User); ok {
|
|
r0 = rf(rctx, resourceID, action, opts)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*model.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, string, string, model.SubjectSearchOptions) int64); ok {
|
|
r1 = rf(rctx, resourceID, action, opts)
|
|
} else {
|
|
r1 = ret.Get(1).(int64)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(request.CTX, string, string, model.SubjectSearchOptions) *model.AppError); ok {
|
|
r2 = rf(rctx, resourceID, action, opts)
|
|
} else {
|
|
if ret.Get(2) != nil {
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// SavePolicy provides a mock function with given fields: rctx, policy
|
|
func (_m *AccessControlServiceInterface) SavePolicy(rctx request.CTX, policy *model.AccessControlPolicy) (*model.AccessControlPolicy, *model.AppError) {
|
|
ret := _m.Called(rctx, policy)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for SavePolicy")
|
|
}
|
|
|
|
var r0 *model.AccessControlPolicy
|
|
var r1 *model.AppError
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) (*model.AccessControlPolicy, *model.AppError)); ok {
|
|
return rf(rctx, policy)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(request.CTX, *model.AccessControlPolicy) *model.AccessControlPolicy); ok {
|
|
r0 = rf(rctx, policy)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.AccessControlPolicy)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(request.CTX, *model.AccessControlPolicy) *model.AppError); ok {
|
|
r1 = rf(rctx, policy)
|
|
} else {
|
|
if ret.Get(1) != nil {
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
}
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewAccessControlServiceInterface creates a new instance of AccessControlServiceInterface. 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 NewAccessControlServiceInterface(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *AccessControlServiceInterface {
|
|
mock := &AccessControlServiceInterface{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|