From 37950af58386056f9241a1d0166cd9341a37ee68 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 23 Feb 2024 13:04:19 +0100 Subject: [PATCH] Add ProjectMember as entity (#84) --- .github/workflows/docker.yaml | 2 +- Makefile | 2 +- api/v1/common.pb.go | 2 +- api/v1/iam.pb.go | 2 +- api/v1/meta.pb.go | 2 +- api/v1/mocks/ProjectMemberServiceClient.go | 217 ++++++ api/v1/mocks/ProjectMemberServiceServer.go | 179 +++++ .../mocks/UnsafeProjectMemberServiceServer.go | 29 + api/v1/project.pb.go | 2 +- api/v1/project_member.pb.go | 694 ++++++++++++++++++ api/v1/project_member_grpc.pb.go | 255 +++++++ api/v1/projectmember.go | 15 + api/v1/projectmember_scnrvalr.go | 62 ++ api/v1/quota.pb.go | 2 +- api/v1/tenant.pb.go | 2 +- certs/ca-key.pem | 6 +- certs/ca.csr | 10 +- certs/ca.pem | 18 +- certs/client-key.pem | 6 +- certs/client.csr | 10 +- certs/client.pem | 18 +- certs/server-key.pem | 6 +- certs/server.csr | 12 +- certs/server.pem | 20 +- client/main.go | 12 + go.mod | 54 +- go.sum | 130 ++-- pkg/client/client.go | 6 + pkg/service/project.go | 5 +- pkg/service/projectmember.go | 106 +++ pkg/service/projectmember_test.go | 186 +++++ pkg/service/tenant.go | 5 +- proto/Makefile | 2 +- proto/buf.gen.yaml | 2 +- proto/v1/project_member.proto | 50 ++ server/main.go | 8 + 36 files changed, 1971 insertions(+), 168 deletions(-) create mode 100644 api/v1/mocks/ProjectMemberServiceClient.go create mode 100644 api/v1/mocks/ProjectMemberServiceServer.go create mode 100644 api/v1/mocks/UnsafeProjectMemberServiceServer.go create mode 100644 api/v1/project_member.pb.go create mode 100644 api/v1/project_member_grpc.pb.go create mode 100644 api/v1/projectmember.go create mode 100644 api/v1/projectmember_scnrvalr.go create mode 100644 pkg/service/projectmember.go create mode 100644 pkg/service/projectmember_test.go create mode 100644 proto/v1/project_member.proto diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 7457739..b37c820 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -38,7 +38,7 @@ jobs: cache: false - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: args: --build-tags integration -p bugs -p unused -D protogetter --timeout=10m diff --git a/Makefile b/Makefile index c9de187..a1f39cc 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ mocks: .PHONY: postgres-up postgres-up: postgres-rm - docker run -d --name masterdatadb -p 5432:5432 -e POSTGRES_PASSWORD="password" -e POSTGRES_USER="masterdata" -e POSTGRES_DB="masterdata" postgres:12-alpine + docker run -d --name masterdatadb -p 5432:5432 -e POSTGRES_PASSWORD="password" -e POSTGRES_USER="masterdata" -e POSTGRES_DB="masterdata" postgres:16-alpine .PHONY: postgres-rm postgres-rm: diff --git a/api/v1/common.pb.go b/api/v1/common.pb.go index 201e5a8..062cd2a 100644 --- a/api/v1/common.pb.go +++ b/api/v1/common.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/common.proto diff --git a/api/v1/iam.pb.go b/api/v1/iam.pb.go index dda8bdb..030328a 100644 --- a/api/v1/iam.pb.go +++ b/api/v1/iam.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/iam.proto diff --git a/api/v1/meta.pb.go b/api/v1/meta.pb.go index 50ab2ca..3418f70 100644 --- a/api/v1/meta.pb.go +++ b/api/v1/meta.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/meta.proto diff --git a/api/v1/mocks/ProjectMemberServiceClient.go b/api/v1/mocks/ProjectMemberServiceClient.go new file mode 100644 index 0000000..82c48d7 --- /dev/null +++ b/api/v1/mocks/ProjectMemberServiceClient.go @@ -0,0 +1,217 @@ +// Code generated by mockery v2.38.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + v1 "github.com/metal-stack/masterdata-api/api/v1" +) + +// ProjectMemberServiceClient is an autogenerated mock type for the ProjectMemberServiceClient type +type ProjectMemberServiceClient struct { + mock.Mock +} + +// Create provides a mock function with given fields: ctx, in, opts +func (_m *ProjectMemberServiceClient) Create(ctx context.Context, in *v1.ProjectMemberCreateRequest, opts ...grpc.CallOption) (*v1.ProjectMemberResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberCreateRequest, ...grpc.CallOption) (*v1.ProjectMemberResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberCreateRequest, ...grpc.CallOption) *v1.ProjectMemberResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberCreateRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Delete provides a mock function with given fields: ctx, in, opts +func (_m *ProjectMemberServiceClient) Delete(ctx context.Context, in *v1.ProjectMemberDeleteRequest, opts ...grpc.CallOption) (*v1.ProjectMemberResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberDeleteRequest, ...grpc.CallOption) (*v1.ProjectMemberResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberDeleteRequest, ...grpc.CallOption) *v1.ProjectMemberResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberDeleteRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Find provides a mock function with given fields: ctx, in, opts +func (_m *ProjectMemberServiceClient) Find(ctx context.Context, in *v1.ProjectMemberFindRequest, opts ...grpc.CallOption) (*v1.ProjectMemberListResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Find") + } + + var r0 *v1.ProjectMemberListResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberFindRequest, ...grpc.CallOption) (*v1.ProjectMemberListResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberFindRequest, ...grpc.CallOption) *v1.ProjectMemberListResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberListResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberFindRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Get provides a mock function with given fields: ctx, in, opts +func (_m *ProjectMemberServiceClient) Get(ctx context.Context, in *v1.ProjectMemberGetRequest, opts ...grpc.CallOption) (*v1.ProjectMemberResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberGetRequest, ...grpc.CallOption) (*v1.ProjectMemberResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberGetRequest, ...grpc.CallOption) *v1.ProjectMemberResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberGetRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Update provides a mock function with given fields: ctx, in, opts +func (_m *ProjectMemberServiceClient) Update(ctx context.Context, in *v1.ProjectMemberUpdateRequest, opts ...grpc.CallOption) (*v1.ProjectMemberResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberUpdateRequest, ...grpc.CallOption) (*v1.ProjectMemberResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberUpdateRequest, ...grpc.CallOption) *v1.ProjectMemberResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberUpdateRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewProjectMemberServiceClient creates a new instance of ProjectMemberServiceClient. 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 NewProjectMemberServiceClient(t interface { + mock.TestingT + Cleanup(func()) +}) *ProjectMemberServiceClient { + mock := &ProjectMemberServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/api/v1/mocks/ProjectMemberServiceServer.go b/api/v1/mocks/ProjectMemberServiceServer.go new file mode 100644 index 0000000..380562e --- /dev/null +++ b/api/v1/mocks/ProjectMemberServiceServer.go @@ -0,0 +1,179 @@ +// Code generated by mockery v2.38.0. DO NOT EDIT. + +package mocks + +import ( + context "context" + + v1 "github.com/metal-stack/masterdata-api/api/v1" + mock "github.com/stretchr/testify/mock" +) + +// ProjectMemberServiceServer is an autogenerated mock type for the ProjectMemberServiceServer type +type ProjectMemberServiceServer struct { + mock.Mock +} + +// Create provides a mock function with given fields: _a0, _a1 +func (_m *ProjectMemberServiceServer) Create(_a0 context.Context, _a1 *v1.ProjectMemberCreateRequest) (*v1.ProjectMemberResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberCreateRequest) (*v1.ProjectMemberResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberCreateRequest) *v1.ProjectMemberResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberCreateRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Delete provides a mock function with given fields: _a0, _a1 +func (_m *ProjectMemberServiceServer) Delete(_a0 context.Context, _a1 *v1.ProjectMemberDeleteRequest) (*v1.ProjectMemberResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberDeleteRequest) (*v1.ProjectMemberResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberDeleteRequest) *v1.ProjectMemberResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberDeleteRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Find provides a mock function with given fields: _a0, _a1 +func (_m *ProjectMemberServiceServer) Find(_a0 context.Context, _a1 *v1.ProjectMemberFindRequest) (*v1.ProjectMemberListResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Find") + } + + var r0 *v1.ProjectMemberListResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberFindRequest) (*v1.ProjectMemberListResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberFindRequest) *v1.ProjectMemberListResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberListResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberFindRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Get provides a mock function with given fields: _a0, _a1 +func (_m *ProjectMemberServiceServer) Get(_a0 context.Context, _a1 *v1.ProjectMemberGetRequest) (*v1.ProjectMemberResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberGetRequest) (*v1.ProjectMemberResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberGetRequest) *v1.ProjectMemberResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberGetRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Update provides a mock function with given fields: _a0, _a1 +func (_m *ProjectMemberServiceServer) Update(_a0 context.Context, _a1 *v1.ProjectMemberUpdateRequest) (*v1.ProjectMemberResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for Update") + } + + var r0 *v1.ProjectMemberResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberUpdateRequest) (*v1.ProjectMemberResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *v1.ProjectMemberUpdateRequest) *v1.ProjectMemberResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*v1.ProjectMemberResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *v1.ProjectMemberUpdateRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewProjectMemberServiceServer creates a new instance of ProjectMemberServiceServer. 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 NewProjectMemberServiceServer(t interface { + mock.TestingT + Cleanup(func()) +}) *ProjectMemberServiceServer { + mock := &ProjectMemberServiceServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/api/v1/mocks/UnsafeProjectMemberServiceServer.go b/api/v1/mocks/UnsafeProjectMemberServiceServer.go new file mode 100644 index 0000000..76fdd0a --- /dev/null +++ b/api/v1/mocks/UnsafeProjectMemberServiceServer.go @@ -0,0 +1,29 @@ +// Code generated by mockery v2.38.0. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// UnsafeProjectMemberServiceServer is an autogenerated mock type for the UnsafeProjectMemberServiceServer type +type UnsafeProjectMemberServiceServer struct { + mock.Mock +} + +// mustEmbedUnimplementedProjectMemberServiceServer provides a mock function with given fields: +func (_m *UnsafeProjectMemberServiceServer) mustEmbedUnimplementedProjectMemberServiceServer() { + _m.Called() +} + +// NewUnsafeProjectMemberServiceServer creates a new instance of UnsafeProjectMemberServiceServer. 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 NewUnsafeProjectMemberServiceServer(t interface { + mock.TestingT + Cleanup(func()) +}) *UnsafeProjectMemberServiceServer { + mock := &UnsafeProjectMemberServiceServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/api/v1/project.pb.go b/api/v1/project.pb.go index fc765eb..b624fc7 100644 --- a/api/v1/project.pb.go +++ b/api/v1/project.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/project.proto diff --git a/api/v1/project_member.pb.go b/api/v1/project_member.pb.go new file mode 100644 index 0000000..0a40acf --- /dev/null +++ b/api/v1/project_member.pb.go @@ -0,0 +1,694 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc (unknown) +// source: v1/project_member.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ProjectMember is the database model +type ProjectMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` + TenantId string `protobuf:"bytes,4,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` +} + +func (x *ProjectMember) Reset() { + *x = ProjectMember{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMember) ProtoMessage() {} + +func (x *ProjectMember) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMember.ProtoReflect.Descriptor instead. +func (*ProjectMember) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{0} +} + +func (x *ProjectMember) GetMeta() *Meta { + if x != nil { + return x.Meta + } + return nil +} + +func (x *ProjectMember) GetProjectId() string { + if x != nil { + return x.ProjectId + } + return "" +} + +func (x *ProjectMember) GetTenantId() string { + if x != nil { + return x.TenantId + } + return "" +} + +type ProjectMemberCreateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectMember *ProjectMember `protobuf:"bytes,1,opt,name=project_member,json=projectMember,proto3" json:"project_member,omitempty"` +} + +func (x *ProjectMemberCreateRequest) Reset() { + *x = ProjectMemberCreateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberCreateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberCreateRequest) ProtoMessage() {} + +func (x *ProjectMemberCreateRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberCreateRequest.ProtoReflect.Descriptor instead. +func (*ProjectMemberCreateRequest) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{1} +} + +func (x *ProjectMemberCreateRequest) GetProjectMember() *ProjectMember { + if x != nil { + return x.ProjectMember + } + return nil +} + +type ProjectMemberUpdateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectMember *ProjectMember `protobuf:"bytes,1,opt,name=project_member,json=projectMember,proto3" json:"project_member,omitempty"` +} + +func (x *ProjectMemberUpdateRequest) Reset() { + *x = ProjectMemberUpdateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberUpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberUpdateRequest) ProtoMessage() {} + +func (x *ProjectMemberUpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberUpdateRequest.ProtoReflect.Descriptor instead. +func (*ProjectMemberUpdateRequest) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{2} +} + +func (x *ProjectMemberUpdateRequest) GetProjectMember() *ProjectMember { + if x != nil { + return x.ProjectMember + } + return nil +} + +type ProjectMemberDeleteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ProjectMemberDeleteRequest) Reset() { + *x = ProjectMemberDeleteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberDeleteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberDeleteRequest) ProtoMessage() {} + +func (x *ProjectMemberDeleteRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberDeleteRequest.ProtoReflect.Descriptor instead. +func (*ProjectMemberDeleteRequest) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{3} +} + +func (x *ProjectMemberDeleteRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ProjectMemberGetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ProjectMemberGetRequest) Reset() { + *x = ProjectMemberGetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberGetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberGetRequest) ProtoMessage() {} + +func (x *ProjectMemberGetRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberGetRequest.ProtoReflect.Descriptor instead. +func (*ProjectMemberGetRequest) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{4} +} + +func (x *ProjectMemberGetRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ProjectMemberFindRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectId *string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3,oneof" json:"project_id,omitempty"` + TenantId *string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3,oneof" json:"tenant_id,omitempty"` + Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ProjectMemberFindRequest) Reset() { + *x = ProjectMemberFindRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberFindRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberFindRequest) ProtoMessage() {} + +func (x *ProjectMemberFindRequest) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberFindRequest.ProtoReflect.Descriptor instead. +func (*ProjectMemberFindRequest) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{5} +} + +func (x *ProjectMemberFindRequest) GetProjectId() string { + if x != nil && x.ProjectId != nil { + return *x.ProjectId + } + return "" +} + +func (x *ProjectMemberFindRequest) GetTenantId() string { + if x != nil && x.TenantId != nil { + return *x.TenantId + } + return "" +} + +func (x *ProjectMemberFindRequest) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +type ProjectMemberResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectMember *ProjectMember `protobuf:"bytes,1,opt,name=project_member,json=projectMember,proto3" json:"project_member,omitempty"` +} + +func (x *ProjectMemberResponse) Reset() { + *x = ProjectMemberResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberResponse) ProtoMessage() {} + +func (x *ProjectMemberResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberResponse.ProtoReflect.Descriptor instead. +func (*ProjectMemberResponse) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{6} +} + +func (x *ProjectMemberResponse) GetProjectMember() *ProjectMember { + if x != nil { + return x.ProjectMember + } + return nil +} + +type ProjectMemberListResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProjectMembers []*ProjectMember `protobuf:"bytes,1,rep,name=project_members,json=projectMembers,proto3" json:"project_members,omitempty"` +} + +func (x *ProjectMemberListResponse) Reset() { + *x = ProjectMemberListResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_project_member_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProjectMemberListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProjectMemberListResponse) ProtoMessage() {} + +func (x *ProjectMemberListResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_project_member_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProjectMemberListResponse.ProtoReflect.Descriptor instead. +func (*ProjectMemberListResponse) Descriptor() ([]byte, []int) { + return file_v1_project_member_proto_rawDescGZIP(), []int{7} +} + +func (x *ProjectMemberListResponse) GetProjectMembers() []*ProjectMember { + if x != nil { + return x.ProjectMembers + } + return nil +} + +var File_v1_project_member_proto protoreflect.FileDescriptor + +var file_v1_project_member_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x76, 0x31, 0x1a, 0x0d, 0x76, + 0x31, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x69, 0x0a, 0x0d, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x56, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, + 0x56, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, + 0x0e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x2c, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x29, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x8e, 0x02, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x46, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, + 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x88, 0x01, + 0x01, 0x12, 0x20, 0x0a, 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x69, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x22, 0x51, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0e, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x22, 0x57, 0x0a, 0x19, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3a, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0e, 0x70, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32, 0xe9, 0x02, + 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x12, 0x1e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x04, 0x46, 0x69, 0x6e, 0x64, 0x12, 0x1c, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, + 0x69, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x6e, 0x0a, 0x06, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x31, 0x42, 0x12, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2d, 0x73, 0x74, 0x61, 0x63, + 0x6b, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x02, 0x56, 0x31, 0xca, 0x02, + 0x02, 0x56, 0x31, 0xe2, 0x02, 0x0e, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x02, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_v1_project_member_proto_rawDescOnce sync.Once + file_v1_project_member_proto_rawDescData = file_v1_project_member_proto_rawDesc +) + +func file_v1_project_member_proto_rawDescGZIP() []byte { + file_v1_project_member_proto_rawDescOnce.Do(func() { + file_v1_project_member_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_project_member_proto_rawDescData) + }) + return file_v1_project_member_proto_rawDescData +} + +var file_v1_project_member_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_v1_project_member_proto_goTypes = []interface{}{ + (*ProjectMember)(nil), // 0: v1.ProjectMember + (*ProjectMemberCreateRequest)(nil), // 1: v1.ProjectMemberCreateRequest + (*ProjectMemberUpdateRequest)(nil), // 2: v1.ProjectMemberUpdateRequest + (*ProjectMemberDeleteRequest)(nil), // 3: v1.ProjectMemberDeleteRequest + (*ProjectMemberGetRequest)(nil), // 4: v1.ProjectMemberGetRequest + (*ProjectMemberFindRequest)(nil), // 5: v1.ProjectMemberFindRequest + (*ProjectMemberResponse)(nil), // 6: v1.ProjectMemberResponse + (*ProjectMemberListResponse)(nil), // 7: v1.ProjectMemberListResponse + nil, // 8: v1.ProjectMemberFindRequest.AnnotationsEntry + (*Meta)(nil), // 9: v1.Meta +} +var file_v1_project_member_proto_depIdxs = []int32{ + 9, // 0: v1.ProjectMember.meta:type_name -> v1.Meta + 0, // 1: v1.ProjectMemberCreateRequest.project_member:type_name -> v1.ProjectMember + 0, // 2: v1.ProjectMemberUpdateRequest.project_member:type_name -> v1.ProjectMember + 8, // 3: v1.ProjectMemberFindRequest.annotations:type_name -> v1.ProjectMemberFindRequest.AnnotationsEntry + 0, // 4: v1.ProjectMemberResponse.project_member:type_name -> v1.ProjectMember + 0, // 5: v1.ProjectMemberListResponse.project_members:type_name -> v1.ProjectMember + 1, // 6: v1.ProjectMemberService.Create:input_type -> v1.ProjectMemberCreateRequest + 2, // 7: v1.ProjectMemberService.Update:input_type -> v1.ProjectMemberUpdateRequest + 3, // 8: v1.ProjectMemberService.Delete:input_type -> v1.ProjectMemberDeleteRequest + 4, // 9: v1.ProjectMemberService.Get:input_type -> v1.ProjectMemberGetRequest + 5, // 10: v1.ProjectMemberService.Find:input_type -> v1.ProjectMemberFindRequest + 6, // 11: v1.ProjectMemberService.Create:output_type -> v1.ProjectMemberResponse + 6, // 12: v1.ProjectMemberService.Update:output_type -> v1.ProjectMemberResponse + 6, // 13: v1.ProjectMemberService.Delete:output_type -> v1.ProjectMemberResponse + 6, // 14: v1.ProjectMemberService.Get:output_type -> v1.ProjectMemberResponse + 7, // 15: v1.ProjectMemberService.Find:output_type -> v1.ProjectMemberListResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_v1_project_member_proto_init() } +func file_v1_project_member_proto_init() { + if File_v1_project_member_proto != nil { + return + } + file_v1_meta_proto_init() + if !protoimpl.UnsafeEnabled { + file_v1_project_member_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberCreateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberUpdateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberDeleteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberGetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberFindRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_project_member_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProjectMemberListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_v1_project_member_proto_msgTypes[5].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_v1_project_member_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_v1_project_member_proto_goTypes, + DependencyIndexes: file_v1_project_member_proto_depIdxs, + MessageInfos: file_v1_project_member_proto_msgTypes, + }.Build() + File_v1_project_member_proto = out.File + file_v1_project_member_proto_rawDesc = nil + file_v1_project_member_proto_goTypes = nil + file_v1_project_member_proto_depIdxs = nil +} diff --git a/api/v1/project_member_grpc.pb.go b/api/v1/project_member_grpc.pb.go new file mode 100644 index 0000000..a5fbb4d --- /dev/null +++ b/api/v1/project_member_grpc.pb.go @@ -0,0 +1,255 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: v1/project_member.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ProjectMemberService_Create_FullMethodName = "/v1.ProjectMemberService/Create" + ProjectMemberService_Update_FullMethodName = "/v1.ProjectMemberService/Update" + ProjectMemberService_Delete_FullMethodName = "/v1.ProjectMemberService/Delete" + ProjectMemberService_Get_FullMethodName = "/v1.ProjectMemberService/Get" + ProjectMemberService_Find_FullMethodName = "/v1.ProjectMemberService/Find" +) + +// ProjectMemberServiceClient is the client API for ProjectMemberService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ProjectMemberServiceClient interface { + Create(ctx context.Context, in *ProjectMemberCreateRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) + Update(ctx context.Context, in *ProjectMemberUpdateRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) + Delete(ctx context.Context, in *ProjectMemberDeleteRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) + Get(ctx context.Context, in *ProjectMemberGetRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) + Find(ctx context.Context, in *ProjectMemberFindRequest, opts ...grpc.CallOption) (*ProjectMemberListResponse, error) +} + +type projectMemberServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewProjectMemberServiceClient(cc grpc.ClientConnInterface) ProjectMemberServiceClient { + return &projectMemberServiceClient{cc} +} + +func (c *projectMemberServiceClient) Create(ctx context.Context, in *ProjectMemberCreateRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) { + out := new(ProjectMemberResponse) + err := c.cc.Invoke(ctx, ProjectMemberService_Create_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectMemberServiceClient) Update(ctx context.Context, in *ProjectMemberUpdateRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) { + out := new(ProjectMemberResponse) + err := c.cc.Invoke(ctx, ProjectMemberService_Update_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectMemberServiceClient) Delete(ctx context.Context, in *ProjectMemberDeleteRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) { + out := new(ProjectMemberResponse) + err := c.cc.Invoke(ctx, ProjectMemberService_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectMemberServiceClient) Get(ctx context.Context, in *ProjectMemberGetRequest, opts ...grpc.CallOption) (*ProjectMemberResponse, error) { + out := new(ProjectMemberResponse) + err := c.cc.Invoke(ctx, ProjectMemberService_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *projectMemberServiceClient) Find(ctx context.Context, in *ProjectMemberFindRequest, opts ...grpc.CallOption) (*ProjectMemberListResponse, error) { + out := new(ProjectMemberListResponse) + err := c.cc.Invoke(ctx, ProjectMemberService_Find_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ProjectMemberServiceServer is the server API for ProjectMemberService service. +// All implementations should embed UnimplementedProjectMemberServiceServer +// for forward compatibility +type ProjectMemberServiceServer interface { + Create(context.Context, *ProjectMemberCreateRequest) (*ProjectMemberResponse, error) + Update(context.Context, *ProjectMemberUpdateRequest) (*ProjectMemberResponse, error) + Delete(context.Context, *ProjectMemberDeleteRequest) (*ProjectMemberResponse, error) + Get(context.Context, *ProjectMemberGetRequest) (*ProjectMemberResponse, error) + Find(context.Context, *ProjectMemberFindRequest) (*ProjectMemberListResponse, error) +} + +// UnimplementedProjectMemberServiceServer should be embedded to have forward compatible implementations. +type UnimplementedProjectMemberServiceServer struct { +} + +func (UnimplementedProjectMemberServiceServer) Create(context.Context, *ProjectMemberCreateRequest) (*ProjectMemberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") +} +func (UnimplementedProjectMemberServiceServer) Update(context.Context, *ProjectMemberUpdateRequest) (*ProjectMemberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedProjectMemberServiceServer) Delete(context.Context, *ProjectMemberDeleteRequest) (*ProjectMemberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedProjectMemberServiceServer) Get(context.Context, *ProjectMemberGetRequest) (*ProjectMemberResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedProjectMemberServiceServer) Find(context.Context, *ProjectMemberFindRequest) (*ProjectMemberListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Find not implemented") +} + +// UnsafeProjectMemberServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ProjectMemberServiceServer will +// result in compilation errors. +type UnsafeProjectMemberServiceServer interface { + mustEmbedUnimplementedProjectMemberServiceServer() +} + +func RegisterProjectMemberServiceServer(s grpc.ServiceRegistrar, srv ProjectMemberServiceServer) { + s.RegisterService(&ProjectMemberService_ServiceDesc, srv) +} + +func _ProjectMemberService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProjectMemberCreateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectMemberServiceServer).Create(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectMemberService_Create_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectMemberServiceServer).Create(ctx, req.(*ProjectMemberCreateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectMemberService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProjectMemberUpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectMemberServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectMemberService_Update_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectMemberServiceServer).Update(ctx, req.(*ProjectMemberUpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectMemberService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProjectMemberDeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectMemberServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectMemberService_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectMemberServiceServer).Delete(ctx, req.(*ProjectMemberDeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectMemberService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProjectMemberGetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectMemberServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectMemberService_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectMemberServiceServer).Get(ctx, req.(*ProjectMemberGetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ProjectMemberService_Find_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProjectMemberFindRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProjectMemberServiceServer).Find(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProjectMemberService_Find_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProjectMemberServiceServer).Find(ctx, req.(*ProjectMemberFindRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ProjectMemberService_ServiceDesc is the grpc.ServiceDesc for ProjectMemberService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ProjectMemberService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "v1.ProjectMemberService", + HandlerType: (*ProjectMemberServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Create", + Handler: _ProjectMemberService_Create_Handler, + }, + { + MethodName: "Update", + Handler: _ProjectMemberService_Update_Handler, + }, + { + MethodName: "Delete", + Handler: _ProjectMemberService_Delete_Handler, + }, + { + MethodName: "Get", + Handler: _ProjectMemberService_Get_Handler, + }, + { + MethodName: "Find", + Handler: _ProjectMemberService_Find_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "v1/project_member.proto", +} diff --git a/api/v1/projectmember.go b/api/v1/projectmember.go new file mode 100644 index 0000000..78416a3 --- /dev/null +++ b/api/v1/projectmember.go @@ -0,0 +1,15 @@ +package v1 + +//go:generate go run ../../pkg/gen/genscanvaluer.go -package v1 -type ProjectMember + +func (m *ProjectMember) NewProjectMemberResponse() *ProjectMemberResponse { + return &ProjectMemberResponse{ + ProjectMember: m, + } +} + +func (m *ProjectMemberDeleteRequest) NewProjectMember() *ProjectMember { + return &ProjectMember{ + Meta: &Meta{Id: m.Id}, + } +} diff --git a/api/v1/projectmember_scnrvalr.go b/api/v1/projectmember_scnrvalr.go new file mode 100644 index 0000000..52be0ee --- /dev/null +++ b/api/v1/projectmember_scnrvalr.go @@ -0,0 +1,62 @@ +// This file was automatically generated by pkg/gen/genscanvaluer. +// DO NOT EDIT MANUALLY. +// Regenerate with "go generate" or "make generate" + +package v1 + +import ( + "database/sql/driver" + "fmt" +) + +func (p *ProjectMember) Schema() string { + return ` + CREATE TABLE IF NOT EXISTS projectmembers ( + id text PRIMARY KEY NOT NULL, + projectmember JSONB NOT NULL + ); + CREATE INDEX IF NOT EXISTS projectmember_idx ON projectmembers USING GIN(projectmember); + + CREATE TABLE IF NOT EXISTS projectmembers_history ( + id text NOT NULL, + op char NOT NULL, + created_at timestamptz NOT NULL, + projectmember JSONB NOT NULL + ); + CREATE INDEX IF NOT EXISTS projectmembers_history_id_created_at_idx ON projectmembers_history USING btree(id, created_at); +` +} + +func (p *ProjectMember) JSONField() string { + return "projectmember" +} + +func (p *ProjectMember) TableName() string { + return "projectmembers" +} + +func (p *ProjectMember) Kind() string { + return "ProjectMember" +} + +func (p *ProjectMember) APIVersion() string { + return "v1" +} + +// Value make the ProjectMember struct implement the driver.Valuer interface. This method +// simply returns the JSON-encoded representation of the struct. +func (p *ProjectMember) Value() (driver.Value, error) { + return json.Marshal(p) +} + +// Scan make the ProjectMember struct implement the sql.Scanner interface. This method +// simply decodes a JSON-encoded value into the struct fields. +func (p *ProjectMember) Scan(value any) error { + b, ok := value.([]byte) + if !ok { + return fmt.Errorf("type assertion to []byte failed") + } + + err := json.Unmarshal(b, p) + return err +} diff --git a/api/v1/quota.pb.go b/api/v1/quota.pb.go index dc5fec9..e40e488 100644 --- a/api/v1/quota.pb.go +++ b/api/v1/quota.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/quota.proto diff --git a/api/v1/tenant.pb.go b/api/v1/tenant.pb.go index dad60dd..ec6a06c 100644 --- a/api/v1/tenant.pb.go +++ b/api/v1/tenant.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: v1/tenant.proto diff --git a/certs/ca-key.pem b/certs/ca-key.pem index 43ed5f5..606c54e 100644 --- a/certs/ca-key.pem +++ b/certs/ca-key.pem @@ -1,5 +1,5 @@ -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIA52Gc6UbFBZ5ELzdZAVHTzZQP6/9um7WcLB3QKVFIxXoAoGCCqGSM49 -AwEHoUQDQgAEo1oatHkBgdpuR22CmCn6A5QEkanNFSPvLHqPWAC7dh/Dz5FXVBUX -bs2sWUghHpx3ertviRciVMKPvZHZ+R+8UQ== +MHcCAQEEIN4GTYJJuKRDR7ym1lmj4P3PuGAmA16iLd4C4vmDrHoJoAoGCCqGSM49 +AwEHoUQDQgAEpImXxsye/c/QpKwh13CYSr+UJd0/cfMX03JAdR3G/h2sXEF/T1XM +YhgzxQLDiz7N4qaWf5lqQOMKMTxxNngagw== -----END EC PRIVATE KEY----- diff --git a/certs/ca.csr b/certs/ca.csr index 4942ec7..4b1c28c 100644 --- a/certs/ca.csr +++ b/certs/ca.csr @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE REQUEST----- -MIH5MIGfAgEAMD0xCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZNdW5pY2gxEDAOBgNV +MIH4MIGfAgEAMD0xCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZNdW5pY2gxEDAOBgNV BAcTB0JhdmFyaWExCzAJBgNVBAMTAmNhMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD -QgAEo1oatHkBgdpuR22CmCn6A5QEkanNFSPvLHqPWAC7dh/Dz5FXVBUXbs2sWUgh -Hpx3ertviRciVMKPvZHZ+R+8UaAAMAoGCCqGSM49BAMCA0kAMEYCIQCj6hZWIJmM -2j7kCC+p9E+DvUMCW8Hbk+NC0YROq1qZnwIhAMbaQEUlySoWyYjLfK44ArY9tEt4 -CUwUMoSh3JJtGWj3 +QgAEpImXxsye/c/QpKwh13CYSr+UJd0/cfMX03JAdR3G/h2sXEF/T1XMYhgzxQLD +iz7N4qaWf5lqQOMKMTxxNngag6AAMAoGCCqGSM49BAMCA0gAMEUCIQDIAbbXiJkF +mTiIkUBfzrx1YcfynMYyi1U0RBOPNq4orQIgUd6CJ59Rw+vmqvvoXrn90KGKwaCE +/fEtyUF0bza7Jio= -----END CERTIFICATE REQUEST----- diff --git a/certs/ca.pem b/certs/ca.pem index a78172b..83cd3ba 100644 --- a/certs/ca.pem +++ b/certs/ca.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE----- -MIIB4jCCAYigAwIBAgIUbl1BqMUaI/O4GIGlkHKKEr0i2OowCgYIKoZIzj0EAwIw +MIIB4zCCAYigAwIBAgIUFxYna1ghzd++P9ZPECkZ2fA3+aYwCgYIKoZIzj0EAwIw PTELMAkGA1UEBhMCREUxDzANBgNVBAgTBk11bmljaDEQMA4GA1UEBxMHQmF2YXJp -YTELMAkGA1UEAxMCY2EwHhcNMjQwMTI3MTExOTAwWhcNMjkwMTI1MTExOTAwWjA9 +YTELMAkGA1UEAxMCY2EwHhcNMjQwMjA2MTY0NTAwWhcNMjkwMjA0MTY0NTAwWjA9 MQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYDVQQHEwdCYXZhcmlh -MQswCQYDVQQDEwJjYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKNaGrR5AYHa -bkdtgpgp+gOUBJGpzRUj7yx6j1gAu3Yfw8+RV1QVF27NrFlIIR6cd3q7b4kXIlTC -j72R2fkfvFGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEC -MB0GA1UdDgQWBBSxcMm78zzLrnJL1sbHn0Ls/ndvaTAfBgNVHSMEGDAWgBSxcMm7 -8zzLrnJL1sbHn0Ls/ndvaTAKBggqhkjOPQQDAgNIADBFAiBLkfC7bGdaJEoxUMfX -82RbO259J2oWw8d4PmAgrBBIfAIhAJCtBdK90MDj1bkF1P7skxLaTlXWeIJT6mZE -PpCwDcE+ +MQswCQYDVQQDEwJjYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKSJl8bMnv3P +0KSsIddwmEq/lCXdP3HzF9NyQHUdxv4drFxBf09VzGIYM8UCw4s+zeKmln+ZakDj +CjE8cTZ4GoOjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEC +MB0GA1UdDgQWBBQAwjY+rgS3RJdYDU5Sqdwf2ik4ezAfBgNVHSMEGDAWgBQAwjY+ +rgS3RJdYDU5Sqdwf2ik4ezAKBggqhkjOPQQDAgNJADBGAiEA827cGYKaSgHwbMaC +kbyNKtDUaeQV8U5I6/KBxim5iHgCIQD2LlFilUlAiIwUq6cEkdqotH/q99DooXsP +wOPXlugYLA== -----END CERTIFICATE----- diff --git a/certs/client-key.pem b/certs/client-key.pem index 54ffd1d..0a67f62 100644 --- a/certs/client-key.pem +++ b/certs/client-key.pem @@ -1,5 +1,5 @@ -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIPkX5GNPBF4g19xB8ZtqbiMVoSS9iJit9Anp8xqbMWxToAoGCCqGSM49 -AwEHoUQDQgAEOKmVcTLdVLy4m1jcGkRy+VkJhR+crFquEFcRZu/GQQYlj6jIebAV -6iyTjMvG+PoC0dIM/OFA/fzXbDZGpPTt9w== +MHcCAQEEIDUzDpGw7ageDgXKRX0Ek7c7+Xu4Wd50iD92yETMtgSyoAoGCCqGSM49 +AwEHoUQDQgAE+KuGno/NozQpZ9wAUOYg3aFvTSgMBlT0X5/1M/b2SegP3eSvNdxU ++BeBaaLeD3azVZKJtqevrtrFg1Vu0g0jdw== -----END EC PRIVATE KEY----- diff --git a/certs/client.csr b/certs/client.csr index 7277b4c..360e86d 100644 --- a/certs/client.csr +++ b/certs/client.csr @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIBGTCBwQIBADBBMQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYD +MIIBGzCBwQIBADBBMQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYD VQQHEwdCYXZhcmlhMQ8wDQYDVQQDEwZjbGllbnQwWTATBgcqhkjOPQIBBggqhkjO -PQMBBwNCAAQ4qZVxMt1UvLibWNwaRHL5WQmFH5ysWq4QVxFm78ZBBiWPqMh5sBXq -LJOMy8b4+gLR0gz84UD9/NdsNkak9O33oB4wHAYJKoZIhvcNAQkOMQ8wDTALBgNV -HREEBDACggAwCgYIKoZIzj0EAwIDRwAwRAIgUE5e2VYI56INgQsivZvjowpDh8jM -uMWSxO//F01lOFQCID16Q2RHQR9Uw3NwskNC/jII8lOMp9kRWwu4A+YGWobF +PQMBBwNCAAT4q4aej82jNCln3ABQ5iDdoW9NKAwGVPRfn/Uz9vZJ6A/d5K813FT4 +F4Fpot4PdrNVkom2p6+u2sWDVW7SDSN3oB4wHAYJKoZIhvcNAQkOMQ8wDTALBgNV +HREEBDACggAwCgYIKoZIzj0EAwIDSQAwRgIhAOafckME3cqXCeXeycWtP9yHBhSD ++xBvFSXgP8JYq4HjAiEA/NWlCfsDOuS7RzZahgdyfBavd0ylRHAHZzkW6ieMLzM= -----END CERTIFICATE REQUEST----- diff --git a/certs/client.pem b/certs/client.pem index bb763e4..c496def 100644 --- a/certs/client.pem +++ b/certs/client.pem @@ -1,13 +1,13 @@ -----BEGIN CERTIFICATE----- -MIICBDCCAaqgAwIBAgIUGlhVhBxBSFlSQbRq20HXFyDKBQIwCgYIKoZIzj0EAwIw +MIICAzCCAaqgAwIBAgIUDL5gilHcBInoZnkwupRpN57gMGYwCgYIKoZIzj0EAwIw PTELMAkGA1UEBhMCREUxDzANBgNVBAgTBk11bmljaDEQMA4GA1UEBxMHQmF2YXJp -YTELMAkGA1UEAxMCY2EwHhcNMjQwMTI3MTExOTAwWhcNMjUwMTI2MTExOTAwWjBB +YTELMAkGA1UEAxMCY2EwHhcNMjQwMjA2MTY0NTAwWhcNMjUwMjA1MTY0NTAwWjBB MQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYDVQQHEwdCYXZhcmlh -MQ8wDQYDVQQDEwZjbGllbnQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ4qZVx -Mt1UvLibWNwaRHL5WQmFH5ysWq4QVxFm78ZBBiWPqMh5sBXqLJOMy8b4+gLR0gz8 -4UD9/NdsNkak9O33o4GDMIGAMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggr -BgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSuZzkVr5S8YQZ9Eq8EpZrk -OnrXuTAfBgNVHSMEGDAWgBSxcMm78zzLrnJL1sbHn0Ls/ndvaTALBgNVHREEBDAC -ggAwCgYIKoZIzj0EAwIDSAAwRQIgPFJKCjgLBsfS5uSdC1uP0shT3KLNHJpGnxxg -WsL7SAICIQCfYTCbC7KGtZbQhyHkbEnzXzw3IwGRBd8u/W1ICr8qWg== +MQ8wDQYDVQQDEwZjbGllbnQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT4q4ae +j82jNCln3ABQ5iDdoW9NKAwGVPRfn/Uz9vZJ6A/d5K813FT4F4Fpot4PdrNVkom2 +p6+u2sWDVW7SDSN3o4GDMIGAMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggr +BgEFBQcDAjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQMvyMgGCimPRenGUGDMeRp +lSWd3DAfBgNVHSMEGDAWgBQAwjY+rgS3RJdYDU5Sqdwf2ik4ezALBgNVHREEBDAC +ggAwCgYIKoZIzj0EAwIDRwAwRAIgCtIjs1kyDCxigwhO2ZhocT8TOLOMVYvTg7nQ +aUt7EJkCIHzA/BnmqjVCU2z4vnugZqw0GvRSaOsOHk3W8Msb5Le2 -----END CERTIFICATE----- diff --git a/certs/server-key.pem b/certs/server-key.pem index 5b3a8a1..752c7f2 100644 --- a/certs/server-key.pem +++ b/certs/server-key.pem @@ -1,5 +1,5 @@ -----BEGIN EC PRIVATE KEY----- -MHcCAQEEIFqZ55EEbkXSisqzUNh1qV/o7i1Ll6LITNpUNImTMJ26oAoGCCqGSM49 -AwEHoUQDQgAEr2smimmUgS7y/YbF/wBYJ282Ndiusq2Y8w06ypaGCDGTVbeFxI5e -tz5sQPU1kNq40zIgMjXuQ8F5lF9l5t5l3g== +MHcCAQEEILDuGCZl7sZhA2WSr0ul02ODmWrtB1nlr6KZiem/R86/oAoGCCqGSM49 +AwEHoUQDQgAEdpTkKTd3R7KHsRYeL9fTnNdiuNoEsbHxZnWcpvhqnqO5VdFu3swK +W10Ymjbnj5j+6P/ISwYiKrmiFnZSf229NQ== -----END EC PRIVATE KEY----- diff --git a/certs/server.csr b/certs/server.csr index 5c48397..1239753 100644 --- a/certs/server.csr +++ b/certs/server.csr @@ -1,9 +1,9 @@ -----BEGIN CERTIFICATE REQUEST----- -MIIBJTCBzQIBADBEMQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYD +MIIBJjCBzQIBADBEMQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYD VQQHEwdCYXZhcmlhMRIwEAYDVQQDEwlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggq -hkjOPQMBBwNCAASvayaKaZSBLvL9hsX/AFgnbzY12K6yrZjzDTrKloYIMZNVt4XE -jl63PmxA9TWQ2rjTMiAyNe5DwXmUX2Xm3mXeoCcwJQYJKoZIhvcNAQkOMRgwFjAU -BgNVHREEDTALgglsb2NhbGhvc3QwCgYIKoZIzj0EAwIDRwAwRAIgR99yEScjOz2c -1kl8YLT1ShKzq3C1QFpyvg5hgUemgk4CICVzOmFjJa0TPbkVSroG22yrO6Lb1FJ1 -0kzrPeWhMyHE +hkjOPQMBBwNCAAR2lOQpN3dHsoexFh4v19Oc12K42gSxsfFmdZym+Gqeo7lV0W7e +zApbXRiaNuePmP7o/8hLBiIquaIWdlJ/bb01oCcwJQYJKoZIhvcNAQkOMRgwFjAU +BgNVHREEDTALgglsb2NhbGhvc3QwCgYIKoZIzj0EAwIDSAAwRQIhAOmgCL0E5Xj8 +ULhUf4wuIcBC1k5aXs2wynhQUtKYR5rCAiAmu3WC+re4K1vPJJwxgjjwiJr5yF9L +j0oolWilNYcE0w== -----END CERTIFICATE REQUEST----- diff --git a/certs/server.pem b/certs/server.pem index 770bac4..4b97cf1 100644 --- a/certs/server.pem +++ b/certs/server.pem @@ -1,14 +1,14 @@ -----BEGIN CERTIFICATE----- -MIICGzCCAcCgAwIBAgIUIgI95M8+DLLE4PnWU96pFGibJP4wCgYIKoZIzj0EAwIw +MIICGjCCAcCgAwIBAgIUWa6tjanLPx+KTcj2UM9i7wA5x+swCgYIKoZIzj0EAwIw PTELMAkGA1UEBhMCREUxDzANBgNVBAgTBk11bmljaDEQMA4GA1UEBxMHQmF2YXJp -YTELMAkGA1UEAxMCY2EwHhcNMjQwMTI3MTExOTAwWhcNMjUwMTI2MTExOTAwWjBE +YTELMAkGA1UEAxMCY2EwHhcNMjQwMjA2MTY0NTAwWhcNMjUwMjA1MTY0NTAwWjBE MQswCQYDVQQGEwJERTEPMA0GA1UECBMGTXVuaWNoMRAwDgYDVQQHEwdCYXZhcmlh -MRIwEAYDVQQDEwlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASv -ayaKaZSBLvL9hsX/AFgnbzY12K6yrZjzDTrKloYIMZNVt4XEjl63PmxA9TWQ2rjT -MiAyNe5DwXmUX2Xm3mXeo4GWMIGTMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAU -BggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQU28Xi -uhFuy3Q1luRtXM4o3bEE9awwHwYDVR0jBBgwFoAUsXDJu/M8y65yS9bGx59C7P53 -b2kwFAYDVR0RBA0wC4IJbG9jYWxob3N0MAoGCCqGSM49BAMCA0kAMEYCIQCenXcq -98sLdJ4kLqjQu3ueSbTVCLuqEWLo0O6ERipQowIhANtCmZ3dH+pLp3U421F2g4Np -1IvFJDhEoZ7ZAXcvy8Mu +MRIwEAYDVQQDEwlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR2 +lOQpN3dHsoexFh4v19Oc12K42gSxsfFmdZym+Gqeo7lV0W7ezApbXRiaNuePmP7o +/8hLBiIquaIWdlJ/bb01o4GWMIGTMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAU +BggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUKzNk +/EcAupZIADSZfI+z8XJ4W98wHwYDVR0jBBgwFoAUAMI2Pq4Et0SXWA1OUqncH9op +OHswFAYDVR0RBA0wC4IJbG9jYWxob3N0MAoGCCqGSM49BAMCA0gAMEUCIQCmmjM3 +z4v8btONqV+jZQjIIwOpez6vrsAJit67oKGAVQIgc+innrlfZiIISlFaWF1SBrwK +xEishfdnkuXkBA+YgVM= -----END CERTIFICATE----- diff --git a/client/main.go b/client/main.go index 886ec53..83b300d 100644 --- a/client/main.go +++ b/client/main.go @@ -147,6 +147,18 @@ func projectExample(c client.Client, log *slog.Logger) error { log.Info("found project", "project", p) } + pmcr, err := c.ProjectMember().Create(ctx, &v1.ProjectMemberCreateRequest{ + ProjectMember: &v1.ProjectMember{ + ProjectId: projectId, + TenantId: "customer-1", + }, + }) + if err != nil { + return err + } + + log.Info("projectmember created", slog.Any("member", pmcr.ProjectMember)) + // delete projects for _, p := range pfr.GetProjects() { pdr := v1.ProjectDeleteRequest{ diff --git a/go.mod b/go.mod index 410ce32..9658326 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/metal-stack/masterdata-api -go 1.21 +go 1.22 require ( github.com/Masterminds/squirrel v1.5.4 @@ -13,21 +13,22 @@ require ( github.com/lib/pq v1.10.9 github.com/lopezator/migrator v0.3.1 github.com/metal-stack/metal-lib v0.14.4 - github.com/metal-stack/security v0.7.1 + github.com/metal-stack/security v0.7.2 github.com/metal-stack/v v1.0.3 github.com/prometheus/client_golang v1.18.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 - github.com/testcontainers/testcontainers-go v0.27.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 - go.opentelemetry.io/otel/trace v1.22.0 - google.golang.org/grpc v1.61.0 + github.com/testcontainers/testcontainers-go v0.28.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 + go.opentelemetry.io/otel/trace v1.23.1 + google.golang.org/grpc v1.62.0 google.golang.org/protobuf v1.32.0 sigs.k8s.io/yaml v1.4.0 ) require ( + cloud.google.com/go/compute v1.24.0 // indirect dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -43,7 +44,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v25.0.2+incompatible // indirect + github.com/docker/docker v25.0.3+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -65,14 +66,14 @@ require ( github.com/icza/dyno v0.0.0-20230330125955-09f820a8d9c0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.17.5 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc v1.0.4 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect - github.com/lestrrat-go/jwx/v2 v2.0.19 // indirect + github.com/lestrrat-go/jwx/v2 v2.0.20 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -87,13 +88,13 @@ require ( github.com/morikuni/aec v1.0.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc6 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect @@ -110,23 +111,24 @@ require ( github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect + go.opentelemetry.io/otel v1.23.1 // indirect + go.opentelemetry.io/otel/metric v1.23.1 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.17.0 // indirect + golang.org/x/tools v0.18.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index cf6c48e..9376043 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ -cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= -cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= -cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= @@ -23,8 +23,8 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY= -github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is= github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -44,14 +44,14 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v25.0.2+incompatible h1:/OaKeauroa10K4Nqavw4zlhcDq/WBcPMc5DbjOGgozY= -github.com/docker/docker v25.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= +github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -100,9 +100,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -149,9 +147,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= -github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -168,8 +165,8 @@ github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJG github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= -github.com/lestrrat-go/jwx/v2 v2.0.19 h1:ekv1qEZE6BVct89QA+pRF6+4pCpfVrOnEJnTnT4RXoY= -github.com/lestrrat-go/jwx/v2 v2.0.19/go.mod h1:l3im3coce1lL2cDeAjqmaR+Awx+X8Ih+2k8BuHNJ4CU= +github.com/lestrrat-go/jwx/v2 v2.0.20 h1:sAgXuWS/t8ykxS9Bi2Qtn5Qhpakw1wrcjxChudjolCc= +github.com/lestrrat-go/jwx/v2 v2.0.20/go.mod h1:UlCSmKqw+agm5BsOBfEAbTvKsEApaGNqHAEUTv5PJC4= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -188,8 +185,8 @@ github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRU github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/metal-stack/metal-lib v0.14.4 h1:vm2868vcua6khoyWL7d0to8Hq5RayrjMse0FZTyWEec= github.com/metal-stack/metal-lib v0.14.4/go.mod h1:Z3PAh8dkyWC4B19fXsu6EYwXXee0Lk9JZbjoHPLbDbc= -github.com/metal-stack/security v0.7.1 h1:bwiPhT/gArl9IRJlhpDZzAs5Us6rmIt9bcuQXcLKO5k= -github.com/metal-stack/security v0.7.1/go.mod h1:v+JrV2tIvoKESY0puONL3rAocfLkol1pqm2osm9PLcw= +github.com/metal-stack/security v0.7.2 h1:kUdWej+a0+YPBGt4fT56Mu8cWX/tOjeKL/FWNlUuoe8= +github.com/metal-stack/security v0.7.2/go.mod h1:dTidiZIEzZajwqizrOCTJbmjQSYVbe1tG52IoMlnKZo= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= github.com/metal-stack/v v1.0.3/go.mod h1:YTahEu7/ishwpYKnp/VaW/7nf8+PInogkfGwLcGPdXg= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= @@ -207,15 +204,14 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc6 h1:XDqvyKsJEbRtATzkgItUqBA7QHk58yxX1Ov9HERHNqU= -github.com/opencontainers/image-spec v1.1.0-rc6/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -224,14 +220,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= -github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= @@ -279,42 +275,38 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/testcontainers/testcontainers-go v0.27.0 h1:IeIrJN4twonTDuMuBNQdKZ+K97yd7VrmNGu+lDpYcDk= -github.com/testcontainers/testcontainers-go v0.27.0/go.mod h1:+HgYZcd17GshBUZv9b+jKFJ198heWPQq3KQIp2+N+7U= +github.com/testcontainers/testcontainers-go v0.28.0 h1:1HLm9qm+J5VikzFDYhOd+Zw12NtOl+8drH2E8nTY1r8= +github.com/testcontainers/testcontainers-go v0.28.0/go.mod h1:COlDpUXbwW3owtpMkEB1zo9gwb1CoKVKlyrVPejF4AU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4= github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4= github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 h1:P+/g8GpuJGYbOp2tAdKrIPUX9JO02q8Q0YNlHolpibA= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0/go.mod h1:tIKj3DbO8N9Y2xo52og3irLsPI4GW02DSMtrVgNMgxg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 h1:doUP+ExOpH3spVTLS0FcWGLnQrPct/hD/bCPbDRUEAU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0/go.mod h1:rdENBZMT2OE6Ne/KLwpiXudnAsbdrdBaqBvTN8M8BgA= +go.opentelemetry.io/otel v1.23.1 h1:Za4UzOqJYS+MUczKI320AtqZHZb7EqxO00jAHE0jmQY= +go.opentelemetry.io/otel v1.23.1/go.mod h1:Td0134eafDLcTS4y+zQ26GE8u3dEuRBiBCTUIRHaikA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= -go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyelTl2rlo= +go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8= +go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -324,27 +316,25 @@ golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -357,7 +347,6 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -366,16 +355,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= @@ -385,20 +373,20 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= +google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= diff --git a/pkg/client/client.go b/pkg/client/client.go index 53c17f8..464195f 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -19,6 +19,7 @@ import ( // Client defines the client API type Client interface { Project() v1.ProjectServiceClient + ProjectMember() v1.ProjectMemberServiceClient Tenant() v1.TenantServiceClient Close() error } @@ -113,6 +114,11 @@ func (c GRPCClient) Project() v1.ProjectServiceClient { return v1.NewProjectServiceClient(c.conn) } +// ProjectMember is the root accessor for project member related functions +func (c GRPCClient) ProjectMember() v1.ProjectMemberServiceClient { + return v1.NewProjectMemberServiceClient(c.conn) +} + // Tenant is the root accessor for tenant related functions func (c GRPCClient) Tenant() v1.TenantServiceClient { return v1.NewTenantServiceClient(c.conn) diff --git a/pkg/service/project.go b/pkg/service/project.go index af13e79..8936506 100644 --- a/pkg/service/project.go +++ b/pkg/service/project.go @@ -121,10 +121,7 @@ func (s *projectService) Find(ctx context.Context, req *v1.ProjectFindRequest) ( return nil, err } resp := new(v1.ProjectListResponse) - for i := range res { - p := res[i] - resp.Projects = append(resp.Projects, p) - } + resp.Projects = append(resp.Projects, res...) resp.NextPage = nextPage return resp, nil } diff --git a/pkg/service/projectmember.go b/pkg/service/projectmember.go new file mode 100644 index 0000000..a14e2dc --- /dev/null +++ b/pkg/service/projectmember.go @@ -0,0 +1,106 @@ +package service + +import ( + "context" + "fmt" + "log/slog" + + "github.com/jmoiron/sqlx" + v1 "github.com/metal-stack/masterdata-api/api/v1" + "github.com/metal-stack/masterdata-api/pkg/datastore" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type projectMemberService struct { + projectMemberStore datastore.Storage[*v1.ProjectMember] + tenantStore datastore.Storage[*v1.Tenant] + projectStore datastore.Storage[*v1.Project] + log *slog.Logger +} + +func NewProjectMemberService(db *sqlx.DB, l *slog.Logger) (*projectMemberService, error) { + pms, err := datastore.New(l, db, &v1.ProjectMember{}) + if err != nil { + return nil, err + } + ts, err := datastore.New(l, db, &v1.Tenant{}) + if err != nil { + return nil, err + } + ps, err := datastore.New(l, db, &v1.Project{}) + if err != nil { + return nil, err + } + return &projectMemberService{ + projectMemberStore: NewStorageStatusWrapper(pms), + tenantStore: NewStorageStatusWrapper(ts), + projectStore: NewStorageStatusWrapper(ps), + log: l, + }, nil +} + +func (s *projectMemberService) Create(ctx context.Context, req *v1.ProjectMemberCreateRequest) (*v1.ProjectMemberResponse, error) { + projectMember := req.ProjectMember + + _, err := s.tenantStore.Get(ctx, projectMember.GetTenantId()) + if err != nil && v1.IsNotFound(err) { + return nil, status.Error(codes.NotFound, fmt.Sprintf("unable to find tenant:%s for projectMember", projectMember.GetTenantId())) + } + if err != nil { + return nil, err + } + + _, err = s.projectStore.Get(ctx, projectMember.GetProjectId()) + if err != nil && v1.IsNotFound(err) { + return nil, status.Error(codes.NotFound, fmt.Sprintf("unable to find project:%s for projectMember", projectMember.GetProjectId())) + } + if err != nil { + return nil, err + } + + // allow create without sending Meta + if projectMember.Meta == nil { + projectMember.Meta = &v1.Meta{} + } + err = s.projectMemberStore.Create(ctx, projectMember) + return projectMember.NewProjectMemberResponse(), err +} +func (s *projectMemberService) Update(ctx context.Context, req *v1.ProjectMemberUpdateRequest) (*v1.ProjectMemberResponse, error) { + projectMember := req.ProjectMember + err := s.projectMemberStore.Update(ctx, projectMember) + return projectMember.NewProjectMemberResponse(), err +} +func (s *projectMemberService) Delete(ctx context.Context, req *v1.ProjectMemberDeleteRequest) (*v1.ProjectMemberResponse, error) { + projectMember := req.NewProjectMember() + err := s.projectMemberStore.Delete(ctx, projectMember.Meta.Id) + return projectMember.NewProjectMemberResponse(), err +} +func (s *projectMemberService) Get(ctx context.Context, req *v1.ProjectMemberGetRequest) (*v1.ProjectMemberResponse, error) { + projectMember, err := s.projectMemberStore.Get(ctx, req.Id) + if err != nil { + return nil, err + } + return projectMember.NewProjectMemberResponse(), nil +} +func (s *projectMemberService) Find(ctx context.Context, req *v1.ProjectMemberFindRequest) (*v1.ProjectMemberListResponse, error) { + filter := make(map[string]any) + if req.ProjectId != nil { + filter["projectmember ->> 'project_id'"] = req.ProjectId + } + if req.TenantId != nil { + filter["projectmember ->> 'tenant_id'"] = req.TenantId + } + for key, value := range req.Annotations { + // select * from projectMember where projectMember -> 'meta' -> 'annotations' ->> 'metal-stack.io/role' = 'owner'; + f := fmt.Sprintf("projectmember -> 'meta' -> 'annotations' ->> '%s'", key) + filter[f] = value + } + res, _, err := s.projectMemberStore.Find(ctx, filter, nil) + if err != nil { + return nil, err + } + resp := new(v1.ProjectMemberListResponse) + resp.ProjectMembers = append(resp.ProjectMembers, res...) + return resp, nil +} diff --git a/pkg/service/projectmember_test.go b/pkg/service/projectmember_test.go new file mode 100644 index 0000000..05fb2dd --- /dev/null +++ b/pkg/service/projectmember_test.go @@ -0,0 +1,186 @@ +package service + +import ( + "context" + "log/slog" + + v1 "github.com/metal-stack/masterdata-api/api/v1" + "github.com/metal-stack/metal-lib/pkg/pointer" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "testing" + + "github.com/metal-stack/masterdata-api/pkg/datastore/mocks" +) + +func TestCreateProjectMember(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + + t1 := &v1.Tenant{} + p1 := &v1.Project{} + pm1 := &v1.ProjectMember{ + ProjectId: "p1", + TenantId: "t1", + } + pmcr := &v1.ProjectMemberCreateRequest{ + ProjectMember: pm1, + } + tenantStorageMock.On("Get", ctx, pm1.GetTenantId()).Return(t1, nil) + projectStorageMock.On("Get", ctx, pm1.GetProjectId()).Return(p1, nil) + storageMock.On("Create", ctx, pm1).Return(nil) + resp, err := ts.Create(ctx, pmcr) + require.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.GetProjectMember()) + assert.Equal(t, pmcr.ProjectMember.ProjectId, resp.GetProjectMember().GetProjectId()) +} + +func TestUpdateProjectMember(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + + meta := &v1.Meta{Id: "p2", Annotations: map[string]string{"key": "value"}} + pm1 := &v1.ProjectMember{ + Meta: meta, + ProjectId: "p1", + TenantId: "t1", + } + meta.Annotations = map[string]string{"key": "value2"} + pmur := &v1.ProjectMemberUpdateRequest{ + ProjectMember: &v1.ProjectMember{ + Meta: meta, + ProjectId: "p1", + TenantId: "t1", + }, + } + + storageMock.On("Update", ctx, pm1).Return(nil) + resp, err := ts.Update(ctx, pmur) + require.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.GetProjectMember()) + assert.Equal(t, pmur.GetProjectMember().Meta.Annotations, resp.GetProjectMember().Meta.Annotations) +} + +func TestDeleteProjectMember(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + t3 := &v1.ProjectMember{ + Meta: &v1.Meta{Id: "p3"}, + } + tdr := &v1.ProjectMemberDeleteRequest{ + Id: "p3", + } + + storageMock.On("Delete", ctx, t3.Meta.Id).Return(nil) + resp, err := ts.Delete(ctx, tdr) + require.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.GetProjectMember()) + assert.Equal(t, tdr.Id, resp.GetProjectMember().GetMeta().GetId()) +} + +func TestGetProjectMember(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + t4 := &v1.ProjectMember{ + Meta: &v1.Meta{Id: "p4"}, + } + tgr := &v1.ProjectMemberGetRequest{ + Id: "p4", + } + + storageMock.On("Get", ctx, "p4").Return(t4, nil) + resp, err := ts.Get(ctx, tgr) + require.NoError(t, err) + assert.NotNil(t, resp) + assert.NotNil(t, resp.GetProjectMember()) + assert.Equal(t, tgr.Id, resp.GetProjectMember().GetMeta().GetId()) +} + +func TestFindProjectMemberByProject(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + + // filter by name + var t6s []*v1.ProjectMember + tfr := &v1.ProjectMemberFindRequest{ + ProjectId: pointer.Pointer("p1"), + } + + f2 := make(map[string]any) + f2["projectmember ->> 'project_id'"] = pointer.Pointer("p1") + storageMock.On("Find", ctx, f2, mock.AnythingOfType("*v1.Paging")).Return(t6s, nil, nil) + resp, err := ts.Find(ctx, tfr) + require.NoError(t, err) + assert.NotNil(t, resp) +} + +func TestFindProjectMemberByTenant(t *testing.T) { + storageMock := &mocks.Storage[*v1.ProjectMember]{} + tenantStorageMock := &mocks.Storage[*v1.Tenant]{} + projectStorageMock := &mocks.Storage[*v1.Project]{} + ts := &projectMemberService{ + projectMemberStore: storageMock, + tenantStore: tenantStorageMock, + projectStore: projectStorageMock, + log: slog.Default(), + } + ctx := context.Background() + + // filter by name + var t6s []*v1.ProjectMember + tfr := &v1.ProjectMemberFindRequest{ + TenantId: pointer.Pointer("t1"), + } + + f2 := make(map[string]any) + f2["projectmember ->> 'tenant_id'"] = pointer.Pointer("t1") + storageMock.On("Find", ctx, f2, mock.AnythingOfType("*v1.Paging")).Return(t6s, nil, nil) + resp, err := ts.Find(ctx, tfr) + require.NoError(t, err) + assert.NotNil(t, resp) +} diff --git a/pkg/service/tenant.go b/pkg/service/tenant.go index db6052b..2d728f9 100644 --- a/pkg/service/tenant.go +++ b/pkg/service/tenant.go @@ -88,10 +88,7 @@ func (s *tenantService) Find(ctx context.Context, req *v1.TenantFindRequest) (*v return nil, err } resp := new(v1.TenantListResponse) - for i := range res { - t := res[i] - resp.Tenants = append(resp.Tenants, t) - } + resp.Tenants = append(resp.Tenants, res...) resp.NextPage = nextPage return resp, nil } diff --git a/proto/Makefile b/proto/Makefile index 9c50fff..77e669c 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.28.1 +BUF_VERSION := 1.29.0 _buf: docker run --rm \ diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index bb5723c..c604afd 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -9,6 +9,6 @@ plugins: out: ../api opt: paths=source_relative,require_unimplemented_servers=false # generate go structs for protocol buffer definition - - plugin: buf.build/protocolbuffers/go:v1.31.0 + - plugin: buf.build/protocolbuffers/go:v1.32.0 out: ../api opt: paths=source_relative diff --git a/proto/v1/project_member.proto b/proto/v1/project_member.proto new file mode 100644 index 0000000..91d5772 --- /dev/null +++ b/proto/v1/project_member.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package v1; + +import "v1/meta.proto"; + +service ProjectMemberService { + rpc Create(ProjectMemberCreateRequest) returns (ProjectMemberResponse); + rpc Update(ProjectMemberUpdateRequest) returns (ProjectMemberResponse); + rpc Delete(ProjectMemberDeleteRequest) returns (ProjectMemberResponse); + rpc Get(ProjectMemberGetRequest) returns (ProjectMemberResponse); + rpc Find(ProjectMemberFindRequest) returns (ProjectMemberListResponse); +} + +// ProjectMember is the database model +message ProjectMember { + Meta meta = 1; + string project_id = 2; + string tenant_id = 4; +} + +message ProjectMemberCreateRequest { + ProjectMember project_member = 1; +} + +message ProjectMemberUpdateRequest { + ProjectMember project_member = 1; +} + +message ProjectMemberDeleteRequest { + string id = 1; +} + +message ProjectMemberGetRequest { + string id = 1; +} + +message ProjectMemberFindRequest { + optional string project_id = 1; + optional string tenant_id = 2; + map annotations = 6; +} + +message ProjectMemberResponse { + ProjectMember project_member = 1; +} + +message ProjectMemberListResponse { + repeated ProjectMember project_members = 1; +} diff --git a/server/main.go b/server/main.go index 3576d99..bcfdfbe 100644 --- a/server/main.go +++ b/server/main.go @@ -215,6 +215,7 @@ func run() { ves := []datastore.Entity{ &apiv1.Project{}, + &apiv1.ProjectMember{}, &apiv1.Tenant{}, } dbHost := viper.GetString("dbhost") @@ -247,6 +248,12 @@ func run() { logger.Error("unable to create project service", "error", err) panic(err) } + projectMemberService, err := service.NewProjectMemberService(db, logger) + if err != nil { + logger.Error("unable to create project member service", "error", err) + panic(err) + + } tenantService, err := service.NewTenantService(db, logger) if err != nil { logger.Error("unable to create tenant service", "error", err) @@ -254,6 +261,7 @@ func run() { } apiv1.RegisterProjectServiceServer(grpcServer, projectService) + apiv1.RegisterProjectMemberServiceServer(grpcServer, projectMemberService) apiv1.RegisterTenantServiceServer(grpcServer, tenantService) healthv1.RegisterHealthServer(grpcServer, healthServer)