mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 16:38:52 +00:00
feat(rt): authorizations (#11066)
# Which Problems Are Solved This PR implements relational table and repository interface for the authorizations feature as described in https://github.com/zitadel/zitadel/issues/10767 # How the Problems Are Solved By * adding new `zitadel.authorizations` and `zitadel.authorization_roles` tables * implementing the `AuthorizationRepository` interface to create, update, query, and delete user authorizations and roles * implementing `authorization_relational.go` projection to update `zitadel.authorizations` and `zitadel.authorization_roles` tables based on events # Additional Changes N/A # Additional Context - Closes #10767 --------- Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
co-authored by
Livio Spring
parent
11cf2c252a
commit
8472c7683d
@@ -0,0 +1,100 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zitadel/zitadel/backend/v3/storage/database"
|
||||
)
|
||||
|
||||
//go:generate enumer -type AuthorizationState -transform lower -trimprefix AuthorizationState -sql
|
||||
type AuthorizationState uint8
|
||||
|
||||
const (
|
||||
AuthorizationStateActive AuthorizationState = iota
|
||||
AuthorizationStateInactive
|
||||
)
|
||||
|
||||
type Authorization struct {
|
||||
ID string `json:"id,omitempty" db:"id"`
|
||||
UserID string `json:"userId" db:"user_id"`
|
||||
ProjectID string `json:"projectId" db:"project_id"`
|
||||
GrantID *string `json:"grantId" db:"grant_id"`
|
||||
InstanceID string `json:"instanceId,omitempty" db:"instance_id"`
|
||||
State AuthorizationState `json:"state,omitempty" db:"state"`
|
||||
CreatedAt time.Time `json:"createdAt,omitempty" db:"created_at"`
|
||||
UpdatedAt time.Time `json:"updatedAt,omitempty" db:"updated_at"`
|
||||
Roles []string `json:"roles,omitempty" db:"roles"`
|
||||
}
|
||||
|
||||
// authorizationColumns defines all the columns of the authorizations table.
|
||||
type authorizationColumns interface {
|
||||
// PrimaryKeyColumns returns the columns for the primary key fields
|
||||
PrimaryKeyColumns() []database.Column
|
||||
// IDColumn returns the column for the id field.
|
||||
IDColumn() database.Column
|
||||
// UserIDColumn returns the column for the user_id field.
|
||||
UserIDColumn() database.Column
|
||||
// GrantIDColumn returns the column for the project grant_id field.
|
||||
GrantIDColumn() database.Column
|
||||
// ProjectIDColumn returns the column for the project_id field.
|
||||
ProjectIDColumn() database.Column
|
||||
// InstanceIDColumn returns the column for the instance_id field.
|
||||
InstanceIDColumn() database.Column
|
||||
// StateColumn returns the column for the state field.
|
||||
StateColumn() database.Column
|
||||
// CreatedAtColumn returns the column for the created_at field.
|
||||
CreatedAtColumn() database.Column
|
||||
// UpdatedAtColumn returns the column for the updated_at field.
|
||||
UpdatedAtColumn() database.Column
|
||||
}
|
||||
|
||||
// authorizationConditions defines all the conditions for the authorizations table.
|
||||
type authorizationConditions interface {
|
||||
// PrimaryKeyCondition returns a filter on the primary key fields.
|
||||
PrimaryKeyCondition(instanceID, id string) database.Condition
|
||||
// IDCondition returns an equal filter on the id field.
|
||||
IDCondition(id string) database.Condition
|
||||
// InstanceIDCondition returns a filter on the instance_id field.
|
||||
InstanceIDCondition(instanceID string) database.Condition
|
||||
// ProjectIDCondition returns a filter on the project_id field.
|
||||
ProjectIDCondition(projectID string) database.Condition
|
||||
// GrantIDCondition returns a filter on the grant_id field.
|
||||
GrantIDCondition(grantID string) database.Condition
|
||||
// UserIDCondition returns a filter on the user_id field.
|
||||
UserIDCondition(userID string) database.Condition
|
||||
// RoleCondition returns a filter on the role_key field from the authorization_roles table.
|
||||
RoleCondition(op database.TextOperation, role string) database.Condition
|
||||
// ExistsRole returns a filter that checks for the existence of a role key in the authorization_roles table.
|
||||
ExistsRole(cond database.Condition) database.Condition
|
||||
// StateCondition returns a filter on the name field.
|
||||
StateCondition(state AuthorizationState) database.Condition
|
||||
}
|
||||
|
||||
// authorizationChanges defines all the changes for the authorizations table.
|
||||
type authorizationChanges interface {
|
||||
// SetUpdatedAt sets the updated at column.
|
||||
// Only use this when reducing events,
|
||||
// during regular updates the DB sets this column automatically.
|
||||
SetUpdatedAt(updatedAt time.Time) database.Change
|
||||
// SetState sets the state column.
|
||||
SetState(state AuthorizationState) database.Change
|
||||
}
|
||||
|
||||
//go:generate mockgen -typed -package domainmock -destination ./mock/authorization.mock.go . AuthorizationRepository
|
||||
|
||||
// AuthorizationRepository is the interface for the authorization repository.
|
||||
type AuthorizationRepository interface {
|
||||
Repository
|
||||
|
||||
authorizationConditions
|
||||
authorizationChanges
|
||||
authorizationColumns
|
||||
|
||||
Get(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) (*Authorization, error)
|
||||
List(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) ([]*Authorization, error)
|
||||
|
||||
Create(ctx context.Context, client database.QueryExecutor, authorization *Authorization) error
|
||||
Update(ctx context.Context, client database.QueryExecutor, condition database.Condition, roles []string, changes ...database.Change) (int64, error)
|
||||
Delete(ctx context.Context, client database.QueryExecutor, condition database.Condition) (int64, error)
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// Code generated by "enumer -type AuthorizationState -transform lower -trimprefix AuthorizationState -sql"; DO NOT EDIT.
|
||||
|
||||
package domain
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const _AuthorizationStateName = "activeinactive"
|
||||
|
||||
var _AuthorizationStateIndex = [...]uint8{0, 6, 14}
|
||||
|
||||
const _AuthorizationStateLowerName = "activeinactive"
|
||||
|
||||
func (i AuthorizationState) String() string {
|
||||
if i >= AuthorizationState(len(_AuthorizationStateIndex)-1) {
|
||||
return fmt.Sprintf("AuthorizationState(%d)", i)
|
||||
}
|
||||
return _AuthorizationStateName[_AuthorizationStateIndex[i]:_AuthorizationStateIndex[i+1]]
|
||||
}
|
||||
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
func _AuthorizationStateNoOp() {
|
||||
var x [1]struct{}
|
||||
_ = x[AuthorizationStateActive-(0)]
|
||||
_ = x[AuthorizationStateInactive-(1)]
|
||||
}
|
||||
|
||||
var _AuthorizationStateValues = []AuthorizationState{AuthorizationStateActive, AuthorizationStateInactive}
|
||||
|
||||
var _AuthorizationStateNameToValueMap = map[string]AuthorizationState{
|
||||
_AuthorizationStateName[0:6]: AuthorizationStateActive,
|
||||
_AuthorizationStateLowerName[0:6]: AuthorizationStateActive,
|
||||
_AuthorizationStateName[6:14]: AuthorizationStateInactive,
|
||||
_AuthorizationStateLowerName[6:14]: AuthorizationStateInactive,
|
||||
}
|
||||
|
||||
var _AuthorizationStateNames = []string{
|
||||
_AuthorizationStateName[0:6],
|
||||
_AuthorizationStateName[6:14],
|
||||
}
|
||||
|
||||
// AuthorizationStateString retrieves an enum value from the enum constants string name.
|
||||
// Throws an error if the param is not part of the enum.
|
||||
func AuthorizationStateString(s string) (AuthorizationState, error) {
|
||||
if val, ok := _AuthorizationStateNameToValueMap[s]; ok {
|
||||
return val, nil
|
||||
}
|
||||
|
||||
if val, ok := _AuthorizationStateNameToValueMap[strings.ToLower(s)]; ok {
|
||||
return val, nil
|
||||
}
|
||||
return 0, fmt.Errorf("%s does not belong to AuthorizationState values", s)
|
||||
}
|
||||
|
||||
// AuthorizationStateValues returns all values of the enum
|
||||
func AuthorizationStateValues() []AuthorizationState {
|
||||
return _AuthorizationStateValues
|
||||
}
|
||||
|
||||
// AuthorizationStateStrings returns a slice of all String values of the enum
|
||||
func AuthorizationStateStrings() []string {
|
||||
strs := make([]string, len(_AuthorizationStateNames))
|
||||
copy(strs, _AuthorizationStateNames)
|
||||
return strs
|
||||
}
|
||||
|
||||
// IsAAuthorizationState returns "true" if the value is listed in the enum definition. "false" otherwise
|
||||
func (i AuthorizationState) IsAAuthorizationState() bool {
|
||||
for _, v := range _AuthorizationStateValues {
|
||||
if i == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (i AuthorizationState) Value() (driver.Value, error) {
|
||||
return i.String(), nil
|
||||
}
|
||||
|
||||
func (i *AuthorizationState) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var str string
|
||||
switch v := value.(type) {
|
||||
case []byte:
|
||||
str = string(v)
|
||||
case string:
|
||||
str = v
|
||||
case fmt.Stringer:
|
||||
str = v.String()
|
||||
default:
|
||||
return fmt.Errorf("invalid value of AuthorizationState: %[1]T(%[1]v)", value)
|
||||
}
|
||||
|
||||
val, err := AuthorizationStateString(str)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*i = val
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,975 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/zitadel/zitadel/backend/v3/domain (interfaces: AuthorizationRepository)
|
||||
//
|
||||
// Generated by this command:
|
||||
//
|
||||
// mockgen -typed -package domainmock -destination ./mock/authorization.mock.go . AuthorizationRepository
|
||||
//
|
||||
|
||||
// Package domainmock is a generated GoMock package.
|
||||
package domainmock
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
time "time"
|
||||
|
||||
domain "github.com/zitadel/zitadel/backend/v3/domain"
|
||||
database "github.com/zitadel/zitadel/backend/v3/storage/database"
|
||||
gomock "go.uber.org/mock/gomock"
|
||||
)
|
||||
|
||||
// MockAuthorizationRepository is a mock of AuthorizationRepository interface.
|
||||
type MockAuthorizationRepository struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockAuthorizationRepositoryMockRecorder
|
||||
isgomock struct{}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryMockRecorder is the mock recorder for MockAuthorizationRepository.
|
||||
type MockAuthorizationRepositoryMockRecorder struct {
|
||||
mock *MockAuthorizationRepository
|
||||
}
|
||||
|
||||
// NewMockAuthorizationRepository creates a new mock instance.
|
||||
func NewMockAuthorizationRepository(ctrl *gomock.Controller) *MockAuthorizationRepository {
|
||||
mock := &MockAuthorizationRepository{ctrl: ctrl}
|
||||
mock.recorder = &MockAuthorizationRepositoryMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockAuthorizationRepository) EXPECT() *MockAuthorizationRepositoryMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Create mocks base method.
|
||||
func (m *MockAuthorizationRepository) Create(ctx context.Context, client database.QueryExecutor, authorization *domain.Authorization) error {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Create", ctx, client, authorization)
|
||||
ret0, _ := ret[0].(error)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Create indicates an expected call of Create.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) Create(ctx, client, authorization any) *MockAuthorizationRepositoryCreateCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockAuthorizationRepository)(nil).Create), ctx, client, authorization)
|
||||
return &MockAuthorizationRepositoryCreateCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryCreateCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryCreateCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryCreateCall) Return(arg0 error) *MockAuthorizationRepositoryCreateCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryCreateCall) Do(f func(context.Context, database.QueryExecutor, *domain.Authorization) error) *MockAuthorizationRepositoryCreateCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryCreateCall) DoAndReturn(f func(context.Context, database.QueryExecutor, *domain.Authorization) error) *MockAuthorizationRepositoryCreateCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// CreatedAtColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) CreatedAtColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "CreatedAtColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// CreatedAtColumn indicates an expected call of CreatedAtColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) CreatedAtColumn() *MockAuthorizationRepositoryCreatedAtColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatedAtColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).CreatedAtColumn))
|
||||
return &MockAuthorizationRepositoryCreatedAtColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryCreatedAtColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryCreatedAtColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryCreatedAtColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryCreatedAtColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryCreatedAtColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryCreatedAtColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryCreatedAtColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryCreatedAtColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// Delete mocks base method.
|
||||
func (m *MockAuthorizationRepository) Delete(ctx context.Context, client database.QueryExecutor, condition database.Condition) (int64, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Delete", ctx, client, condition)
|
||||
ret0, _ := ret[0].(int64)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Delete indicates an expected call of Delete.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) Delete(ctx, client, condition any) *MockAuthorizationRepositoryDeleteCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAuthorizationRepository)(nil).Delete), ctx, client, condition)
|
||||
return &MockAuthorizationRepositoryDeleteCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryDeleteCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryDeleteCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryDeleteCall) Return(arg0 int64, arg1 error) *MockAuthorizationRepositoryDeleteCall {
|
||||
c.Call = c.Call.Return(arg0, arg1)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryDeleteCall) Do(f func(context.Context, database.QueryExecutor, database.Condition) (int64, error)) *MockAuthorizationRepositoryDeleteCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryDeleteCall) DoAndReturn(f func(context.Context, database.QueryExecutor, database.Condition) (int64, error)) *MockAuthorizationRepositoryDeleteCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// Get mocks base method.
|
||||
func (m *MockAuthorizationRepository) Get(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) (*domain.Authorization, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []any{ctx, client}
|
||||
for _, a := range opts {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Get", varargs...)
|
||||
ret0, _ := ret[0].(*domain.Authorization)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Get indicates an expected call of Get.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) Get(ctx, client any, opts ...any) *MockAuthorizationRepositoryGetCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]any{ctx, client}, opts...)
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAuthorizationRepository)(nil).Get), varargs...)
|
||||
return &MockAuthorizationRepositoryGetCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryGetCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryGetCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryGetCall) Return(arg0 *domain.Authorization, arg1 error) *MockAuthorizationRepositoryGetCall {
|
||||
c.Call = c.Call.Return(arg0, arg1)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryGetCall) Do(f func(context.Context, database.QueryExecutor, ...database.QueryOption) (*domain.Authorization, error)) *MockAuthorizationRepositoryGetCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryGetCall) DoAndReturn(f func(context.Context, database.QueryExecutor, ...database.QueryOption) (*domain.Authorization, error)) *MockAuthorizationRepositoryGetCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// GrantIDColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) GrantIDColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantIDColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantIDColumn indicates an expected call of GrantIDColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) GrantIDColumn() *MockAuthorizationRepositoryGrantIDColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantIDColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).GrantIDColumn))
|
||||
return &MockAuthorizationRepositoryGrantIDColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryGrantIDColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryGrantIDColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryGrantIDColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryGrantIDColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryGrantIDColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryGrantIDColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryGrantIDColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryGrantIDColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// GrantIDCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) GrantIDCondition(grantID string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GrantIDCondition", grantID)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// GrantIDCondition indicates an expected call of GrantIDCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) GrantIDCondition(grantID any) *MockAuthorizationRepositoryGrantIDConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GrantIDCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).GrantIDCondition), grantID)
|
||||
return &MockAuthorizationRepositoryGrantIDConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryGrantIDConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryGrantIDConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryGrantIDConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryGrantIDConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryGrantIDConditionCall) Do(f func(string) database.Condition) *MockAuthorizationRepositoryGrantIDConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryGrantIDConditionCall) DoAndReturn(f func(string) database.Condition) *MockAuthorizationRepositoryGrantIDConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// IDColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) IDColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "IDColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// IDColumn indicates an expected call of IDColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) IDColumn() *MockAuthorizationRepositoryIDColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IDColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).IDColumn))
|
||||
return &MockAuthorizationRepositoryIDColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryIDColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryIDColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryIDColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryIDColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryIDColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryIDColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryIDColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryIDColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// IDCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) IDCondition(id string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "IDCondition", id)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// IDCondition indicates an expected call of IDCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) IDCondition(id any) *MockAuthorizationRepositoryIDConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IDCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).IDCondition), id)
|
||||
return &MockAuthorizationRepositoryIDConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryIDConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryIDConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryIDConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryIDConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryIDConditionCall) Do(f func(string) database.Condition) *MockAuthorizationRepositoryIDConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryIDConditionCall) DoAndReturn(f func(string) database.Condition) *MockAuthorizationRepositoryIDConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// InstanceIDColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) InstanceIDColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "InstanceIDColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// InstanceIDColumn indicates an expected call of InstanceIDColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) InstanceIDColumn() *MockAuthorizationRepositoryInstanceIDColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstanceIDColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).InstanceIDColumn))
|
||||
return &MockAuthorizationRepositoryInstanceIDColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryInstanceIDColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryInstanceIDColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryInstanceIDColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryInstanceIDColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryInstanceIDColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryInstanceIDColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryInstanceIDColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryInstanceIDColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// InstanceIDCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) InstanceIDCondition(instanceID string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "InstanceIDCondition", instanceID)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// InstanceIDCondition indicates an expected call of InstanceIDCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) InstanceIDCondition(instanceID any) *MockAuthorizationRepositoryInstanceIDConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstanceIDCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).InstanceIDCondition), instanceID)
|
||||
return &MockAuthorizationRepositoryInstanceIDConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryInstanceIDConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryInstanceIDConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryInstanceIDConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryInstanceIDConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryInstanceIDConditionCall) Do(f func(string) database.Condition) *MockAuthorizationRepositoryInstanceIDConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryInstanceIDConditionCall) DoAndReturn(f func(string) database.Condition) *MockAuthorizationRepositoryInstanceIDConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// List mocks base method.
|
||||
func (m *MockAuthorizationRepository) List(ctx context.Context, client database.QueryExecutor, opts ...database.QueryOption) ([]*domain.Authorization, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []any{ctx, client}
|
||||
for _, a := range opts {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "List", varargs...)
|
||||
ret0, _ := ret[0].([]*domain.Authorization)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// List indicates an expected call of List.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) List(ctx, client any, opts ...any) *MockAuthorizationRepositoryListCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]any{ctx, client}, opts...)
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAuthorizationRepository)(nil).List), varargs...)
|
||||
return &MockAuthorizationRepositoryListCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryListCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryListCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryListCall) Return(arg0 []*domain.Authorization, arg1 error) *MockAuthorizationRepositoryListCall {
|
||||
c.Call = c.Call.Return(arg0, arg1)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryListCall) Do(f func(context.Context, database.QueryExecutor, ...database.QueryOption) ([]*domain.Authorization, error)) *MockAuthorizationRepositoryListCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryListCall) DoAndReturn(f func(context.Context, database.QueryExecutor, ...database.QueryOption) ([]*domain.Authorization, error)) *MockAuthorizationRepositoryListCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// PrimaryKeyColumns mocks base method.
|
||||
func (m *MockAuthorizationRepository) PrimaryKeyColumns() []database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "PrimaryKeyColumns")
|
||||
ret0, _ := ret[0].([]database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// PrimaryKeyColumns indicates an expected call of PrimaryKeyColumns.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) PrimaryKeyColumns() *MockAuthorizationRepositoryPrimaryKeyColumnsCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrimaryKeyColumns", reflect.TypeOf((*MockAuthorizationRepository)(nil).PrimaryKeyColumns))
|
||||
return &MockAuthorizationRepositoryPrimaryKeyColumnsCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryPrimaryKeyColumnsCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryPrimaryKeyColumnsCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyColumnsCall) Return(arg0 []database.Column) *MockAuthorizationRepositoryPrimaryKeyColumnsCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyColumnsCall) Do(f func() []database.Column) *MockAuthorizationRepositoryPrimaryKeyColumnsCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyColumnsCall) DoAndReturn(f func() []database.Column) *MockAuthorizationRepositoryPrimaryKeyColumnsCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// PrimaryKeyCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) PrimaryKeyCondition(instanceID, id string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "PrimaryKeyCondition", instanceID, id)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// PrimaryKeyCondition indicates an expected call of PrimaryKeyCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) PrimaryKeyCondition(instanceID, id any) *MockAuthorizationRepositoryPrimaryKeyConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrimaryKeyCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).PrimaryKeyCondition), instanceID, id)
|
||||
return &MockAuthorizationRepositoryPrimaryKeyConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryPrimaryKeyConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryPrimaryKeyConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryPrimaryKeyConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyConditionCall) Do(f func(string, string) database.Condition) *MockAuthorizationRepositoryPrimaryKeyConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryPrimaryKeyConditionCall) DoAndReturn(f func(string, string) database.Condition) *MockAuthorizationRepositoryPrimaryKeyConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// ProjectIDColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) ProjectIDColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ProjectIDColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ProjectIDColumn indicates an expected call of ProjectIDColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) ProjectIDColumn() *MockAuthorizationRepositoryProjectIDColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProjectIDColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).ProjectIDColumn))
|
||||
return &MockAuthorizationRepositoryProjectIDColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryProjectIDColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryProjectIDColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryProjectIDColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryProjectIDColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryProjectIDColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryProjectIDColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryProjectIDColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryProjectIDColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// ProjectIDCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) ProjectIDCondition(projectID string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ProjectIDCondition", projectID)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ProjectIDCondition indicates an expected call of ProjectIDCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) ProjectIDCondition(projectID any) *MockAuthorizationRepositoryProjectIDConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProjectIDCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).ProjectIDCondition), projectID)
|
||||
return &MockAuthorizationRepositoryProjectIDConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryProjectIDConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryProjectIDConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryProjectIDConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryProjectIDConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryProjectIDConditionCall) Do(f func(string) database.Condition) *MockAuthorizationRepositoryProjectIDConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryProjectIDConditionCall) DoAndReturn(f func(string) database.Condition) *MockAuthorizationRepositoryProjectIDConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// RoleCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) RoleCondition(op database.TextOperation, role string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "RoleCondition", op, role)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// RoleCondition indicates an expected call of RoleCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) RoleCondition(op, role any) *MockAuthorizationRepositoryRoleConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RoleCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).RoleCondition), op, role)
|
||||
return &MockAuthorizationRepositoryRoleConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryRoleConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryRoleConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryRoleConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryRoleConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryRoleConditionCall) Do(f func(database.TextOperation, string) database.Condition) *MockAuthorizationRepositoryRoleConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryRoleConditionCall) DoAndReturn(f func(database.TextOperation, string) database.Condition) *MockAuthorizationRepositoryRoleConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// SetState mocks base method.
|
||||
func (m *MockAuthorizationRepository) SetState(state domain.AuthorizationState) database.Change {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SetState", state)
|
||||
ret0, _ := ret[0].(database.Change)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// SetState indicates an expected call of SetState.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) SetState(state any) *MockAuthorizationRepositorySetStateCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetState", reflect.TypeOf((*MockAuthorizationRepository)(nil).SetState), state)
|
||||
return &MockAuthorizationRepositorySetStateCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositorySetStateCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositorySetStateCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositorySetStateCall) Return(arg0 database.Change) *MockAuthorizationRepositorySetStateCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositorySetStateCall) Do(f func(domain.AuthorizationState) database.Change) *MockAuthorizationRepositorySetStateCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositorySetStateCall) DoAndReturn(f func(domain.AuthorizationState) database.Change) *MockAuthorizationRepositorySetStateCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// SetUpdatedAt mocks base method.
|
||||
func (m *MockAuthorizationRepository) SetUpdatedAt(updatedAt time.Time) database.Change {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "SetUpdatedAt", updatedAt)
|
||||
ret0, _ := ret[0].(database.Change)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// SetUpdatedAt indicates an expected call of SetUpdatedAt.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) SetUpdatedAt(updatedAt any) *MockAuthorizationRepositorySetUpdatedAtCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetUpdatedAt", reflect.TypeOf((*MockAuthorizationRepository)(nil).SetUpdatedAt), updatedAt)
|
||||
return &MockAuthorizationRepositorySetUpdatedAtCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositorySetUpdatedAtCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositorySetUpdatedAtCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositorySetUpdatedAtCall) Return(arg0 database.Change) *MockAuthorizationRepositorySetUpdatedAtCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositorySetUpdatedAtCall) Do(f func(time.Time) database.Change) *MockAuthorizationRepositorySetUpdatedAtCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositorySetUpdatedAtCall) DoAndReturn(f func(time.Time) database.Change) *MockAuthorizationRepositorySetUpdatedAtCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// StateColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) StateColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// StateColumn indicates an expected call of StateColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) StateColumn() *MockAuthorizationRepositoryStateColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).StateColumn))
|
||||
return &MockAuthorizationRepositoryStateColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryStateColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryStateColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryStateColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryStateColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryStateColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryStateColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryStateColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryStateColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// StateCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) StateCondition(state domain.AuthorizationState) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "StateCondition", state)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// StateCondition indicates an expected call of StateCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) StateCondition(state any) *MockAuthorizationRepositoryStateConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).StateCondition), state)
|
||||
return &MockAuthorizationRepositoryStateConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryStateConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryStateConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryStateConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryStateConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryStateConditionCall) Do(f func(domain.AuthorizationState) database.Condition) *MockAuthorizationRepositoryStateConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryStateConditionCall) DoAndReturn(f func(domain.AuthorizationState) database.Condition) *MockAuthorizationRepositoryStateConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// Update mocks base method.
|
||||
func (m *MockAuthorizationRepository) Update(ctx context.Context, client database.QueryExecutor, condition database.Condition, roles []string, changes ...database.Change) (int64, error) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs := []any{ctx, client, condition, roles}
|
||||
for _, a := range changes {
|
||||
varargs = append(varargs, a)
|
||||
}
|
||||
ret := m.ctrl.Call(m, "Update", varargs...)
|
||||
ret0, _ := ret[0].(int64)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// Update indicates an expected call of Update.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) Update(ctx, client, condition, roles any, changes ...any) *MockAuthorizationRepositoryUpdateCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs := append([]any{ctx, client, condition, roles}, changes...)
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAuthorizationRepository)(nil).Update), varargs...)
|
||||
return &MockAuthorizationRepositoryUpdateCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryUpdateCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryUpdateCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryUpdateCall) Return(arg0 int64, arg1 error) *MockAuthorizationRepositoryUpdateCall {
|
||||
c.Call = c.Call.Return(arg0, arg1)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryUpdateCall) Do(f func(context.Context, database.QueryExecutor, database.Condition, []string, ...database.Change) (int64, error)) *MockAuthorizationRepositoryUpdateCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryUpdateCall) DoAndReturn(f func(context.Context, database.QueryExecutor, database.Condition, []string, ...database.Change) (int64, error)) *MockAuthorizationRepositoryUpdateCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// UpdatedAtColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) UpdatedAtColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UpdatedAtColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// UpdatedAtColumn indicates an expected call of UpdatedAtColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) UpdatedAtColumn() *MockAuthorizationRepositoryUpdatedAtColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatedAtColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).UpdatedAtColumn))
|
||||
return &MockAuthorizationRepositoryUpdatedAtColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryUpdatedAtColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryUpdatedAtColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryUpdatedAtColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryUpdatedAtColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryUpdatedAtColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryUpdatedAtColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryUpdatedAtColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryUpdatedAtColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// UserIDColumn mocks base method.
|
||||
func (m *MockAuthorizationRepository) UserIDColumn() database.Column {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UserIDColumn")
|
||||
ret0, _ := ret[0].(database.Column)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// UserIDColumn indicates an expected call of UserIDColumn.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) UserIDColumn() *MockAuthorizationRepositoryUserIDColumnCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserIDColumn", reflect.TypeOf((*MockAuthorizationRepository)(nil).UserIDColumn))
|
||||
return &MockAuthorizationRepositoryUserIDColumnCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryUserIDColumnCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryUserIDColumnCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryUserIDColumnCall) Return(arg0 database.Column) *MockAuthorizationRepositoryUserIDColumnCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryUserIDColumnCall) Do(f func() database.Column) *MockAuthorizationRepositoryUserIDColumnCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryUserIDColumnCall) DoAndReturn(f func() database.Column) *MockAuthorizationRepositoryUserIDColumnCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// UserIDCondition mocks base method.
|
||||
func (m *MockAuthorizationRepository) UserIDCondition(userID string) database.Condition {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "UserIDCondition", userID)
|
||||
ret0, _ := ret[0].(database.Condition)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// UserIDCondition indicates an expected call of UserIDCondition.
|
||||
func (mr *MockAuthorizationRepositoryMockRecorder) UserIDCondition(userID any) *MockAuthorizationRepositoryUserIDConditionCall {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UserIDCondition", reflect.TypeOf((*MockAuthorizationRepository)(nil).UserIDCondition), userID)
|
||||
return &MockAuthorizationRepositoryUserIDConditionCall{Call: call}
|
||||
}
|
||||
|
||||
// MockAuthorizationRepositoryUserIDConditionCall wrap *gomock.Call
|
||||
type MockAuthorizationRepositoryUserIDConditionCall struct {
|
||||
*gomock.Call
|
||||
}
|
||||
|
||||
// Return rewrite *gomock.Call.Return
|
||||
func (c *MockAuthorizationRepositoryUserIDConditionCall) Return(arg0 database.Condition) *MockAuthorizationRepositoryUserIDConditionCall {
|
||||
c.Call = c.Call.Return(arg0)
|
||||
return c
|
||||
}
|
||||
|
||||
// Do rewrite *gomock.Call.Do
|
||||
func (c *MockAuthorizationRepositoryUserIDConditionCall) Do(f func(string) database.Condition) *MockAuthorizationRepositoryUserIDConditionCall {
|
||||
c.Call = c.Call.Do(f)
|
||||
return c
|
||||
}
|
||||
|
||||
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||
func (c *MockAuthorizationRepositoryUserIDConditionCall) DoAndReturn(f func(string) database.Condition) *MockAuthorizationRepositoryUserIDConditionCall {
|
||||
c.Call = c.Call.DoAndReturn(f)
|
||||
return c
|
||||
}
|
||||
Reference in New Issue
Block a user