diff --git a/.releaserc.js b/.releaserc.js index b5347a7504..be0029b395 100644 --- a/.releaserc.js +++ b/.releaserc.js @@ -10,6 +10,7 @@ module.exports = { "@semantic-release/github", { draftRelease: true, + successComment: false, assets: [ { path: ".artifacts/zitadel-linux-amd64/zitadel-linux-amd64.tar.gz", diff --git a/Makefile b/Makefile index e728e42b01..6a41683390 100644 --- a/Makefile +++ b/Makefile @@ -63,12 +63,12 @@ endif .PHONY: core_grpc_dependencies core_grpc_dependencies: - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 # https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go?tab=versions - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.4 # https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc?tab=versions - go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.20.0 # https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway?tab=versions - go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.20.0 # https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2?tab=versions - go install github.com/envoyproxy/protoc-gen-validate@v1.0.4 # https://pkg.go.dev/github.com/envoyproxy/protoc-gen-validate?tab=versions - go install github.com/bufbuild/buf/cmd/buf@v1.34.0 # https://pkg.go.dev/github.com/bufbuild/buf/cmd/buf?tab=versions + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.35.1 # https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go?tab=versions + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1 # https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc?tab=versions + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.22.0 # https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway?tab=versions + go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.22.0 # https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2?tab=versions + go install github.com/envoyproxy/protoc-gen-validate@v1.1.0 # https://pkg.go.dev/github.com/envoyproxy/protoc-gen-validate?tab=versions + go install github.com/bufbuild/buf/cmd/buf@v1.45.0 # https://pkg.go.dev/github.com/bufbuild/buf/cmd/buf?tab=versions .PHONY: core_api core_api: core_api_generator core_grpc_dependencies diff --git a/internal/crypto/database/database_test.go b/internal/crypto/database/database_test.go index b8217d5ed4..1e3b9c0f22 100644 --- a/internal/crypto/database/database_test.go +++ b/internal/crypto/database/database_test.go @@ -468,17 +468,13 @@ func dbMock(t *testing.T, expectations ...func(m sqlmock.Sqlmock)) db { func expectQueryErr(query string, err error, args ...driver.Value) func(m sqlmock.Sqlmock) { return func(m sqlmock.Sqlmock) { - m.ExpectBegin() m.ExpectQuery(regexp.QuoteMeta(query)).WithArgs(args...).WillReturnError(err) - m.ExpectRollback() } } func expectQueryScanErr(stmt string, cols []string, rows [][]driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) { return func(m sqlmock.Sqlmock) { - m.ExpectBegin() q := m.ExpectQuery(regexp.QuoteMeta(stmt)).WithArgs(args...) - m.ExpectRollback() result := m.NewRows(cols) count := uint64(len(rows)) for _, row := range rows { @@ -494,9 +490,7 @@ func expectQueryScanErr(stmt string, cols []string, rows [][]driver.Value, args func expectQuery(stmt string, cols []string, rows [][]driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) { return func(m sqlmock.Sqlmock) { - m.ExpectBegin() q := m.ExpectQuery(regexp.QuoteMeta(stmt)).WithArgs(args...) - m.ExpectCommit() result := m.NewRows(cols) count := uint64(len(rows)) for _, row := range rows { diff --git a/internal/database/database.go b/internal/database/database.go index c7d73b3b92..d6ccf2873c 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -40,20 +40,7 @@ func (db *DB) Query(scan func(*sql.Rows) error, query string, args ...any) error } func (db *DB) QueryContext(ctx context.Context, scan func(rows *sql.Rows) error, query string, args ...any) (err error) { - tx, err := db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true, Isolation: sql.LevelReadCommitted}) - if err != nil { - return err - } - defer func() { - if err != nil { - rollbackErr := tx.Rollback() - logging.OnError(rollbackErr).Info("commit of read only transaction failed") - return - } - err = tx.Commit() - }() - - rows, err := tx.QueryContext(ctx, query, args...) + rows, err := db.DB.QueryContext(ctx, query, args...) if err != nil { return err } @@ -73,20 +60,7 @@ func (db *DB) QueryRow(scan func(*sql.Row) error, query string, args ...any) (er } func (db *DB) QueryRowContext(ctx context.Context, scan func(row *sql.Row) error, query string, args ...any) (err error) { - tx, err := db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true, Isolation: sql.LevelReadCommitted}) - if err != nil { - return err - } - defer func() { - if err != nil { - rollbackErr := tx.Rollback() - logging.OnError(rollbackErr).Info("commit of read only transaction failed") - return - } - err = tx.Commit() - }() - - row := tx.QueryRowContext(ctx, query, args...) + row := db.DB.QueryRowContext(ctx, query, args...) logging.OnError(row.Err()).Error("unexpected query error") err = scan(row) diff --git a/internal/database/database_test.go b/internal/database/database_test.go index 38c76e698a..5a18564e6a 100644 --- a/internal/database/database_test.go +++ b/internal/database/database_test.go @@ -31,7 +31,7 @@ func TestQueryJSONObject(t *testing.T) { { name: "tx error", mock: func(t *testing.T) *mock.SQLMock { - return mock.NewSQLMock(t, mock.ExpectBegin(sql.ErrConnDone)) + return mock.NewSQLMock(t, mock.ExpectQuery("select $1;", mock.WithQueryErr(sql.ErrConnDone))) }, wantErr: zerrors.ThrowInternal(sql.ErrConnDone, "DATAB-Oath6", "Errors.Internal"), }, @@ -39,7 +39,6 @@ func TestQueryJSONObject(t *testing.T) { name: "no rows", mock: func(t *testing.T) *mock.SQLMock { return mock.NewSQLMock(t, - mock.ExpectBegin(nil), mock.ExpectQuery(query, mock.WithQueryArgs(arg), mock.WithQueryResult([]string{"json"}, [][]driver.Value{}), @@ -52,12 +51,10 @@ func TestQueryJSONObject(t *testing.T) { name: "unmarshal error", mock: func(t *testing.T) *mock.SQLMock { return mock.NewSQLMock(t, - mock.ExpectBegin(nil), mock.ExpectQuery(query, mock.WithQueryArgs(arg), mock.WithQueryResult([]string{"json"}, [][]driver.Value{{`~~~`}}), ), - mock.ExpectCommit(nil), ) }, wantErr: zerrors.ThrowInternal(nil, "DATAB-Vohs6", "Errors.Internal"), @@ -66,12 +63,10 @@ func TestQueryJSONObject(t *testing.T) { name: "success", mock: func(t *testing.T) *mock.SQLMock { return mock.NewSQLMock(t, - mock.ExpectBegin(nil), mock.ExpectQuery(query, mock.WithQueryArgs(arg), mock.WithQueryResult([]string{"json"}, [][]driver.Value{{`{"a":1}`}}), ), - mock.ExpectCommit(nil), ) }, want: &dst{A: 1}, diff --git a/internal/eventstore/repository/sql/query_test.go b/internal/eventstore/repository/sql/query_test.go index 5d54b27c21..906c153deb 100644 --- a/internal/eventstore/repository/sql/query_test.go +++ b/internal/eventstore/repository/sql/query_test.go @@ -870,9 +870,7 @@ type dbMock struct { } func (m *dbMock) expectQuery(t *testing.T, expectedQuery string, args []driver.Value, events ...*repository.Event) *dbMock { - m.mock.ExpectBegin() query := m.mock.ExpectQuery(expectedQuery).WithArgs(args...) - m.mock.ExpectCommit() rows := m.mock.NewRows([]string{"sequence"}) for _, event := range events { rows = rows.AddRow(event.Seq) @@ -882,9 +880,7 @@ func (m *dbMock) expectQuery(t *testing.T, expectedQuery string, args []driver.V } func (m *dbMock) expectQueryScanErr(t *testing.T, expectedQuery string, args []driver.Value, events ...*repository.Event) *dbMock { - m.mock.ExpectBegin() query := m.mock.ExpectQuery(expectedQuery).WithArgs(args...) - m.mock.ExpectRollback() rows := m.mock.NewRows([]string{"sequence"}) for _, event := range events { rows = rows.AddRow(event.Seq) @@ -894,7 +890,6 @@ func (m *dbMock) expectQueryScanErr(t *testing.T, expectedQuery string, args []d } func (m *dbMock) expectQueryErr(t *testing.T, expectedQuery string, args []driver.Value, err error) *dbMock { - m.mock.ExpectBegin() m.mock.ExpectQuery(expectedQuery).WithArgs(args...).WillReturnError(err) return m } diff --git a/internal/eventstore/v3/push.go b/internal/eventstore/v3/push.go index a1c66e28e9..f09c3de515 100644 --- a/internal/eventstore/v3/push.go +++ b/internal/eventstore/v3/push.go @@ -14,10 +14,14 @@ import ( "github.com/zitadel/logging" "github.com/zitadel/zitadel/internal/eventstore" + "github.com/zitadel/zitadel/internal/telemetry/tracing" "github.com/zitadel/zitadel/internal/zerrors" ) func (es *Eventstore) Push(ctx context.Context, commands ...eventstore.Command) (events []eventstore.Event, err error) { + ctx, span := tracing.NewSpan(ctx) + defer func() { span.EndWithError(err) }() + tx, err := es.client.BeginTx(ctx, nil) if err != nil { return nil, err @@ -27,18 +31,21 @@ func (es *Eventstore) Push(ctx context.Context, commands ...eventstore.Command) sequences []*latestSequence ) - err = crdb.ExecuteInTx(ctx, &transaction{tx}, func() error { - sequences, err = latestSequences(ctx, tx, commands) + err = crdb.ExecuteInTx(ctx, &transaction{tx}, func() (err error) { + inTxCtx, span := tracing.NewSpan(ctx) + defer func() { span.EndWithError(err) }() + + sequences, err = latestSequences(inTxCtx, tx, commands) if err != nil { return err } - events, err = insertEvents(ctx, tx, sequences, commands) + events, err = insertEvents(inTxCtx, tx, sequences, commands) if err != nil { return err } - if err = handleUniqueConstraints(ctx, tx, commands); err != nil { + if err = handleUniqueConstraints(inTxCtx, tx, commands); err != nil { return err } @@ -51,7 +58,7 @@ func (es *Eventstore) Push(ctx context.Context, commands ...eventstore.Command) } } - return handleFieldCommands(ctx, tx, commands) + return handleFieldCommands(inTxCtx, tx, commands) }) if err != nil { diff --git a/internal/integration/oidc.go b/internal/integration/oidc.go index 3186ccdaa6..a581abe91b 100644 --- a/internal/integration/oidc.go +++ b/internal/integration/oidc.go @@ -411,5 +411,13 @@ func (i *Instance) CreateOIDCJWTProfileClient(ctx context.Context) (machine *man if err != nil { return nil, "", nil, err } + mustAwait(func() error { + _, err := i.Client.Mgmt.GetMachineKeyByIDs(ctx, &management.GetMachineKeyByIDsRequest{ + UserId: machine.GetUserId(), + KeyId: keyResp.GetKeyId(), + }) + return err + }) + return machine, name, keyResp.GetKeyDetails(), nil } diff --git a/internal/query/device_auth_test.go b/internal/query/device_auth_test.go index ff6a91e222..f81a11b411 100644 --- a/internal/query/device_auth_test.go +++ b/internal/query/device_auth_test.go @@ -57,11 +57,9 @@ func TestQueries_DeviceAuthRequestByUserCode(t *testing.T) { } defer client.Close() - mock.ExpectBegin() mock.ExpectQuery(expectedDeviceAuthWhereUserCodeQuery).WillReturnRows( mock.NewRows(deviceAuthSelectColumns).AddRow(expectedDeviceAuthValues...), ) - mock.ExpectCommit() q := Queries{ client: &database.DB{DB: client}, } diff --git a/internal/query/prepare_test.go b/internal/query/prepare_test.go index 2131a767af..0c0dd6d40c 100644 --- a/internal/query/prepare_test.go +++ b/internal/query/prepare_test.go @@ -82,9 +82,7 @@ type sqlExpectation func(sqlmock.Sqlmock) sqlmock.Sqlmock func mockQuery(stmt string, cols []string, row []driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) sqlmock.Sqlmock { return func(m sqlmock.Sqlmock) sqlmock.Sqlmock { - m.ExpectBegin() q := m.ExpectQuery(stmt).WithArgs(args...) - m.ExpectCommit() result := m.NewRows(cols) if len(row) > 0 { result.AddRow(row...) @@ -96,9 +94,7 @@ func mockQuery(stmt string, cols []string, row []driver.Value, args ...driver.Va func mockQueryScanErr(stmt string, cols []string, row []driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) sqlmock.Sqlmock { return func(m sqlmock.Sqlmock) sqlmock.Sqlmock { - m.ExpectBegin() q := m.ExpectQuery(stmt).WithArgs(args...) - m.ExpectRollback() result := m.NewRows(cols) if len(row) > 0 { result.AddRow(row...) @@ -110,9 +106,7 @@ func mockQueryScanErr(stmt string, cols []string, row []driver.Value, args ...dr func mockQueries(stmt string, cols []string, rows [][]driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) sqlmock.Sqlmock { return func(m sqlmock.Sqlmock) sqlmock.Sqlmock { - m.ExpectBegin() q := m.ExpectQuery(stmt).WithArgs(args...) - m.ExpectCommit() result := m.NewRows(cols) count := uint64(len(rows)) for _, row := range rows { @@ -129,9 +123,7 @@ func mockQueries(stmt string, cols []string, rows [][]driver.Value, args ...driv func mockQueriesScanErr(stmt string, cols []string, rows [][]driver.Value, args ...driver.Value) func(m sqlmock.Sqlmock) sqlmock.Sqlmock { return func(m sqlmock.Sqlmock) sqlmock.Sqlmock { - m.ExpectBegin() q := m.ExpectQuery(stmt).WithArgs(args...) - m.ExpectRollback() result := m.NewRows(cols) count := uint64(len(rows)) for _, row := range rows { @@ -148,10 +140,8 @@ func mockQueriesScanErr(stmt string, cols []string, rows [][]driver.Value, args func mockQueryErr(stmt string, err error, args ...driver.Value) func(m sqlmock.Sqlmock) sqlmock.Sqlmock { return func(m sqlmock.Sqlmock) sqlmock.Sqlmock { - m.ExpectBegin() q := m.ExpectQuery(stmt).WithArgs(args...) q.WillReturnError(err) - m.ExpectRollback() return m } } diff --git a/internal/view/repository/db_mock_test.go b/internal/view/repository/db_mock_test.go index b78d68d4da..a2a73ccae4 100644 --- a/internal/view/repository/db_mock_test.go +++ b/internal/view/repository/db_mock_test.go @@ -176,58 +176,48 @@ func (db *dbMock) expectRollback(err error) *dbMock { func (db *dbMock) expectGetByID(table, key, value string) *dbMock { query := fmt.Sprintf(expectedGetByID, table, key) - db.mock.ExpectBegin() db.mock.ExpectQuery(query). WithArgs(value). WillReturnRows(db.mock.NewRows([]string{key}). AddRow(key)) - db.mock.ExpectCommit() return db } func (db *dbMock) expectGetByIDErr(table, key, value string, err error) *dbMock { query := fmt.Sprintf(expectedGetByID, table, key) - db.mock.ExpectBegin() db.mock.ExpectQuery(query). WithArgs(value). WillReturnError(err) - db.mock.ExpectCommit() return db } func (db *dbMock) expectGetByQuery(table, key, method, value string) *dbMock { query := fmt.Sprintf(expectedGetByQuery, table, key, method) - db.mock.ExpectBegin() db.mock.ExpectQuery(query). WithArgs(value). WillReturnRows(db.mock.NewRows([]string{key}). AddRow(key)) - db.mock.ExpectCommit() return db } func (db *dbMock) expectGetByQueryCaseSensitive(table, key, method, value string) *dbMock { query := fmt.Sprintf(expectedGetByQueryCaseSensitive, table, key, method) - db.mock.ExpectBegin() db.mock.ExpectQuery(query). WithArgs(value). WillReturnRows(db.mock.NewRows([]string{key}). AddRow(key)) - db.mock.ExpectCommit() return db } func (db *dbMock) expectGetByQueryErr(table, key, method, value string, err error) *dbMock { query := fmt.Sprintf(expectedGetByQuery, table, key, method) - db.mock.ExpectBegin() db.mock.ExpectQuery(query). WithArgs(value). WillReturnError(err) - db.mock.ExpectCommit() return db } @@ -324,14 +314,11 @@ func (db *dbMock) expectGetSearchRequestNoParams(table string, resultAmount, tot rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() - db.mock.ExpectQuery(queryCount). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -344,12 +331,10 @@ func (db *dbMock) expectGetSearchRequestWithLimit(table string, limit, resultAmo rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -362,12 +347,10 @@ func (db *dbMock) expectGetSearchRequestWithOffset(table string, offset, resultA rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -380,12 +363,10 @@ func (db *dbMock) expectGetSearchRequestWithSorting(table, sorting string, sorti rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -398,14 +379,12 @@ func (db *dbMock) expectGetSearchRequestWithSearchQuery(table, key, method, valu rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WithArgs(value). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WithArgs(value). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -418,14 +397,12 @@ func (db *dbMock) expectGetSearchRequestWithAllParams(table, key, method, value, rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WithArgs(value). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WithArgs(value). WillReturnRows(rows) - db.mock.ExpectCommit() return db } @@ -438,11 +415,9 @@ func (db *dbMock) expectGetSearchRequestErr(table string, resultAmount, total in rows.AddRow(fmt.Sprintf("hodor-%d", i)) } - db.mock.ExpectBegin() db.mock.ExpectQuery(queryCount). WillReturnRows(db.mock.NewRows([]string{"count"}).AddRow(total)) db.mock.ExpectQuery(query). WillReturnError(err) - db.mock.ExpectCommit() return db } diff --git a/internal/view/repository/query.go b/internal/view/repository/query.go index fc2b6d8ac3..1462f76668 100644 --- a/internal/view/repository/query.go +++ b/internal/view/repository/query.go @@ -1,12 +1,9 @@ package repository import ( - "context" - "database/sql" "fmt" "github.com/jinzhu/gorm" - "github.com/zitadel/logging" "github.com/zitadel/zitadel/internal/database" "github.com/zitadel/zitadel/internal/domain" @@ -51,14 +48,6 @@ func PrepareSearchQuery(table string, request SearchRequest) func(db *gorm.DB, r } } - query = query.BeginTx(context.Background(), &sql.TxOptions{ReadOnly: true}) - defer func() { - if err := query.Commit().Error; err != nil { - logging.OnError(err).Info("commit failed") - } - query.RollbackUnlessCommitted() - }() - query = query.Count(&count) if res == nil { return count, nil diff --git a/internal/view/repository/requests.go b/internal/view/repository/requests.go index 54b4e79c3f..f389dee713 100644 --- a/internal/view/repository/requests.go +++ b/internal/view/repository/requests.go @@ -1,8 +1,6 @@ package repository import ( - "context" - "database/sql" "errors" "fmt" "strings" @@ -24,15 +22,7 @@ func PrepareGetByQuery(table string, queries ...SearchQuery) func(db *gorm.DB, r } } - tx := query.BeginTx(context.Background(), &sql.TxOptions{ReadOnly: true}) - defer func() { - if err := tx.Commit().Error; err != nil { - logging.OnError(err).Info("commit failed") - } - tx.RollbackUnlessCommitted() - }() - - err := tx.Take(res).Error + err := query.Take(res).Error if err == nil { return nil } diff --git a/pkg/grpc/protoc/v2/options.pb.go b/pkg/grpc/protoc/v2/options.pb.go index cdb10700c5..da7e038ee7 100644 --- a/pkg/grpc/protoc/v2/options.pb.go +++ b/pkg/grpc/protoc/v2/options.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.1 // protoc (unknown) // source: zitadel/protoc_gen_zitadel/v2/options.proto @@ -32,11 +32,9 @@ type Options struct { func (x *Options) Reset() { *x = Options{} - if protoimpl.UnsafeEnabled { - mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Options) String() string { @@ -47,7 +45,7 @@ func (*Options) ProtoMessage() {} func (x *Options) ProtoReflect() protoreflect.Message { mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -87,11 +85,9 @@ type AuthOption struct { func (x *AuthOption) Reset() { *x = AuthOption{} - if protoimpl.UnsafeEnabled { - mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AuthOption) String() string { @@ -102,7 +98,7 @@ func (*AuthOption) ProtoMessage() {} func (x *AuthOption) ProtoReflect() protoreflect.Message { mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -141,11 +137,9 @@ type CustomHTTPResponse struct { func (x *CustomHTTPResponse) Reset() { *x = CustomHTTPResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CustomHTTPResponse) String() string { @@ -156,7 +150,7 @@ func (*CustomHTTPResponse) ProtoMessage() {} func (x *CustomHTTPResponse) ProtoReflect() protoreflect.Message { mi := &file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -273,44 +267,6 @@ func file_zitadel_protoc_gen_zitadel_v2_options_proto_init() { if File_zitadel_protoc_gen_zitadel_v2_options_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Options); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*AuthOption); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_zitadel_protoc_gen_zitadel_v2_options_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*CustomHTTPResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{