chore: fix generators in crypto package (#12008)

# Which Problems Are Solved

`@zitadel/api:generate-go` failed due to duplicate generated files.
https://github.com/zitadel/zitadel/pull/11820 removed the old generated
file and added a generate command to the `internal/crypto/crypto.go`
file. However, there was already a `internal/crypto/generate.go` with a
different output file name (the old file).

# How the Problems Are Solved

Removed the `internal/crypto/generate.go` file and moved the second
generate into `internal/crypto/code.go`.

# Additional Changes

Noticed that mockgen is an old version and updated it. Also then checked
all other tools and updated them.

# Additional Context

- relates to #11820
- noted internally
This commit is contained in:
Livio Spring
2026-04-08 08:48:05 +02:00
committed by GitHub
parent 99ad1ea83d
commit fbb6a406c8
30 changed files with 790 additions and 754 deletions
+6 -5
View File
@@ -23,6 +23,7 @@ import (
type MockExecutionQueue struct {
ctrl *gomock.Controller
recorder *MockExecutionQueueMockRecorder
isgomock struct{}
}
// MockExecutionQueueMockRecorder is the mock recorder for MockExecutionQueue.
@@ -43,10 +44,10 @@ func (m *MockExecutionQueue) EXPECT() *MockExecutionQueueMockRecorder {
}
// InsertManyFastTx mocks base method.
func (m *MockExecutionQueue) InsertManyFastTx(arg0 context.Context, arg1 *sql.Tx, arg2 []river.JobArgs, arg3 ...queue.InsertOpt) error {
func (m *MockExecutionQueue) InsertManyFastTx(ctx context.Context, tx *sql.Tx, args []river.JobArgs, opts ...queue.InsertOpt) error {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1, arg2}
for _, a := range arg3 {
varargs := []any{ctx, tx, args}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "InsertManyFastTx", varargs...)
@@ -55,8 +56,8 @@ func (m *MockExecutionQueue) InsertManyFastTx(arg0 context.Context, arg1 *sql.Tx
}
// InsertManyFastTx indicates an expected call of InsertManyFastTx.
func (mr *MockExecutionQueueMockRecorder) InsertManyFastTx(arg0, arg1, arg2 any, arg3 ...any) *gomock.Call {
func (mr *MockExecutionQueueMockRecorder) InsertManyFastTx(ctx, tx, args any, opts ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1, arg2}, arg3...)
varargs := append([]any{ctx, tx, args}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertManyFastTx", reflect.TypeOf((*MockExecutionQueue)(nil).InsertManyFastTx), varargs...)
}
@@ -24,6 +24,7 @@ import (
type MockQuerier struct {
ctrl *gomock.Controller
recorder *MockQuerierMockRecorder
isgomock struct{}
}
// MockQuerierMockRecorder is the mock recorder for MockQuerier.
@@ -58,67 +59,68 @@ func (mr *MockQuerierMockRecorder) Client() *gomock.Call {
}
// FilterToReducer mocks base method.
func (m *MockQuerier) FilterToReducer(arg0 context.Context, arg1 *eventstore.SearchQueryBuilder, arg2 eventstore.Reducer) error {
func (m *MockQuerier) FilterToReducer(ctx context.Context, searchQuery *eventstore.SearchQueryBuilder, r eventstore.Reducer) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "FilterToReducer", arg0, arg1, arg2)
ret := m.ctrl.Call(m, "FilterToReducer", ctx, searchQuery, r)
ret0, _ := ret[0].(error)
return ret0
}
// FilterToReducer indicates an expected call of FilterToReducer.
func (mr *MockQuerierMockRecorder) FilterToReducer(arg0, arg1, arg2 any) *gomock.Call {
func (mr *MockQuerierMockRecorder) FilterToReducer(ctx, searchQuery, r any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterToReducer", reflect.TypeOf((*MockQuerier)(nil).FilterToReducer), arg0, arg1, arg2)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FilterToReducer", reflect.TypeOf((*MockQuerier)(nil).FilterToReducer), ctx, searchQuery, r)
}
// Health mocks base method.
func (m *MockQuerier) Health(arg0 context.Context) error {
func (m *MockQuerier) Health(ctx context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Health", arg0)
ret := m.ctrl.Call(m, "Health", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// Health indicates an expected call of Health.
func (mr *MockQuerierMockRecorder) Health(arg0 any) *gomock.Call {
func (mr *MockQuerierMockRecorder) Health(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockQuerier)(nil).Health), arg0)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockQuerier)(nil).Health), ctx)
}
// InstanceIDs mocks base method.
func (m *MockQuerier) InstanceIDs(arg0 context.Context, arg1 *eventstore.SearchQueryBuilder) ([]string, error) {
func (m *MockQuerier) InstanceIDs(ctx context.Context, queryFactory *eventstore.SearchQueryBuilder) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InstanceIDs", arg0, arg1)
ret := m.ctrl.Call(m, "InstanceIDs", ctx, queryFactory)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// InstanceIDs indicates an expected call of InstanceIDs.
func (mr *MockQuerierMockRecorder) InstanceIDs(arg0, arg1 any) *gomock.Call {
func (mr *MockQuerierMockRecorder) InstanceIDs(ctx, queryFactory any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstanceIDs", reflect.TypeOf((*MockQuerier)(nil).InstanceIDs), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstanceIDs", reflect.TypeOf((*MockQuerier)(nil).InstanceIDs), ctx, queryFactory)
}
// LatestPosition mocks base method.
func (m *MockQuerier) LatestPosition(arg0 context.Context, arg1 *eventstore.SearchQueryBuilder) (decimal.Decimal, error) {
func (m *MockQuerier) LatestPosition(ctx context.Context, queryFactory *eventstore.SearchQueryBuilder) (decimal.Decimal, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "LatestPosition", arg0, arg1)
ret := m.ctrl.Call(m, "LatestPosition", ctx, queryFactory)
ret0, _ := ret[0].(decimal.Decimal)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// LatestPosition indicates an expected call of LatestPosition.
func (mr *MockQuerierMockRecorder) LatestPosition(arg0, arg1 any) *gomock.Call {
func (mr *MockQuerierMockRecorder) LatestPosition(ctx, queryFactory any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestPosition", reflect.TypeOf((*MockQuerier)(nil).LatestPosition), arg0, arg1)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LatestPosition", reflect.TypeOf((*MockQuerier)(nil).LatestPosition), ctx, queryFactory)
}
// MockPusher is a mock of Pusher interface.
type MockPusher struct {
ctrl *gomock.Controller
recorder *MockPusherMockRecorder
isgomock struct{}
}
// MockPusherMockRecorder is the mock recorder for MockPusher.
@@ -139,24 +141,24 @@ func (m *MockPusher) EXPECT() *MockPusherMockRecorder {
}
// Health mocks base method.
func (m *MockPusher) Health(arg0 context.Context) error {
func (m *MockPusher) Health(ctx context.Context) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Health", arg0)
ret := m.ctrl.Call(m, "Health", ctx)
ret0, _ := ret[0].(error)
return ret0
}
// Health indicates an expected call of Health.
func (mr *MockPusherMockRecorder) Health(arg0 any) *gomock.Call {
func (mr *MockPusherMockRecorder) Health(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockPusher)(nil).Health), arg0)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Health", reflect.TypeOf((*MockPusher)(nil).Health), ctx)
}
// Push mocks base method.
func (m *MockPusher) Push(arg0 context.Context, arg1 database.QueryExecutor, arg2 ...eventstore.Command) ([]eventstore.Event, error) {
func (m *MockPusher) Push(ctx context.Context, client database.QueryExecutor, commands ...eventstore.Command) ([]eventstore.Event, error) {
m.ctrl.T.Helper()
varargs := []any{arg0, arg1}
for _, a := range arg2 {
varargs := []any{ctx, client}
for _, a := range commands {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "Push", varargs...)
@@ -166,8 +168,8 @@ func (m *MockPusher) Push(arg0 context.Context, arg1 database.QueryExecutor, arg
}
// Push indicates an expected call of Push.
func (mr *MockPusherMockRecorder) Push(arg0, arg1 any, arg2 ...any) *gomock.Call {
func (mr *MockPusherMockRecorder) Push(ctx, client any, commands ...any) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]any{arg0, arg1}, arg2...)
varargs := append([]any{ctx, client}, commands...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Push", reflect.TypeOf((*MockPusher)(nil).Push), varargs...)
}