From 3551a038d77fdc089c4c0b2a26bfbe7deef201b5 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 24 Aug 2026 13:09:19 +0200 Subject: [PATCH 1/4] Add GRPC API for getting a users team Co-authored-by: @x10an14-nav Co-authored-by: Kyrre Havik --- internal/grpc/grpcteam/grpcteamsql/querier.go | 1 + .../grpc/grpcteam/grpcteamsql/teams.sql.go | 54 +++ internal/grpc/grpcteam/queries/teams.sql | 17 + internal/grpc/grpcteam/server.go | 27 ++ pkg/apiclient/protoapi/mock_teams_server.go | 68 +++ pkg/apiclient/protoapi/schema/teams.proto | 7 + pkg/apiclient/protoapi/teams.pb.go | 393 +++++++++++------- pkg/apiclient/protoapi/teams_grpc.pb.go | 38 ++ .../protoapi/teams_protoopaque.pb.go | 393 +++++++++++------- 9 files changed, 706 insertions(+), 292 deletions(-) diff --git a/internal/grpc/grpcteam/grpcteamsql/querier.go b/internal/grpc/grpcteam/grpcteamsql/querier.go index e5fe61072..452838e21 100644 --- a/internal/grpc/grpcteam/grpcteamsql/querier.go +++ b/internal/grpc/grpcteam/grpcteamsql/querier.go @@ -18,6 +18,7 @@ type Querier interface { IsTeamRepository(ctx context.Context, arg IsTeamRepositoryParams) (bool, error) List(ctx context.Context, arg ListParams) ([]*Team, error) ListEnvironments(ctx context.Context, arg ListEnvironmentsParams) ([]*TeamAllEnvironment, error) + ListForUserByEmail(ctx context.Context, arg ListForUserByEmailParams) ([]*Team, error) ListMembers(ctx context.Context, arg ListMembersParams) ([]*User, error) SetLastSuccessfulSync(ctx context.Context, argSlug slug.Slug) error UpdateExternalReferences(ctx context.Context, arg UpdateExternalReferencesParams) error diff --git a/internal/grpc/grpcteam/grpcteamsql/teams.sql.go b/internal/grpc/grpcteam/grpcteamsql/teams.sql.go index a79ed2839..93197cf21 100644 --- a/internal/grpc/grpcteam/grpcteamsql/teams.sql.go +++ b/internal/grpc/grpcteam/grpcteamsql/teams.sql.go @@ -195,6 +195,60 @@ func (q *Queries) ListEnvironments(ctx context.Context, arg ListEnvironmentsPara return items, nil } +const listForUserByEmail = `-- name: ListForUserByEmail :many +SELECT + teams.slug, teams.purpose, teams.last_successful_sync, teams.slack_channel, teams.google_group_email, teams.entra_id_group_id, teams.github_team_slug, teams.gar_repository, teams.cdn_bucket, teams.delete_key_confirmed_at +FROM + user_roles + JOIN teams ON teams.slug = user_roles.target_team_slug + JOIN users ON users.id = user_roles.user_id +WHERE + users.email = LOWER($1) +ORDER BY + slug ASC +LIMIT + $3 +OFFSET + $2 +` + +type ListForUserByEmailParams struct { + Email string + Offset int32 + Limit int32 +} + +func (q *Queries) ListForUserByEmail(ctx context.Context, arg ListForUserByEmailParams) ([]*Team, error) { + rows, err := q.db.Query(ctx, listForUserByEmail, arg.Email, arg.Offset, arg.Limit) + if err != nil { + return nil, err + } + defer rows.Close() + items := []*Team{} + for rows.Next() { + var i Team + if err := rows.Scan( + &i.Slug, + &i.Purpose, + &i.LastSuccessfulSync, + &i.SlackChannel, + &i.GoogleGroupEmail, + &i.EntraIDGroupID, + &i.GithubTeamSlug, + &i.GarRepository, + &i.CdnBucket, + &i.DeleteKeyConfirmedAt, + ); err != nil { + return nil, err + } + items = append(items, &i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const listMembers = `-- name: ListMembers :many SELECT users.id, users.email, users.name, users.external_id, users.admin diff --git a/internal/grpc/grpcteam/queries/teams.sql b/internal/grpc/grpcteam/queries/teams.sql index 8bd95e52f..91e91d4c1 100644 --- a/internal/grpc/grpcteam/queries/teams.sql +++ b/internal/grpc/grpcteam/queries/teams.sql @@ -35,6 +35,23 @@ OFFSET sqlc.arg('offset') ; +-- name: ListForUserByEmail :many +SELECT + teams.* +FROM + user_roles + JOIN teams ON teams.slug = user_roles.target_team_slug + JOIN users ON users.id = user_roles.user_id +WHERE + users.email = LOWER(@email) +ORDER BY + slug ASC +LIMIT + sqlc.arg('limit') +OFFSET + sqlc.arg('offset') +; + -- name: Count :one SELECT COUNT(*) AS total diff --git a/internal/grpc/grpcteam/server.go b/internal/grpc/grpcteam/server.go index 4915eb83e..90672c6b5 100644 --- a/internal/grpc/grpcteam/server.go +++ b/internal/grpc/grpcteam/server.go @@ -78,6 +78,33 @@ func (t *Server) List(ctx context.Context, req *protoapi.ListTeamsRequest) (*pro return resp, nil } +func (t *Server) ListForUserByEmail(ctx context.Context, req *protoapi.ListForUserByEmailRequest) (*protoapi.ListTeamsResponse, error) { + limit, offset := grpcpagination.Pagination(req) + teams, err := t.querier.ListForUserByEmail(ctx, grpcteamsql.ListForUserByEmailParams{ + Offset: offset, + Limit: limit, + Email: req.Email, + }) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to list teams for user: %s", err) + } + + total, err := t.querier.Count(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get teams count for user: %s", err) + } + + resp := &protoapi.ListTeamsResponse{ + PageInfo: grpcpagination.PageInfo(req, int(total)), + Nodes: make([]*protoapi.Team, len(teams)), + } + for i, team := range teams { + resp.Nodes[i] = toProtoTeam(team) + } + + return resp, nil +} + func (t *Server) Members(ctx context.Context, req *protoapi.ListTeamMembersRequest) (*protoapi.ListTeamMembersResponse, error) { limit, offset := grpcpagination.Pagination(req) users, err := t.querier.ListMembers(ctx, grpcteamsql.ListMembersParams{ diff --git a/pkg/apiclient/protoapi/mock_teams_server.go b/pkg/apiclient/protoapi/mock_teams_server.go index 3077f40ed..4c60f4fd2 100644 --- a/pkg/apiclient/protoapi/mock_teams_server.go +++ b/pkg/apiclient/protoapi/mock_teams_server.go @@ -446,6 +446,74 @@ func (_c *MockTeamsServer_ListAuthorizedRepositories_Call) RunAndReturn(run func return _c } +// ListForUserByEmail provides a mock function for the type MockTeamsServer +func (_mock *MockTeamsServer) ListForUserByEmail(context1 context.Context, listForUserByEmailRequest *ListForUserByEmailRequest) (*ListTeamsResponse, error) { + ret := _mock.Called(context1, listForUserByEmailRequest) + + if len(ret) == 0 { + panic("no return value specified for ListForUserByEmail") + } + + var r0 *ListTeamsResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *ListForUserByEmailRequest) (*ListTeamsResponse, error)); ok { + return returnFunc(context1, listForUserByEmailRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *ListForUserByEmailRequest) *ListTeamsResponse); ok { + r0 = returnFunc(context1, listForUserByEmailRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ListTeamsResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *ListForUserByEmailRequest) error); ok { + r1 = returnFunc(context1, listForUserByEmailRequest) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockTeamsServer_ListForUserByEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListForUserByEmail' +type MockTeamsServer_ListForUserByEmail_Call struct { + *mock.Call +} + +// ListForUserByEmail is a helper method to define mock.On call +// - context1 context.Context +// - listForUserByEmailRequest *ListForUserByEmailRequest +func (_e *MockTeamsServer_Expecter) ListForUserByEmail(context1 interface{}, listForUserByEmailRequest interface{}) *MockTeamsServer_ListForUserByEmail_Call { + return &MockTeamsServer_ListForUserByEmail_Call{Call: _e.mock.On("ListForUserByEmail", context1, listForUserByEmailRequest)} +} + +func (_c *MockTeamsServer_ListForUserByEmail_Call) Run(run func(context1 context.Context, listForUserByEmailRequest *ListForUserByEmailRequest)) *MockTeamsServer_ListForUserByEmail_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *ListForUserByEmailRequest + if args[1] != nil { + arg1 = args[1].(*ListForUserByEmailRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockTeamsServer_ListForUserByEmail_Call) Return(listTeamsResponse *ListTeamsResponse, err error) *MockTeamsServer_ListForUserByEmail_Call { + _c.Call.Return(listTeamsResponse, err) + return _c +} + +func (_c *MockTeamsServer_ListForUserByEmail_Call) RunAndReturn(run func(context1 context.Context, listForUserByEmailRequest *ListForUserByEmailRequest) (*ListTeamsResponse, error)) *MockTeamsServer_ListForUserByEmail_Call { + _c.Call.Return(run) + return _c +} + // Members provides a mock function for the type MockTeamsServer func (_mock *MockTeamsServer) Members(context1 context.Context, listTeamMembersRequest *ListTeamMembersRequest) (*ListTeamMembersResponse, error) { ret := _mock.Called(context1, listTeamMembersRequest) diff --git a/pkg/apiclient/protoapi/schema/teams.proto b/pkg/apiclient/protoapi/schema/teams.proto index 45d82c9d8..27d909a99 100644 --- a/pkg/apiclient/protoapi/schema/teams.proto +++ b/pkg/apiclient/protoapi/schema/teams.proto @@ -32,6 +32,7 @@ service Teams { rpc ListAuthorizedRepositories(ListAuthorizedRepositoriesRequest) returns (ListAuthorizedRepositoriesResponse) {} rpc Get(GetTeamRequest) returns (GetTeamResponse) {} rpc List(ListTeamsRequest) returns (ListTeamsResponse) {} + rpc ListForUserByEmail(ListForUserByEmailRequest) returns (ListTeamsResponse) {} rpc Members(ListTeamMembersRequest) returns (ListTeamMembersResponse) {} rpc Environments(ListTeamEnvironmentsRequest) returns (ListTeamEnvironmentsResponse) {} rpc SetTeamExternalReferences(SetTeamExternalReferencesRequest) returns (SetTeamExternalReferencesResponse) {} @@ -99,6 +100,12 @@ message ListTeamsRequest { int64 offset = 2; } +message ListForUserByEmailRequest { + int64 limit = 1; + int64 offset = 2; + string email = 3; +} + message ListTeamsResponse { repeated Team nodes = 1; PageInfo page_info = 2; diff --git a/pkg/apiclient/protoapi/teams.pb.go b/pkg/apiclient/protoapi/teams.pb.go index aa5401203..836acff76 100644 --- a/pkg/apiclient/protoapi/teams.pb.go +++ b/pkg/apiclient/protoapi/teams.pb.go @@ -1339,6 +1339,91 @@ func (b0 ListTeamsRequest_builder) Build() *ListTeamsRequest { return m0 } +type ListForUserByEmailRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListForUserByEmailRequest) Reset() { + *x = ListForUserByEmailRequest{} + mi := &file_teams_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListForUserByEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListForUserByEmailRequest) ProtoMessage() {} + +func (x *ListForUserByEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListForUserByEmailRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListForUserByEmailRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListForUserByEmailRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListForUserByEmailRequest) SetLimit(v int64) { + x.Limit = v +} + +func (x *ListForUserByEmailRequest) SetOffset(v int64) { + x.Offset = v +} + +func (x *ListForUserByEmailRequest) SetEmail(v string) { + x.Email = v +} + +type ListForUserByEmailRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Limit int64 + Offset int64 + Email string +} + +func (b0 ListForUserByEmailRequest_builder) Build() *ListForUserByEmailRequest { + m0 := &ListForUserByEmailRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Limit = b.Limit + x.Offset = b.Offset + x.Email = b.Email + return m0 +} + type ListTeamsResponse struct { state protoimpl.MessageState `protogen:"hybrid.v1"` Nodes []*Team `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` @@ -1349,7 +1434,7 @@ type ListTeamsResponse struct { func (x *ListTeamsResponse) Reset() { *x = ListTeamsResponse{} - mi := &file_teams_proto_msgTypes[15] + mi := &file_teams_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1361,7 +1446,7 @@ func (x *ListTeamsResponse) String() string { func (*ListTeamsResponse) ProtoMessage() {} func (x *ListTeamsResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[15] + mi := &file_teams_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1432,7 +1517,7 @@ type ListTeamMembersRequest struct { func (x *ListTeamMembersRequest) Reset() { *x = ListTeamMembersRequest{} - mi := &file_teams_proto_msgTypes[16] + mi := &file_teams_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1444,7 +1529,7 @@ func (x *ListTeamMembersRequest) String() string { func (*ListTeamMembersRequest) ProtoMessage() {} func (x *ListTeamMembersRequest) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[16] + mi := &file_teams_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1516,7 +1601,7 @@ type ListTeamMembersResponse struct { func (x *ListTeamMembersResponse) Reset() { *x = ListTeamMembersResponse{} - mi := &file_teams_proto_msgTypes[17] + mi := &file_teams_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1528,7 +1613,7 @@ func (x *ListTeamMembersResponse) String() string { func (*ListTeamMembersResponse) ProtoMessage() {} func (x *ListTeamMembersResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[17] + mi := &file_teams_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1597,7 +1682,7 @@ type TeamMember struct { func (x *TeamMember) Reset() { *x = TeamMember{} - mi := &file_teams_proto_msgTypes[18] + mi := &file_teams_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1609,7 +1694,7 @@ func (x *TeamMember) String() string { func (*TeamMember) ProtoMessage() {} func (x *TeamMember) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[18] + mi := &file_teams_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1666,7 +1751,7 @@ type IsRepositoryAuthorizedRequest struct { func (x *IsRepositoryAuthorizedRequest) Reset() { *x = IsRepositoryAuthorizedRequest{} - mi := &file_teams_proto_msgTypes[19] + mi := &file_teams_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1678,7 +1763,7 @@ func (x *IsRepositoryAuthorizedRequest) String() string { func (*IsRepositoryAuthorizedRequest) ProtoMessage() {} func (x *IsRepositoryAuthorizedRequest) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[19] + mi := &file_teams_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1736,7 +1821,7 @@ type IsRepositoryAuthorizedResponse struct { func (x *IsRepositoryAuthorizedResponse) Reset() { *x = IsRepositoryAuthorizedResponse{} - mi := &file_teams_proto_msgTypes[20] + mi := &file_teams_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1748,7 +1833,7 @@ func (x *IsRepositoryAuthorizedResponse) String() string { func (*IsRepositoryAuthorizedResponse) ProtoMessage() {} func (x *IsRepositoryAuthorizedResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[20] + mi := &file_teams_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1920,116 +2005,129 @@ var file_teams_proto_rawDesc = string([]byte{ 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x22, 0x7c, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, - 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, - 0x5a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x22, 0x88, 0x01, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, - 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x71, 0x0a, 0x1d, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x12, - 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4a, - 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, - 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x32, 0xa2, 0x08, 0x0a, 0x05, - 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, + 0x74, 0x22, 0x5f, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x22, 0x7c, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x5a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x22, 0x88, 0x01, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x71, 0x0a, 0x1d, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, + 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x32, 0x8e, 0x09, 0x0a, + 0x05, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6e, 0x61, 0x69, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x6e, 0x61, 0x69, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x6e, 0x61, + 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6e, 0x61, + 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x07, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x0c, - 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x6e, - 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6e, + 0x75, 0x66, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x88, 0x01, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6a, 0x0a, 0x12, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x2c, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x42, + 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa9, 0x01, 0x0a, 0x24, 0x53, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x3e, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x7f, 0x0a, 0x16, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x30, 0x2e, 0x6e, 0x61, 0x69, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6e, 0x61, + 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x07, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x29, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x0c, 0x45, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, + 0x19, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa9, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x3e, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x24, 0x2e, + 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x16, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x42, 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x30, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x1a, 0x5a, + 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, }) -var file_teams_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_teams_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_teams_proto_goTypes = []any{ (*Team)(nil), // 0: nais.api.protobuf.Team (*ListAuthorizedRepositoriesRequest)(nil), // 1: nais.api.protobuf.ListAuthorizedRepositoriesRequest @@ -2046,46 +2144,49 @@ var file_teams_proto_goTypes = []any{ (*GetTeamResponse)(nil), // 12: nais.api.protobuf.GetTeamResponse (*GetTeamRequest)(nil), // 13: nais.api.protobuf.GetTeamRequest (*ListTeamsRequest)(nil), // 14: nais.api.protobuf.ListTeamsRequest - (*ListTeamsResponse)(nil), // 15: nais.api.protobuf.ListTeamsResponse - (*ListTeamMembersRequest)(nil), // 16: nais.api.protobuf.ListTeamMembersRequest - (*ListTeamMembersResponse)(nil), // 17: nais.api.protobuf.ListTeamMembersResponse - (*TeamMember)(nil), // 18: nais.api.protobuf.TeamMember - (*IsRepositoryAuthorizedRequest)(nil), // 19: nais.api.protobuf.IsRepositoryAuthorizedRequest - (*IsRepositoryAuthorizedResponse)(nil), // 20: nais.api.protobuf.IsRepositoryAuthorizedResponse - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*PageInfo)(nil), // 22: nais.api.protobuf.PageInfo - (*User)(nil), // 23: nais.api.protobuf.User + (*ListForUserByEmailRequest)(nil), // 15: nais.api.protobuf.ListForUserByEmailRequest + (*ListTeamsResponse)(nil), // 16: nais.api.protobuf.ListTeamsResponse + (*ListTeamMembersRequest)(nil), // 17: nais.api.protobuf.ListTeamMembersRequest + (*ListTeamMembersResponse)(nil), // 18: nais.api.protobuf.ListTeamMembersResponse + (*TeamMember)(nil), // 19: nais.api.protobuf.TeamMember + (*IsRepositoryAuthorizedRequest)(nil), // 20: nais.api.protobuf.IsRepositoryAuthorizedRequest + (*IsRepositoryAuthorizedResponse)(nil), // 21: nais.api.protobuf.IsRepositoryAuthorizedResponse + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*PageInfo)(nil), // 23: nais.api.protobuf.PageInfo + (*User)(nil), // 24: nais.api.protobuf.User } var file_teams_proto_depIdxs = []int32{ - 21, // 0: nais.api.protobuf.Team.delete_key_confirmed_at:type_name -> google.protobuf.Timestamp + 22, // 0: nais.api.protobuf.Team.delete_key_confirmed_at:type_name -> google.protobuf.Timestamp 11, // 1: nais.api.protobuf.ListTeamEnvironmentsResponse.nodes:type_name -> nais.api.protobuf.TeamEnvironment - 22, // 2: nais.api.protobuf.ListTeamEnvironmentsResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 23, // 2: nais.api.protobuf.ListTeamEnvironmentsResponse.page_info:type_name -> nais.api.protobuf.PageInfo 0, // 3: nais.api.protobuf.GetTeamResponse.team:type_name -> nais.api.protobuf.Team 0, // 4: nais.api.protobuf.ListTeamsResponse.nodes:type_name -> nais.api.protobuf.Team - 22, // 5: nais.api.protobuf.ListTeamsResponse.page_info:type_name -> nais.api.protobuf.PageInfo - 18, // 6: nais.api.protobuf.ListTeamMembersResponse.nodes:type_name -> nais.api.protobuf.TeamMember - 22, // 7: nais.api.protobuf.ListTeamMembersResponse.page_info:type_name -> nais.api.protobuf.PageInfo - 23, // 8: nais.api.protobuf.TeamMember.user:type_name -> nais.api.protobuf.User + 23, // 5: nais.api.protobuf.ListTeamsResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 19, // 6: nais.api.protobuf.ListTeamMembersResponse.nodes:type_name -> nais.api.protobuf.TeamMember + 23, // 7: nais.api.protobuf.ListTeamMembersResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 24, // 8: nais.api.protobuf.TeamMember.user:type_name -> nais.api.protobuf.User 1, // 9: nais.api.protobuf.Teams.ListAuthorizedRepositories:input_type -> nais.api.protobuf.ListAuthorizedRepositoriesRequest 13, // 10: nais.api.protobuf.Teams.Get:input_type -> nais.api.protobuf.GetTeamRequest 14, // 11: nais.api.protobuf.Teams.List:input_type -> nais.api.protobuf.ListTeamsRequest - 16, // 12: nais.api.protobuf.Teams.Members:input_type -> nais.api.protobuf.ListTeamMembersRequest - 9, // 13: nais.api.protobuf.Teams.Environments:input_type -> nais.api.protobuf.ListTeamEnvironmentsRequest - 5, // 14: nais.api.protobuf.Teams.SetTeamExternalReferences:input_type -> nais.api.protobuf.SetTeamExternalReferencesRequest - 7, // 15: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:input_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesRequest - 3, // 16: nais.api.protobuf.Teams.Delete:input_type -> nais.api.protobuf.DeleteTeamRequest - 19, // 17: nais.api.protobuf.Teams.IsRepositoryAuthorized:input_type -> nais.api.protobuf.IsRepositoryAuthorizedRequest - 2, // 18: nais.api.protobuf.Teams.ListAuthorizedRepositories:output_type -> nais.api.protobuf.ListAuthorizedRepositoriesResponse - 12, // 19: nais.api.protobuf.Teams.Get:output_type -> nais.api.protobuf.GetTeamResponse - 15, // 20: nais.api.protobuf.Teams.List:output_type -> nais.api.protobuf.ListTeamsResponse - 17, // 21: nais.api.protobuf.Teams.Members:output_type -> nais.api.protobuf.ListTeamMembersResponse - 10, // 22: nais.api.protobuf.Teams.Environments:output_type -> nais.api.protobuf.ListTeamEnvironmentsResponse - 6, // 23: nais.api.protobuf.Teams.SetTeamExternalReferences:output_type -> nais.api.protobuf.SetTeamExternalReferencesResponse - 8, // 24: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:output_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesResponse - 4, // 25: nais.api.protobuf.Teams.Delete:output_type -> nais.api.protobuf.DeleteTeamResponse - 20, // 26: nais.api.protobuf.Teams.IsRepositoryAuthorized:output_type -> nais.api.protobuf.IsRepositoryAuthorizedResponse - 18, // [18:27] is the sub-list for method output_type - 9, // [9:18] is the sub-list for method input_type + 15, // 12: nais.api.protobuf.Teams.ListForUserByEmail:input_type -> nais.api.protobuf.ListForUserByEmailRequest + 17, // 13: nais.api.protobuf.Teams.Members:input_type -> nais.api.protobuf.ListTeamMembersRequest + 9, // 14: nais.api.protobuf.Teams.Environments:input_type -> nais.api.protobuf.ListTeamEnvironmentsRequest + 5, // 15: nais.api.protobuf.Teams.SetTeamExternalReferences:input_type -> nais.api.protobuf.SetTeamExternalReferencesRequest + 7, // 16: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:input_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesRequest + 3, // 17: nais.api.protobuf.Teams.Delete:input_type -> nais.api.protobuf.DeleteTeamRequest + 20, // 18: nais.api.protobuf.Teams.IsRepositoryAuthorized:input_type -> nais.api.protobuf.IsRepositoryAuthorizedRequest + 2, // 19: nais.api.protobuf.Teams.ListAuthorizedRepositories:output_type -> nais.api.protobuf.ListAuthorizedRepositoriesResponse + 12, // 20: nais.api.protobuf.Teams.Get:output_type -> nais.api.protobuf.GetTeamResponse + 16, // 21: nais.api.protobuf.Teams.List:output_type -> nais.api.protobuf.ListTeamsResponse + 16, // 22: nais.api.protobuf.Teams.ListForUserByEmail:output_type -> nais.api.protobuf.ListTeamsResponse + 18, // 23: nais.api.protobuf.Teams.Members:output_type -> nais.api.protobuf.ListTeamMembersResponse + 10, // 24: nais.api.protobuf.Teams.Environments:output_type -> nais.api.protobuf.ListTeamEnvironmentsResponse + 6, // 25: nais.api.protobuf.Teams.SetTeamExternalReferences:output_type -> nais.api.protobuf.SetTeamExternalReferencesResponse + 8, // 26: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:output_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesResponse + 4, // 27: nais.api.protobuf.Teams.Delete:output_type -> nais.api.protobuf.DeleteTeamResponse + 21, // 28: nais.api.protobuf.Teams.IsRepositoryAuthorized:output_type -> nais.api.protobuf.IsRepositoryAuthorizedResponse + 19, // [19:29] is the sub-list for method output_type + 9, // [9:19] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name 9, // [9:9] is the sub-list for extension extendee 0, // [0:9] is the sub-list for field type_name @@ -2108,7 +2209,7 @@ func file_teams_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_teams_proto_rawDesc), len(file_teams_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/apiclient/protoapi/teams_grpc.pb.go b/pkg/apiclient/protoapi/teams_grpc.pb.go index c1ba4763c..2a00c4e48 100644 --- a/pkg/apiclient/protoapi/teams_grpc.pb.go +++ b/pkg/apiclient/protoapi/teams_grpc.pb.go @@ -22,6 +22,7 @@ const ( Teams_ListAuthorizedRepositories_FullMethodName = "/nais.api.protobuf.Teams/ListAuthorizedRepositories" Teams_Get_FullMethodName = "/nais.api.protobuf.Teams/Get" Teams_List_FullMethodName = "/nais.api.protobuf.Teams/List" + Teams_ListForUserByEmail_FullMethodName = "/nais.api.protobuf.Teams/ListForUserByEmail" Teams_Members_FullMethodName = "/nais.api.protobuf.Teams/Members" Teams_Environments_FullMethodName = "/nais.api.protobuf.Teams/Environments" Teams_SetTeamExternalReferences_FullMethodName = "/nais.api.protobuf.Teams/SetTeamExternalReferences" @@ -37,6 +38,7 @@ type TeamsClient interface { ListAuthorizedRepositories(ctx context.Context, in *ListAuthorizedRepositoriesRequest, opts ...grpc.CallOption) (*ListAuthorizedRepositoriesResponse, error) Get(ctx context.Context, in *GetTeamRequest, opts ...grpc.CallOption) (*GetTeamResponse, error) List(ctx context.Context, in *ListTeamsRequest, opts ...grpc.CallOption) (*ListTeamsResponse, error) + ListForUserByEmail(ctx context.Context, in *ListForUserByEmailRequest, opts ...grpc.CallOption) (*ListTeamsResponse, error) Members(ctx context.Context, in *ListTeamMembersRequest, opts ...grpc.CallOption) (*ListTeamMembersResponse, error) Environments(ctx context.Context, in *ListTeamEnvironmentsRequest, opts ...grpc.CallOption) (*ListTeamEnvironmentsResponse, error) SetTeamExternalReferences(ctx context.Context, in *SetTeamExternalReferencesRequest, opts ...grpc.CallOption) (*SetTeamExternalReferencesResponse, error) @@ -83,6 +85,16 @@ func (c *teamsClient) List(ctx context.Context, in *ListTeamsRequest, opts ...gr return out, nil } +func (c *teamsClient) ListForUserByEmail(ctx context.Context, in *ListForUserByEmailRequest, opts ...grpc.CallOption) (*ListTeamsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListTeamsResponse) + err := c.cc.Invoke(ctx, Teams_ListForUserByEmail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *teamsClient) Members(ctx context.Context, in *ListTeamMembersRequest, opts ...grpc.CallOption) (*ListTeamMembersResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListTeamMembersResponse) @@ -150,6 +162,7 @@ type TeamsServer interface { ListAuthorizedRepositories(context.Context, *ListAuthorizedRepositoriesRequest) (*ListAuthorizedRepositoriesResponse, error) Get(context.Context, *GetTeamRequest) (*GetTeamResponse, error) List(context.Context, *ListTeamsRequest) (*ListTeamsResponse, error) + ListForUserByEmail(context.Context, *ListForUserByEmailRequest) (*ListTeamsResponse, error) Members(context.Context, *ListTeamMembersRequest) (*ListTeamMembersResponse, error) Environments(context.Context, *ListTeamEnvironmentsRequest) (*ListTeamEnvironmentsResponse, error) SetTeamExternalReferences(context.Context, *SetTeamExternalReferencesRequest) (*SetTeamExternalReferencesResponse, error) @@ -175,6 +188,9 @@ func (UnimplementedTeamsServer) Get(context.Context, *GetTeamRequest) (*GetTeamR func (UnimplementedTeamsServer) List(context.Context, *ListTeamsRequest) (*ListTeamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } +func (UnimplementedTeamsServer) ListForUserByEmail(context.Context, *ListForUserByEmailRequest) (*ListTeamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListForUserByEmail not implemented") +} func (UnimplementedTeamsServer) Members(context.Context, *ListTeamMembersRequest) (*ListTeamMembersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Members not implemented") } @@ -268,6 +284,24 @@ func _Teams_List_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Teams_ListForUserByEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListForUserByEmailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).ListForUserByEmail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_ListForUserByEmail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).ListForUserByEmail(ctx, req.(*ListForUserByEmailRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Teams_Members_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListTeamMembersRequest) if err := dec(in); err != nil { @@ -395,6 +429,10 @@ var Teams_ServiceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _Teams_List_Handler, }, + { + MethodName: "ListForUserByEmail", + Handler: _Teams_ListForUserByEmail_Handler, + }, { MethodName: "Members", Handler: _Teams_Members_Handler, diff --git a/pkg/apiclient/protoapi/teams_protoopaque.pb.go b/pkg/apiclient/protoapi/teams_protoopaque.pb.go index ae80ba611..fc82b0c45 100644 --- a/pkg/apiclient/protoapi/teams_protoopaque.pb.go +++ b/pkg/apiclient/protoapi/teams_protoopaque.pb.go @@ -1444,6 +1444,91 @@ func (b0 ListTeamsRequest_builder) Build() *ListTeamsRequest { return m0 } +type ListForUserByEmailRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Limit int64 `protobuf:"varint,1,opt,name=limit,proto3"` + xxx_hidden_Offset int64 `protobuf:"varint,2,opt,name=offset,proto3"` + xxx_hidden_Email string `protobuf:"bytes,3,opt,name=email,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListForUserByEmailRequest) Reset() { + *x = ListForUserByEmailRequest{} + mi := &file_teams_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListForUserByEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListForUserByEmailRequest) ProtoMessage() {} + +func (x *ListForUserByEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListForUserByEmailRequest) GetLimit() int64 { + if x != nil { + return x.xxx_hidden_Limit + } + return 0 +} + +func (x *ListForUserByEmailRequest) GetOffset() int64 { + if x != nil { + return x.xxx_hidden_Offset + } + return 0 +} + +func (x *ListForUserByEmailRequest) GetEmail() string { + if x != nil { + return x.xxx_hidden_Email + } + return "" +} + +func (x *ListForUserByEmailRequest) SetLimit(v int64) { + x.xxx_hidden_Limit = v +} + +func (x *ListForUserByEmailRequest) SetOffset(v int64) { + x.xxx_hidden_Offset = v +} + +func (x *ListForUserByEmailRequest) SetEmail(v string) { + x.xxx_hidden_Email = v +} + +type ListForUserByEmailRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Limit int64 + Offset int64 + Email string +} + +func (b0 ListForUserByEmailRequest_builder) Build() *ListForUserByEmailRequest { + m0 := &ListForUserByEmailRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Limit = b.Limit + x.xxx_hidden_Offset = b.Offset + x.xxx_hidden_Email = b.Email + return m0 +} + type ListTeamsResponse struct { state protoimpl.MessageState `protogen:"opaque.v1"` xxx_hidden_Nodes *[]*Team `protobuf:"bytes,1,rep,name=nodes,proto3"` @@ -1454,7 +1539,7 @@ type ListTeamsResponse struct { func (x *ListTeamsResponse) Reset() { *x = ListTeamsResponse{} - mi := &file_teams_proto_msgTypes[15] + mi := &file_teams_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1466,7 +1551,7 @@ func (x *ListTeamsResponse) String() string { func (*ListTeamsResponse) ProtoMessage() {} func (x *ListTeamsResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[15] + mi := &file_teams_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1539,7 +1624,7 @@ type ListTeamMembersRequest struct { func (x *ListTeamMembersRequest) Reset() { *x = ListTeamMembersRequest{} - mi := &file_teams_proto_msgTypes[16] + mi := &file_teams_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1551,7 +1636,7 @@ func (x *ListTeamMembersRequest) String() string { func (*ListTeamMembersRequest) ProtoMessage() {} func (x *ListTeamMembersRequest) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[16] + mi := &file_teams_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1623,7 +1708,7 @@ type ListTeamMembersResponse struct { func (x *ListTeamMembersResponse) Reset() { *x = ListTeamMembersResponse{} - mi := &file_teams_proto_msgTypes[17] + mi := &file_teams_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1635,7 +1720,7 @@ func (x *ListTeamMembersResponse) String() string { func (*ListTeamMembersResponse) ProtoMessage() {} func (x *ListTeamMembersResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[17] + mi := &file_teams_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1706,7 +1791,7 @@ type TeamMember struct { func (x *TeamMember) Reset() { *x = TeamMember{} - mi := &file_teams_proto_msgTypes[18] + mi := &file_teams_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1718,7 +1803,7 @@ func (x *TeamMember) String() string { func (*TeamMember) ProtoMessage() {} func (x *TeamMember) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[18] + mi := &file_teams_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1775,7 +1860,7 @@ type IsRepositoryAuthorizedRequest struct { func (x *IsRepositoryAuthorizedRequest) Reset() { *x = IsRepositoryAuthorizedRequest{} - mi := &file_teams_proto_msgTypes[19] + mi := &file_teams_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1787,7 +1872,7 @@ func (x *IsRepositoryAuthorizedRequest) String() string { func (*IsRepositoryAuthorizedRequest) ProtoMessage() {} func (x *IsRepositoryAuthorizedRequest) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[19] + mi := &file_teams_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1845,7 +1930,7 @@ type IsRepositoryAuthorizedResponse struct { func (x *IsRepositoryAuthorizedResponse) Reset() { *x = IsRepositoryAuthorizedResponse{} - mi := &file_teams_proto_msgTypes[20] + mi := &file_teams_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1857,7 +1942,7 @@ func (x *IsRepositoryAuthorizedResponse) String() string { func (*IsRepositoryAuthorizedResponse) ProtoMessage() {} func (x *IsRepositoryAuthorizedResponse) ProtoReflect() protoreflect.Message { - mi := &file_teams_proto_msgTypes[20] + mi := &file_teams_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2029,116 +2114,129 @@ var file_teams_proto_rawDesc = string([]byte{ 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x22, 0x7c, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, - 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, - 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, - 0x5a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x22, 0x88, 0x01, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, - 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x71, 0x0a, 0x1d, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x12, - 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4a, - 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, - 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x32, 0xa2, 0x08, 0x0a, 0x05, - 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, + 0x74, 0x22, 0x5f, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x22, 0x7c, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, + 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x5a, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x22, 0x88, 0x01, 0x0a, + 0x17, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x65, 0x61, 0x6d, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x39, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x71, 0x0a, 0x1d, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, + 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x32, 0x8e, 0x09, 0x0a, + 0x05, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x12, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6e, 0x61, 0x69, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x6e, 0x61, 0x69, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, - 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x6e, 0x61, + 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x6e, 0x61, + 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x21, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x07, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x0c, - 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x6e, - 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6e, + 0x75, 0x66, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x23, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x88, 0x01, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6a, 0x0a, 0x12, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x2c, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x42, + 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa9, 0x01, 0x0a, 0x24, 0x53, - 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x3e, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x24, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x7f, 0x0a, 0x16, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x30, 0x2e, 0x6e, 0x61, 0x69, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6e, 0x61, + 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x07, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x29, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, 0x0c, 0x45, 0x6e, 0x76, + 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2e, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6e, 0x61, 0x69, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x88, 0x01, 0x0a, + 0x19, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x33, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0xa9, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x3e, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x3f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x24, 0x2e, + 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7f, 0x0a, 0x16, 0x49, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x42, 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x30, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, 0x52, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x73, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x1a, 0x5a, + 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, }) -var file_teams_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_teams_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_teams_proto_goTypes = []any{ (*Team)(nil), // 0: nais.api.protobuf.Team (*ListAuthorizedRepositoriesRequest)(nil), // 1: nais.api.protobuf.ListAuthorizedRepositoriesRequest @@ -2155,46 +2253,49 @@ var file_teams_proto_goTypes = []any{ (*GetTeamResponse)(nil), // 12: nais.api.protobuf.GetTeamResponse (*GetTeamRequest)(nil), // 13: nais.api.protobuf.GetTeamRequest (*ListTeamsRequest)(nil), // 14: nais.api.protobuf.ListTeamsRequest - (*ListTeamsResponse)(nil), // 15: nais.api.protobuf.ListTeamsResponse - (*ListTeamMembersRequest)(nil), // 16: nais.api.protobuf.ListTeamMembersRequest - (*ListTeamMembersResponse)(nil), // 17: nais.api.protobuf.ListTeamMembersResponse - (*TeamMember)(nil), // 18: nais.api.protobuf.TeamMember - (*IsRepositoryAuthorizedRequest)(nil), // 19: nais.api.protobuf.IsRepositoryAuthorizedRequest - (*IsRepositoryAuthorizedResponse)(nil), // 20: nais.api.protobuf.IsRepositoryAuthorizedResponse - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp - (*PageInfo)(nil), // 22: nais.api.protobuf.PageInfo - (*User)(nil), // 23: nais.api.protobuf.User + (*ListForUserByEmailRequest)(nil), // 15: nais.api.protobuf.ListForUserByEmailRequest + (*ListTeamsResponse)(nil), // 16: nais.api.protobuf.ListTeamsResponse + (*ListTeamMembersRequest)(nil), // 17: nais.api.protobuf.ListTeamMembersRequest + (*ListTeamMembersResponse)(nil), // 18: nais.api.protobuf.ListTeamMembersResponse + (*TeamMember)(nil), // 19: nais.api.protobuf.TeamMember + (*IsRepositoryAuthorizedRequest)(nil), // 20: nais.api.protobuf.IsRepositoryAuthorizedRequest + (*IsRepositoryAuthorizedResponse)(nil), // 21: nais.api.protobuf.IsRepositoryAuthorizedResponse + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*PageInfo)(nil), // 23: nais.api.protobuf.PageInfo + (*User)(nil), // 24: nais.api.protobuf.User } var file_teams_proto_depIdxs = []int32{ - 21, // 0: nais.api.protobuf.Team.delete_key_confirmed_at:type_name -> google.protobuf.Timestamp + 22, // 0: nais.api.protobuf.Team.delete_key_confirmed_at:type_name -> google.protobuf.Timestamp 11, // 1: nais.api.protobuf.ListTeamEnvironmentsResponse.nodes:type_name -> nais.api.protobuf.TeamEnvironment - 22, // 2: nais.api.protobuf.ListTeamEnvironmentsResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 23, // 2: nais.api.protobuf.ListTeamEnvironmentsResponse.page_info:type_name -> nais.api.protobuf.PageInfo 0, // 3: nais.api.protobuf.GetTeamResponse.team:type_name -> nais.api.protobuf.Team 0, // 4: nais.api.protobuf.ListTeamsResponse.nodes:type_name -> nais.api.protobuf.Team - 22, // 5: nais.api.protobuf.ListTeamsResponse.page_info:type_name -> nais.api.protobuf.PageInfo - 18, // 6: nais.api.protobuf.ListTeamMembersResponse.nodes:type_name -> nais.api.protobuf.TeamMember - 22, // 7: nais.api.protobuf.ListTeamMembersResponse.page_info:type_name -> nais.api.protobuf.PageInfo - 23, // 8: nais.api.protobuf.TeamMember.user:type_name -> nais.api.protobuf.User + 23, // 5: nais.api.protobuf.ListTeamsResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 19, // 6: nais.api.protobuf.ListTeamMembersResponse.nodes:type_name -> nais.api.protobuf.TeamMember + 23, // 7: nais.api.protobuf.ListTeamMembersResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 24, // 8: nais.api.protobuf.TeamMember.user:type_name -> nais.api.protobuf.User 1, // 9: nais.api.protobuf.Teams.ListAuthorizedRepositories:input_type -> nais.api.protobuf.ListAuthorizedRepositoriesRequest 13, // 10: nais.api.protobuf.Teams.Get:input_type -> nais.api.protobuf.GetTeamRequest 14, // 11: nais.api.protobuf.Teams.List:input_type -> nais.api.protobuf.ListTeamsRequest - 16, // 12: nais.api.protobuf.Teams.Members:input_type -> nais.api.protobuf.ListTeamMembersRequest - 9, // 13: nais.api.protobuf.Teams.Environments:input_type -> nais.api.protobuf.ListTeamEnvironmentsRequest - 5, // 14: nais.api.protobuf.Teams.SetTeamExternalReferences:input_type -> nais.api.protobuf.SetTeamExternalReferencesRequest - 7, // 15: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:input_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesRequest - 3, // 16: nais.api.protobuf.Teams.Delete:input_type -> nais.api.protobuf.DeleteTeamRequest - 19, // 17: nais.api.protobuf.Teams.IsRepositoryAuthorized:input_type -> nais.api.protobuf.IsRepositoryAuthorizedRequest - 2, // 18: nais.api.protobuf.Teams.ListAuthorizedRepositories:output_type -> nais.api.protobuf.ListAuthorizedRepositoriesResponse - 12, // 19: nais.api.protobuf.Teams.Get:output_type -> nais.api.protobuf.GetTeamResponse - 15, // 20: nais.api.protobuf.Teams.List:output_type -> nais.api.protobuf.ListTeamsResponse - 17, // 21: nais.api.protobuf.Teams.Members:output_type -> nais.api.protobuf.ListTeamMembersResponse - 10, // 22: nais.api.protobuf.Teams.Environments:output_type -> nais.api.protobuf.ListTeamEnvironmentsResponse - 6, // 23: nais.api.protobuf.Teams.SetTeamExternalReferences:output_type -> nais.api.protobuf.SetTeamExternalReferencesResponse - 8, // 24: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:output_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesResponse - 4, // 25: nais.api.protobuf.Teams.Delete:output_type -> nais.api.protobuf.DeleteTeamResponse - 20, // 26: nais.api.protobuf.Teams.IsRepositoryAuthorized:output_type -> nais.api.protobuf.IsRepositoryAuthorizedResponse - 18, // [18:27] is the sub-list for method output_type - 9, // [9:18] is the sub-list for method input_type + 15, // 12: nais.api.protobuf.Teams.ListForUserByEmail:input_type -> nais.api.protobuf.ListForUserByEmailRequest + 17, // 13: nais.api.protobuf.Teams.Members:input_type -> nais.api.protobuf.ListTeamMembersRequest + 9, // 14: nais.api.protobuf.Teams.Environments:input_type -> nais.api.protobuf.ListTeamEnvironmentsRequest + 5, // 15: nais.api.protobuf.Teams.SetTeamExternalReferences:input_type -> nais.api.protobuf.SetTeamExternalReferencesRequest + 7, // 16: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:input_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesRequest + 3, // 17: nais.api.protobuf.Teams.Delete:input_type -> nais.api.protobuf.DeleteTeamRequest + 20, // 18: nais.api.protobuf.Teams.IsRepositoryAuthorized:input_type -> nais.api.protobuf.IsRepositoryAuthorizedRequest + 2, // 19: nais.api.protobuf.Teams.ListAuthorizedRepositories:output_type -> nais.api.protobuf.ListAuthorizedRepositoriesResponse + 12, // 20: nais.api.protobuf.Teams.Get:output_type -> nais.api.protobuf.GetTeamResponse + 16, // 21: nais.api.protobuf.Teams.List:output_type -> nais.api.protobuf.ListTeamsResponse + 16, // 22: nais.api.protobuf.Teams.ListForUserByEmail:output_type -> nais.api.protobuf.ListTeamsResponse + 18, // 23: nais.api.protobuf.Teams.Members:output_type -> nais.api.protobuf.ListTeamMembersResponse + 10, // 24: nais.api.protobuf.Teams.Environments:output_type -> nais.api.protobuf.ListTeamEnvironmentsResponse + 6, // 25: nais.api.protobuf.Teams.SetTeamExternalReferences:output_type -> nais.api.protobuf.SetTeamExternalReferencesResponse + 8, // 26: nais.api.protobuf.Teams.SetTeamEnvironmentExternalReferences:output_type -> nais.api.protobuf.SetTeamEnvironmentExternalReferencesResponse + 4, // 27: nais.api.protobuf.Teams.Delete:output_type -> nais.api.protobuf.DeleteTeamResponse + 21, // 28: nais.api.protobuf.Teams.IsRepositoryAuthorized:output_type -> nais.api.protobuf.IsRepositoryAuthorizedResponse + 19, // [19:29] is the sub-list for method output_type + 9, // [9:19] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name 9, // [9:9] is the sub-list for extension extendee 0, // [0:9] is the sub-list for field type_name @@ -2217,7 +2318,7 @@ func file_teams_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_teams_proto_rawDesc), len(file_teams_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 1, }, From bfa1240e837aa35858bdb2f4ceeacb7a9f991229 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 24 Aug 2026 15:31:43 +0200 Subject: [PATCH 2/4] Add some #nosec directives on false positives Co-authored-by: @x10an14-nav --- internal/auth/authn/handler.go | 4 ++-- internal/vulnerability/queries.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/auth/authn/handler.go b/internal/auth/authn/handler.go index 39962c61b..7fff4389a 100644 --- a/internal/auth/authn/handler.go +++ b/internal/auth/authn/handler.go @@ -89,7 +89,7 @@ func (h *handler) Login(w http.ResponseWriter, r *http.Request) { opts = append(opts, oauth2.SetAuthURLParam("login_hint", loginHint)) } - http.Redirect(w, r, h.oauth2Config.AuthCodeURL(oauthState, opts...), http.StatusFound) + http.Redirect(w, r, h.oauth2Config.AuthCodeURL(oauthState, opts...), http.StatusFound) //#nosec G710 } func (h *handler) Callback(w http.ResponseWriter, r *http.Request) { @@ -170,7 +170,7 @@ func (h *handler) Callback(w http.ResponseWriter, r *http.Request) { } h.SetSessionCookie(w, sess) - http.Redirect(w, r, frontendURL, http.StatusFound) + http.Redirect(w, r, frontendURL, http.StatusFound) //#nosec G710 -- URL is validated above } func (h *handler) Logout(w http.ResponseWriter, r *http.Request) { diff --git a/internal/vulnerability/queries.go b/internal/vulnerability/queries.go index 79b8b493a..01b1f8bc9 100644 --- a/internal/vulnerability/queries.go +++ b/internal/vulnerability/queries.go @@ -671,7 +671,7 @@ func GetWorkloadsByCVE(ctx context.Context, cve string, page *pagination.Paginat if err != nil { return nil, apierror.Errorf("list workloads for vulnerability by CVE: %v", err) } - return convertWorkloadNodes(ctx, resp.GetNodes(), page, int32(min(resp.GetPageInfo().GetTotalCount(), math.MaxInt32))) //nolint:gosec + return convertWorkloadNodes(ctx, resp.GetNodes(), page, int32(min(resp.GetPageInfo().GetTotalCount(), math.MaxInt32))) //#nosec G115 } return getWorkloadsByCVE(ctx, cve, page) } @@ -693,7 +693,7 @@ func getWorkloadsByCVE(ctx context.Context, cve string, page *pagination.Paginat if err != nil { return nil, apierror.Errorf("list workloads for vulnerability by CVE: %v", err) } - return convertWorkloadNodes(ctx, resp.GetNodes(), page, int32(min(resp.GetPageInfo().GetTotalCount(), math.MaxInt32))) //nolint:gosec + return convertWorkloadNodes(ctx, resp.GetNodes(), page, int32(min(resp.GetPageInfo().GetTotalCount(), math.MaxInt32))) //#nosec G115 } func convertWorkloadNodes(ctx context.Context, nodes []*vulnerabilities.WorkloadForVulnerability, page *pagination.Pagination, totalCount int32) (*WorkloadWithVulnerabilityConnection, error) { From 2ec905a6fbbee7beb007022f6d556c03576f96dc Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 24 Aug 2026 15:49:23 +0200 Subject: [PATCH 3/4] Bump some versions to resolve vulnerabilities Co-authored-by: @x10an14-nav --- go.mod | 24 ++++++++++++------------ go.sum | 56 +++++++++++++++++++++++++++---------------------------- mise.toml | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index b48044248..d129961cc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nais/api -go 1.26.4 +go 1.26.7 tool ( github.com/99designs/gqlgen @@ -76,12 +76,12 @@ require ( go.opentelemetry.io/otel/trace v1.44.0 golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa golang.org/x/oauth2 v0.36.0 - golang.org/x/sync v0.20.0 - golang.org/x/text v0.37.0 - golang.org/x/tools v0.45.0 + golang.org/x/sync v0.22.0 + golang.org/x/text v0.41.0 + golang.org/x/tools v0.48.0 google.golang.org/api v0.280.0 google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa - google.golang.org/grpc v1.81.1 + google.golang.org/grpc v1.83.1 google.golang.org/protobuf v1.36.11 k8s.io/api v0.35.3 k8s.io/apimachinery v0.35.3 @@ -92,7 +92,7 @@ require ( ) require ( - cel.dev/expr v0.25.1 // indirect + cel.dev/expr v0.25.2 // indirect cloud.google.com/go/auth v0.20.0 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect cloud.google.com/go/compute/metadata v0.9.0 // indirect @@ -447,13 +447,13 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect - golang.org/x/crypto v0.52.0 // indirect + golang.org/x/crypto v0.54.0 // indirect golang.org/x/exp/typeparams v0.0.0-20251209150349-8475f28825e9 // indirect - golang.org/x/mod v0.36.0 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 // indirect - golang.org/x/term v0.43.0 // indirect + golang.org/x/mod v0.38.0 // indirect + golang.org/x/net v0.57.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 // indirect + golang.org/x/term v0.45.0 // indirect golang.org/x/time v0.15.0 // indirect golang.org/x/vuln v1.3.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect diff --git a/go.sum b/go.sum index 072ae6985..116758fa9 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4= -cel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +cel.dev/expr v0.25.2 h1:K6j46C81hXtZQfuX60cVWQFBJahKSE2gfRbNuvr5bFs= +cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= @@ -68,8 +68,8 @@ github.com/DmitriyVTitov/size v1.5.0 h1:/PzqxYrOyOUX1BXj6J9OuVRVGe+66VL4D9FlUaW5 github.com/DmitriyVTitov/size v1.5.0/go.mod h1:le6rNI4CoLQV1b9gzp1+3d7hMAD/uu2QcJ+aYbNgiU0= github.com/GoogleCloudPlatform/k8s-config-connector v1.128.0 h1:AS9xEfy/bhzMclMNiUw4+1t8K6VoBxNHyxgBqws/1g4= github.com/GoogleCloudPlatform/k8s-config-connector v1.128.0/go.mod h1:6e84V8NOA89icS5Vb9hdQj+hUXP0zXur2M2vP7Pvz74= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0 h1:DHa2U07rk8syqvCge0QIGMCE1WxGj9njT44GH7zNJLQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0 h1:l7+6kwRMJNwdCvYdDl7Eax+wzEYHSnNY7zrrfbhDdTA= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0 h1:UnDZ/zFfG1JhH/DqxIZYU/1CUAlTUScoXD/LcM2Ykk8= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.55.0/go.mod h1:IA1C1U7jO/ENqm/vhi7V9YYpBsp+IMyqNrEN94N7tVc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.55.0 h1:0s6TxfCu2KHkkZPnBfsQ2y5qia0jl3MMrmBhu3nCOYk= @@ -1008,8 +1008,8 @@ github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiT github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo= -github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs= +github.com/spiffe/go-spiffe/v2 v2.7.0 h1:uXe1MflJoHw58wAUvxVlcM7WpKtijWG7I1UidcGh6g4= +github.com/spiffe/go-spiffe/v2 v2.7.0/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/sqlc-dev/doubleclick v1.0.0 h1:2/OApfQ2eLgcfa/Fqs8WSMA6atH0G8j9hHbQIgMfAXI= github.com/sqlc-dev/doubleclick v1.0.0/go.mod h1:ODHRroSrk/rr5neRHlWMSRijqOak8YmNaO3VAZCNl5Y= @@ -1171,8 +1171,8 @@ go.opentelemetry.io/contrib v1.36.0 h1:ZeE8MRl6bAmxcjZeznBfqTe6syNvMKdxdBMzv6fDV go.opentelemetry.io/contrib v1.36.0/go.mod h1:V0PijCkYR5XurE5ytnNJuqWMXPW60jJTPXOiKj6nvhI= go.opentelemetry.io/contrib/bridges/prometheus v0.64.0 h1:7TYhBCu6Xz6vDJGNtEslWZLuuX2IJ/aH50hBY4MVeUg= go.opentelemetry.io/contrib/bridges/prometheus v0.64.0/go.mod h1:tHQctZfAe7e4PBPGyt3kae6mQFXNpj+iiDJa3ithM50= -go.opentelemetry.io/contrib/detectors/gcp v1.42.0 h1:kpt2PEJuOuqYkPcktfJqWWDjTEd/FNgrxcniL7kQrXQ= -go.opentelemetry.io/contrib/detectors/gcp v1.42.0/go.mod h1:W9zQ439utxymRrXsUOzZbFX4JhLxXU4+ZnCt8GG7yA8= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= go.opentelemetry.io/contrib/exporters/autoexport v0.64.0 h1:9pzPj3RFyKOxBAMkM2w84LpT+rdHam1XoFA+QhARiRw= go.opentelemetry.io/contrib/exporters/autoexport v0.64.0/go.mod h1:hlVZx1btWH0XTfXpuGX9dsquB50s+tc3fYFOO5elo2M= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 h1:yI1/OhfEPy7J9eoa6Sj051C7n5dvpj0QX8g4sRchg04= @@ -1268,8 +1268,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa h1:Zt3DZoOFFYkKhDT3v7Lm9FDMEV06GpzjG2jrqW+QTE0= @@ -1282,8 +1282,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 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.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= -golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ= +golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= +golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1298,8 +1298,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= @@ -1311,8 +1311,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ 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= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1342,17 +1342,17 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 h1:HjU6IWBiAgRIdAJ9/y1rwCn+UELEmwV+VsTLzj/W4sE= -golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6/go.mod h1:Eqhaxk/wZsWEH8CRxLwj6xzEJbz7k1EFGqx7nyCoabE= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 h1:RJhm5l6Fo4rmEIcndxDllNhhf/fAx8qIm4t6A7vpm2A= +golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959/go.mod h1:LV7u5Oco+Z/g6XI7PqN+EUUUGGkEcmB1uj2ceI0fOVg= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1367,8 +1367,8 @@ 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-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8= -golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0= +golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= +golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -1409,8 +1409,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.81.1 h1:VnnIIZ88UzOOKLukQi+ImGz8O1Wdp8nAGGnvOfEIWQQ= -google.golang.org/grpc v1.81.1/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y= +google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/mise.toml b/mise.toml index 3b2b0c720..7fbf5dd42 100644 --- a/mise.toml +++ b/mise.toml @@ -2,7 +2,7 @@ pin = true [tools] -go = "1.26.4" +go = "1.26.7" helm = "4.1.0" node = "24" protoc = "29.3" From b262fb009c05ba37fcccef58bcff7219267d0ffd Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 24 Aug 2026 16:16:48 +0200 Subject: [PATCH 4/4] Create GRPC service for listing databases belonging to team Co-authored-by: @x10an14-nav --- internal/cmd/api/api.go | 2 +- internal/grpc/grpc.go | 5 +- internal/grpc/grpcdatabase/server.go | 88 ++++ internal/grpc/grpcdatabase/server_test.go | 218 +++++++++ .../testdata/dev-gcp/myteam/postgres.yaml | 23 + .../testdata/dev-gcp/myteam/sqldatabases.yaml | 15 + .../prod-gcp/myteam/sqldatabases.yaml | 7 + .../prod-gcp/otherteam/sqldatabases.yaml | 7 + pkg/apiclient/protoapi/databases.pb.go | 444 +++++++++++++++++ pkg/apiclient/protoapi/databases_grpc.pb.go | 121 +++++ .../protoapi/databases_protoopaque.pb.go | 446 ++++++++++++++++++ .../protoapi/mock_databases_server.go | 140 ++++++ pkg/apiclient/protoapi/schema/databases.proto | 36 ++ 13 files changed, 1550 insertions(+), 2 deletions(-) create mode 100644 internal/grpc/grpcdatabase/server.go create mode 100644 internal/grpc/grpcdatabase/server_test.go create mode 100644 internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/postgres.yaml create mode 100644 internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/sqldatabases.yaml create mode 100644 internal/grpc/grpcdatabase/testdata/prod-gcp/myteam/sqldatabases.yaml create mode 100644 internal/grpc/grpcdatabase/testdata/prod-gcp/otherteam/sqldatabases.yaml create mode 100644 pkg/apiclient/protoapi/databases.pb.go create mode 100644 pkg/apiclient/protoapi/databases_grpc.pb.go create mode 100644 pkg/apiclient/protoapi/databases_protoopaque.pb.go create mode 100644 pkg/apiclient/protoapi/mock_databases_server.go create mode 100644 pkg/apiclient/protoapi/schema/databases.proto diff --git a/internal/cmd/api/api.go b/internal/cmd/api/api.go index 420ba0e77..f2af27b58 100644 --- a/internal/cmd/api/api.go +++ b/internal/cmd/api/api.go @@ -394,7 +394,7 @@ func run(ctx context.Context, cfg *Config, log logrus.FieldLogger) error { }) wg.Go(func() error { - if err := grpc.Run(ctx, cfg.GRPCListenAddress, pool, log.WithField("subsystem", "grpc")); err != nil { + if err := grpc.Run(ctx, cfg.GRPCListenAddress, pool, watchers.SqlDatabaseWatcher, watchers.ZalandoPostgresWatcher, log.WithField("subsystem", "grpc")); err != nil { log.WithError(err).Errorf("error in GRPC server") return err } diff --git a/internal/grpc/grpc.go b/internal/grpc/grpc.go index 99026e63b..132362244 100644 --- a/internal/grpc/grpc.go +++ b/internal/grpc/grpc.go @@ -7,10 +7,12 @@ import ( "time" "github.com/jackc/pgx/v5/pgxpool" + "github.com/nais/api/internal/grpc/grpcdatabase" "github.com/nais/api/internal/grpc/grpcdeployment" "github.com/nais/api/internal/grpc/grpcreconciler" "github.com/nais/api/internal/grpc/grpcteam" "github.com/nais/api/internal/grpc/grpcuser" + "github.com/nais/api/internal/kubernetes/watchers" "github.com/nais/api/pkg/apiclient/protoapi" "github.com/sirupsen/logrus" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" @@ -18,7 +20,7 @@ import ( "google.golang.org/grpc" ) -func Run(ctx context.Context, listenAddress string, pool *pgxpool.Pool, log logrus.FieldLogger) error { +func Run(ctx context.Context, listenAddress string, pool *pgxpool.Pool, sqlDatabaseWatcher *watchers.SqlDatabaseWatcher, zalandoPostgresWatcher *watchers.ZalandoPostgresWatcher, log logrus.FieldLogger) error { log.Info("GRPC serving on ", listenAddress) lis, err := net.Listen("tcp", listenAddress) if err != nil { @@ -34,6 +36,7 @@ func Run(ctx context.Context, listenAddress string, pool *pgxpool.Pool, log logr protoapi.RegisterUsersServer(s, grpcuser.NewServer(pool)) protoapi.RegisterReconcilersServer(s, grpcreconciler.NewServer(pool)) protoapi.RegisterDeploymentsServer(s, grpcdeployment.NewServer(pool)) + protoapi.RegisterDatabasesServer(s, grpcdatabase.NewServer(sqlDatabaseWatcher, zalandoPostgresWatcher)) g, ctx := errgroup.WithContext(ctx) g.Go(func() error { return s.Serve(lis) }) diff --git a/internal/grpc/grpcdatabase/server.go b/internal/grpc/grpcdatabase/server.go new file mode 100644 index 000000000..c70509d92 --- /dev/null +++ b/internal/grpc/grpcdatabase/server.go @@ -0,0 +1,88 @@ +package grpcdatabase + +import ( + "context" + "slices" + "strings" + + "github.com/nais/api/internal/grpc/grpcpagination" + "github.com/nais/api/internal/kubernetes/watcher" + "github.com/nais/api/internal/kubernetes/watchers" + "github.com/nais/api/internal/persistence/postgres" + "github.com/nais/api/internal/persistence/sqlinstance" + "github.com/nais/api/pkg/apiclient/protoapi" +) + +type Server struct { + sqlDatabaseWatcher *watchers.SqlDatabaseWatcher + zalandoPostgresWatcher *watchers.ZalandoPostgresWatcher + protoapi.UnimplementedDatabasesServer +} + +func NewServer(sqlDatabaseWatcher *watchers.SqlDatabaseWatcher, zalandoPostgresWatcher *watchers.ZalandoPostgresWatcher) *Server { + return &Server{ + sqlDatabaseWatcher: sqlDatabaseWatcher, + zalandoPostgresWatcher: zalandoPostgresWatcher, + } +} + +func (s *Server) List(_ context.Context, r *protoapi.ListDatabasesRequest) (*protoapi.ListDatabasesResponse, error) { + sqlDatabases := watcher.Objects(s.sqlDatabaseWatcher.GetByNamespace(r.TeamSlug)) + postgresInstances := watcher.Objects(s.zalandoPostgresWatcher.GetByNamespace(r.TeamSlug)) + + all := make([]*protoapi.Database, 0, len(sqlDatabases)+len(postgresInstances)) + for _, d := range sqlDatabases { + all = append(all, sqlDatabaseToProto(d)) + } + for _, p := range postgresInstances { + all = append(all, postgresInstanceToProto(p)) + } + + // Sort by (type, environment, name, database) for deterministic pagination. + slices.SortFunc(all, func(a, b *protoapi.Database) int { + if c := strings.Compare(a.Type.String(), b.Type.String()); c != 0 { + return c + } + if c := strings.Compare(a.Environment, b.Environment); c != 0 { + return c + } + if c := strings.Compare(a.Name, b.Name); c != 0 { + return c + } + return strings.Compare(a.Database, b.Database) + }) + + total := len(all) + limit, offset := grpcpagination.Pagination(r) + + // Clamp to [0, total] with end >= start; limit/offset come from untrusted + // clients and may be negative. + start := min(max(int(offset), 0), total) + end := min(max(start+int(max(limit, 0)), start), total) + page := all[start:end] + + return &protoapi.ListDatabasesResponse{ + PageInfo: grpcpagination.PageInfo(r, total), + Nodes: page, + }, nil +} + +func sqlDatabaseToProto(d *sqlinstance.SQLDatabase) *protoapi.Database { + return &protoapi.Database{ + Name: d.SQLInstanceName, + Database: d.Name, + Environment: d.EnvironmentName, + TeamSlug: d.TeamSlug.String(), + Type: protoapi.DatabaseType_CLOUD_SQL, + } +} + +func postgresInstanceToProto(p *postgres.PostgresInstance) *protoapi.Database { + return &protoapi.Database{ + Name: p.Name, + Database: "app", + Environment: p.EnvironmentName, + TeamSlug: p.TeamSlug.String(), + Type: protoapi.DatabaseType_ZALANDO_POSTGRES, + } +} diff --git a/internal/grpc/grpcdatabase/server_test.go b/internal/grpc/grpcdatabase/server_test.go new file mode 100644 index 000000000..ffd895629 --- /dev/null +++ b/internal/grpc/grpcdatabase/server_test.go @@ -0,0 +1,218 @@ +package grpcdatabase_test + +import ( + "context" + "os" + "testing" + "time" + + "github.com/nais/api/internal/grpc/grpcdatabase" + "github.com/nais/api/internal/kubernetes" + "github.com/nais/api/internal/kubernetes/fake" + "github.com/nais/api/internal/kubernetes/watcher" + "github.com/nais/api/internal/kubernetes/watchers" + "github.com/nais/api/internal/persistence/postgres" + "github.com/nais/api/internal/persistence/sqlinstance" + "github.com/nais/api/pkg/apiclient/protoapi" + "github.com/sirupsen/logrus" + logrustest "github.com/sirupsen/logrus/hooks/test" +) + +func TestDatabasesServer_List(t *testing.T) { + ctx := context.Background() + + teamSlug := "myteam" + + // Sorted by (type, environment, name, database), the expected order is: + // + // CLOUD_SQL dev-gcp instance-a db-a + // CLOUD_SQL dev-gcp instance-a db-b + // CLOUD_SQL prod-gcp instance-a db-a + // ZALANDO_POSTGRES dev-gcp pg-a app + // ZALANDO_POSTGRES dev-gcp pg-b app + // + // Fixtures live under testdata/ — the fake client harness + // (internal/kubernetes/fake) sets the object namespace from the parent + // directory name, so files live under //. + server := newServer(t, ctx) + + type node struct { + typ protoapi.DatabaseType + environment string + name string + database string + } + + nodes := func(resp *protoapi.ListDatabasesResponse) []node { + ret := make([]node, 0, len(resp.Nodes)) + for _, n := range resp.Nodes { + ret = append(ret, node{typ: n.Type, environment: n.Environment, name: n.Name, database: n.Database}) + if n.TeamSlug != teamSlug { + t.Errorf("expected team slug %q, got %q", teamSlug, n.TeamSlug) + } + } + return ret + } + + t.Run("empty result for unknown team", func(t *testing.T) { + resp, err := server.List(ctx, &protoapi.ListDatabasesRequest{TeamSlug: "no-such-team"}) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if len(resp.Nodes) != 0 { + t.Errorf("expected 0 nodes, got %d", len(resp.Nodes)) + } + + if resp.PageInfo.TotalCount != 0 { + t.Errorf("expected total count 0, got %d", resp.PageInfo.TotalCount) + } + + if resp.PageInfo.HasNextPage || resp.PageInfo.HasPreviousPage { + t.Errorf("expected no next or previous page, got next=%v previous=%v", resp.PageInfo.HasNextPage, resp.PageInfo.HasPreviousPage) + } + }) + + t.Run("deterministic ordering", func(t *testing.T) { + expected := []node{ + {typ: protoapi.DatabaseType_CLOUD_SQL, environment: "dev-gcp", name: "instance-a", database: "db-a"}, + {typ: protoapi.DatabaseType_CLOUD_SQL, environment: "dev-gcp", name: "instance-a", database: "db-b"}, + {typ: protoapi.DatabaseType_CLOUD_SQL, environment: "prod-gcp", name: "instance-a", database: "db-a"}, + {typ: protoapi.DatabaseType_ZALANDO_POSTGRES, environment: "dev-gcp", name: "pg-a", database: "app"}, + {typ: protoapi.DatabaseType_ZALANDO_POSTGRES, environment: "dev-gcp", name: "pg-b", database: "app"}, + } + + // Repeated calls must return the same order. + for range 3 { + resp, err := server.List(ctx, &protoapi.ListDatabasesRequest{TeamSlug: teamSlug}) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if resp.PageInfo.TotalCount != int64(len(expected)) { + t.Fatalf("expected total count %d, got %d", len(expected), resp.PageInfo.TotalCount) + } + + got := nodes(resp) + if len(got) != len(expected) { + t.Fatalf("expected %d nodes, got %d", len(expected), len(got)) + } + + for i := range expected { + if got[i] != expected[i] { + t.Errorf("node %d: expected %+v, got %+v", i, expected[i], got[i]) + } + } + } + }) + + t.Run("partial final page", func(t *testing.T) { + resp, err := server.List(ctx, &protoapi.ListDatabasesRequest{ + TeamSlug: teamSlug, + Limit: 2, + Offset: 4, + }) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if len(resp.Nodes) != 1 { + t.Fatalf("expected 1 node, got %d", len(resp.Nodes)) + } + + if resp.Nodes[0].Name != "pg-b" { + t.Errorf("expected node %q, got %q", "pg-b", resp.Nodes[0].Name) + } + + if resp.PageInfo.HasNextPage { + t.Error("expected no next page") + } + + if !resp.PageInfo.HasPreviousPage { + t.Error("expected previous page") + } + }) + + t.Run("offset beyond length", func(t *testing.T) { + resp, err := server.List(ctx, &protoapi.ListDatabasesRequest{ + TeamSlug: teamSlug, + Limit: 10, + Offset: 100, + }) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if len(resp.Nodes) != 0 { + t.Errorf("expected 0 nodes, got %d", len(resp.Nodes)) + } + + if resp.PageInfo.TotalCount != 5 { + t.Errorf("expected total count 5, got %d", resp.PageInfo.TotalCount) + } + + if resp.PageInfo.HasNextPage { + t.Error("expected no next page") + } + + if !resp.PageInfo.HasPreviousPage { + t.Error("expected previous page") + } + }) + + negative := map[string]*protoapi.ListDatabasesRequest{ + "negative offset": {TeamSlug: teamSlug, Limit: 2, Offset: -1}, + "negative limit": {TeamSlug: teamSlug, Limit: -2, Offset: 0}, + "negative limit and offset": {TeamSlug: teamSlug, Limit: -100, Offset: -100}, + } + for name, req := range negative { + t.Run(name, func(t *testing.T) { + // Must not panic. + resp, err := server.List(ctx, req) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if resp.PageInfo.TotalCount != 5 { + t.Errorf("expected total count 5, got %d", resp.PageInfo.TotalCount) + } + }) + } +} + +func newServer(t *testing.T, ctx context.Context) *grpcdatabase.Server { + t.Helper() + + scheme, err := kubernetes.NewScheme() + if err != nil { + t.Fatalf("create scheme: %v", err) + } + + ccm, err := kubernetes.CreateClusterConfigMap("nav", []string{"dev-gcp", "prod-gcp"}, nil) + if err != nil { + t.Fatalf("create cluster config: %v", err) + } + + log, _ := logrustest.NewNullLogger() + log.SetLevel(logrus.PanicLevel) + + mgr, err := watcher.NewManager(scheme, ccm, log, watcher.WithClientCreator(fake.Clients(os.DirFS("./testdata")))) + if err != nil { + t.Fatalf("create watcher manager: %v", err) + } + t.Cleanup(mgr.Stop) + + sqlDatabaseWatcher := sqlinstance.NewDatabaseWatcher(ctx, mgr) + zalandoPostgresWatcher := postgres.NewZalandoPostgresWatcher(ctx, mgr) + + ctxWait, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + if !mgr.WaitForReady(ctxWait) { + t.Fatal("timed out waiting for watcher manager") + } + + return grpcdatabase.NewServer( + (*watchers.SqlDatabaseWatcher)(sqlDatabaseWatcher), + (*watchers.ZalandoPostgresWatcher)(zalandoPostgresWatcher), + ) +} diff --git a/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/postgres.yaml b/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/postgres.yaml new file mode 100644 index 000000000..ea34f1c0a --- /dev/null +++ b/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/postgres.yaml @@ -0,0 +1,23 @@ +apiVersion: data.nais.io/v1 +kind: Postgres +metadata: + name: pg-b +spec: + cluster: + majorVersion: "17" + resources: + diskSize: "2Gi" + cpu: "100m" + memory: "1Gi" +--- +apiVersion: data.nais.io/v1 +kind: Postgres +metadata: + name: pg-a +spec: + cluster: + majorVersion: "17" + resources: + diskSize: "2Gi" + cpu: "100m" + memory: "1Gi" diff --git a/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/sqldatabases.yaml b/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/sqldatabases.yaml new file mode 100644 index 000000000..1a41f420e --- /dev/null +++ b/internal/grpc/grpcdatabase/testdata/dev-gcp/myteam/sqldatabases.yaml @@ -0,0 +1,15 @@ +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: db-b +spec: + instanceRef: + name: instance-a +--- +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: db-a +spec: + instanceRef: + name: instance-a diff --git a/internal/grpc/grpcdatabase/testdata/prod-gcp/myteam/sqldatabases.yaml b/internal/grpc/grpcdatabase/testdata/prod-gcp/myteam/sqldatabases.yaml new file mode 100644 index 000000000..bc9279ea4 --- /dev/null +++ b/internal/grpc/grpcdatabase/testdata/prod-gcp/myteam/sqldatabases.yaml @@ -0,0 +1,7 @@ +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: db-a +spec: + instanceRef: + name: instance-a diff --git a/internal/grpc/grpcdatabase/testdata/prod-gcp/otherteam/sqldatabases.yaml b/internal/grpc/grpcdatabase/testdata/prod-gcp/otherteam/sqldatabases.yaml new file mode 100644 index 000000000..62fe507ec --- /dev/null +++ b/internal/grpc/grpcdatabase/testdata/prod-gcp/otherteam/sqldatabases.yaml @@ -0,0 +1,7 @@ +apiVersion: sql.cnrm.cloud.google.com/v1beta1 +kind: SQLDatabase +metadata: + name: other-team-db +spec: + instanceRef: + name: instance-a diff --git a/pkg/apiclient/protoapi/databases.pb.go b/pkg/apiclient/protoapi/databases.pb.go new file mode 100644 index 000000000..c92a0491b --- /dev/null +++ b/pkg/apiclient/protoapi/databases.pb.go @@ -0,0 +1,444 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.4 +// protoc v5.29.3 +// source: databases.proto + +//go:build !protoopaque + +package protoapi + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + unsafe "unsafe" +) + +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) +) + +type DatabaseType int32 + +const ( + DatabaseType_DATABASE_TYPE_UNSPECIFIED DatabaseType = 0 + DatabaseType_CLOUD_SQL DatabaseType = 1 + DatabaseType_ZALANDO_POSTGRES DatabaseType = 2 +) + +// Enum value maps for DatabaseType. +var ( + DatabaseType_name = map[int32]string{ + 0: "DATABASE_TYPE_UNSPECIFIED", + 1: "CLOUD_SQL", + 2: "ZALANDO_POSTGRES", + } + DatabaseType_value = map[string]int32{ + "DATABASE_TYPE_UNSPECIFIED": 0, + "CLOUD_SQL": 1, + "ZALANDO_POSTGRES": 2, + } +) + +func (x DatabaseType) Enum() *DatabaseType { + p := new(DatabaseType) + *p = x + return p +} + +func (x DatabaseType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DatabaseType) Descriptor() protoreflect.EnumDescriptor { + return file_databases_proto_enumTypes[0].Descriptor() +} + +func (DatabaseType) Type() protoreflect.EnumType { + return &file_databases_proto_enumTypes[0] +} + +func (x DatabaseType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type Database struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"` + Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` + TeamSlug string `protobuf:"bytes,4,opt,name=team_slug,json=teamSlug,proto3" json:"team_slug,omitempty"` + Type DatabaseType `protobuf:"varint,5,opt,name=type,proto3,enum=nais.api.protobuf.DatabaseType" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Database) Reset() { + *x = Database{} + mi := &file_databases_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Database) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Database) ProtoMessage() {} + +func (x *Database) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Database) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Database) GetDatabase() string { + if x != nil { + return x.Database + } + return "" +} + +func (x *Database) GetEnvironment() string { + if x != nil { + return x.Environment + } + return "" +} + +func (x *Database) GetTeamSlug() string { + if x != nil { + return x.TeamSlug + } + return "" +} + +func (x *Database) GetType() DatabaseType { + if x != nil { + return x.Type + } + return DatabaseType_DATABASE_TYPE_UNSPECIFIED +} + +func (x *Database) SetName(v string) { + x.Name = v +} + +func (x *Database) SetDatabase(v string) { + x.Database = v +} + +func (x *Database) SetEnvironment(v string) { + x.Environment = v +} + +func (x *Database) SetTeamSlug(v string) { + x.TeamSlug = v +} + +func (x *Database) SetType(v DatabaseType) { + x.Type = v +} + +type Database_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Name string + Database string + Environment string + TeamSlug string + Type DatabaseType +} + +func (b0 Database_builder) Build() *Database { + m0 := &Database{} + b, x := &b0, m0 + _, _ = b, x + x.Name = b.Name + x.Database = b.Database + x.Environment = b.Environment + x.TeamSlug = b.TeamSlug + x.Type = b.Type + return m0 +} + +type ListDatabasesRequest struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + TeamSlug string `protobuf:"bytes,3,opt,name=team_slug,json=teamSlug,proto3" json:"team_slug,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDatabasesRequest) Reset() { + *x = ListDatabasesRequest{} + mi := &file_databases_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDatabasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesRequest) ProtoMessage() {} + +func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListDatabasesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListDatabasesRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListDatabasesRequest) GetTeamSlug() string { + if x != nil { + return x.TeamSlug + } + return "" +} + +func (x *ListDatabasesRequest) SetLimit(v int64) { + x.Limit = v +} + +func (x *ListDatabasesRequest) SetOffset(v int64) { + x.Offset = v +} + +func (x *ListDatabasesRequest) SetTeamSlug(v string) { + x.TeamSlug = v +} + +type ListDatabasesRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Limit int64 + Offset int64 + TeamSlug string +} + +func (b0 ListDatabasesRequest_builder) Build() *ListDatabasesRequest { + m0 := &ListDatabasesRequest{} + b, x := &b0, m0 + _, _ = b, x + x.Limit = b.Limit + x.Offset = b.Offset + x.TeamSlug = b.TeamSlug + return m0 +} + +type ListDatabasesResponse struct { + state protoimpl.MessageState `protogen:"hybrid.v1"` + Nodes []*Database `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` + PageInfo *PageInfo `protobuf:"bytes,2,opt,name=page_info,json=pageInfo,proto3" json:"page_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDatabasesResponse) Reset() { + *x = ListDatabasesResponse{} + mi := &file_databases_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDatabasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesResponse) ProtoMessage() {} + +func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListDatabasesResponse) GetNodes() []*Database { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *ListDatabasesResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.PageInfo + } + return nil +} + +func (x *ListDatabasesResponse) SetNodes(v []*Database) { + x.Nodes = v +} + +func (x *ListDatabasesResponse) SetPageInfo(v *PageInfo) { + x.PageInfo = v +} + +func (x *ListDatabasesResponse) HasPageInfo() bool { + if x == nil { + return false + } + return x.PageInfo != nil +} + +func (x *ListDatabasesResponse) ClearPageInfo() { + x.PageInfo = nil +} + +type ListDatabasesResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Nodes []*Database + PageInfo *PageInfo +} + +func (b0 ListDatabasesResponse_builder) Build() *ListDatabasesResponse { + m0 := &ListDatabasesResponse{} + b, x := &b0, m0 + _, _ = b, x + x.Nodes = b.Nodes + x.PageInfo = b.PageInfo + return m0 +} + +var File_databases_proto protoreflect.FileDescriptor + +var file_databases_proto_rawDesc = string([]byte{ + 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x1a, 0x10, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, + 0x75, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, + 0x75, 0x67, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x61, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x22, 0x84, 0x01, 0x0a, 0x15, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x2a, 0x52, 0x0a, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, + 0x14, 0x0a, 0x10, 0x5a, 0x41, 0x4c, 0x41, 0x4e, 0x44, 0x4f, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x47, + 0x52, 0x45, 0x53, 0x10, 0x02, 0x32, 0x68, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +}) + +var file_databases_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_databases_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_databases_proto_goTypes = []any{ + (DatabaseType)(0), // 0: nais.api.protobuf.DatabaseType + (*Database)(nil), // 1: nais.api.protobuf.Database + (*ListDatabasesRequest)(nil), // 2: nais.api.protobuf.ListDatabasesRequest + (*ListDatabasesResponse)(nil), // 3: nais.api.protobuf.ListDatabasesResponse + (*PageInfo)(nil), // 4: nais.api.protobuf.PageInfo +} +var file_databases_proto_depIdxs = []int32{ + 0, // 0: nais.api.protobuf.Database.type:type_name -> nais.api.protobuf.DatabaseType + 1, // 1: nais.api.protobuf.ListDatabasesResponse.nodes:type_name -> nais.api.protobuf.Database + 4, // 2: nais.api.protobuf.ListDatabasesResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 2, // 3: nais.api.protobuf.Databases.List:input_type -> nais.api.protobuf.ListDatabasesRequest + 3, // 4: nais.api.protobuf.Databases.List:output_type -> nais.api.protobuf.ListDatabasesResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_databases_proto_init() } +func file_databases_proto_init() { + if File_databases_proto != nil { + return + } + file_pagination_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_databases_proto_rawDesc), len(file_databases_proto_rawDesc)), + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_databases_proto_goTypes, + DependencyIndexes: file_databases_proto_depIdxs, + EnumInfos: file_databases_proto_enumTypes, + MessageInfos: file_databases_proto_msgTypes, + }.Build() + File_databases_proto = out.File + file_databases_proto_goTypes = nil + file_databases_proto_depIdxs = nil +} diff --git a/pkg/apiclient/protoapi/databases_grpc.pb.go b/pkg/apiclient/protoapi/databases_grpc.pb.go new file mode 100644 index 000000000..6c60d346c --- /dev/null +++ b/pkg/apiclient/protoapi/databases_grpc.pb.go @@ -0,0 +1,121 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: databases.proto + +package protoapi + +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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Databases_List_FullMethodName = "/nais.api.protobuf.Databases/List" +) + +// DatabasesClient is the client API for Databases 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 DatabasesClient interface { + List(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) +} + +type databasesClient struct { + cc grpc.ClientConnInterface +} + +func NewDatabasesClient(cc grpc.ClientConnInterface) DatabasesClient { + return &databasesClient{cc} +} + +func (c *databasesClient) List(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListDatabasesResponse) + err := c.cc.Invoke(ctx, Databases_List_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DatabasesServer is the server API for Databases service. +// All implementations must embed UnimplementedDatabasesServer +// for forward compatibility. +type DatabasesServer interface { + List(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) + mustEmbedUnimplementedDatabasesServer() +} + +// UnimplementedDatabasesServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedDatabasesServer struct{} + +func (UnimplementedDatabasesServer) List(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedDatabasesServer) mustEmbedUnimplementedDatabasesServer() {} +func (UnimplementedDatabasesServer) testEmbeddedByValue() {} + +// UnsafeDatabasesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DatabasesServer will +// result in compilation errors. +type UnsafeDatabasesServer interface { + mustEmbedUnimplementedDatabasesServer() +} + +func RegisterDatabasesServer(s grpc.ServiceRegistrar, srv DatabasesServer) { + // If the following call pancis, it indicates UnimplementedDatabasesServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Databases_ServiceDesc, srv) +} + +func _Databases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDatabasesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatabasesServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Databases_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatabasesServer).List(ctx, req.(*ListDatabasesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Databases_ServiceDesc is the grpc.ServiceDesc for Databases service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Databases_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "nais.api.protobuf.Databases", + HandlerType: (*DatabasesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "List", + Handler: _Databases_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "databases.proto", +} diff --git a/pkg/apiclient/protoapi/databases_protoopaque.pb.go b/pkg/apiclient/protoapi/databases_protoopaque.pb.go new file mode 100644 index 000000000..f0eb1aca8 --- /dev/null +++ b/pkg/apiclient/protoapi/databases_protoopaque.pb.go @@ -0,0 +1,446 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.4 +// protoc v5.29.3 +// source: databases.proto + +//go:build protoopaque + +package protoapi + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + unsafe "unsafe" +) + +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) +) + +type DatabaseType int32 + +const ( + DatabaseType_DATABASE_TYPE_UNSPECIFIED DatabaseType = 0 + DatabaseType_CLOUD_SQL DatabaseType = 1 + DatabaseType_ZALANDO_POSTGRES DatabaseType = 2 +) + +// Enum value maps for DatabaseType. +var ( + DatabaseType_name = map[int32]string{ + 0: "DATABASE_TYPE_UNSPECIFIED", + 1: "CLOUD_SQL", + 2: "ZALANDO_POSTGRES", + } + DatabaseType_value = map[string]int32{ + "DATABASE_TYPE_UNSPECIFIED": 0, + "CLOUD_SQL": 1, + "ZALANDO_POSTGRES": 2, + } +) + +func (x DatabaseType) Enum() *DatabaseType { + p := new(DatabaseType) + *p = x + return p +} + +func (x DatabaseType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DatabaseType) Descriptor() protoreflect.EnumDescriptor { + return file_databases_proto_enumTypes[0].Descriptor() +} + +func (DatabaseType) Type() protoreflect.EnumType { + return &file_databases_proto_enumTypes[0] +} + +func (x DatabaseType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +type Database struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Name string `protobuf:"bytes,1,opt,name=name,proto3"` + xxx_hidden_Database string `protobuf:"bytes,2,opt,name=database,proto3"` + xxx_hidden_Environment string `protobuf:"bytes,3,opt,name=environment,proto3"` + xxx_hidden_TeamSlug string `protobuf:"bytes,4,opt,name=team_slug,json=teamSlug,proto3"` + xxx_hidden_Type DatabaseType `protobuf:"varint,5,opt,name=type,proto3,enum=nais.api.protobuf.DatabaseType"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Database) Reset() { + *x = Database{} + mi := &file_databases_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Database) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Database) ProtoMessage() {} + +func (x *Database) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Database) GetName() string { + if x != nil { + return x.xxx_hidden_Name + } + return "" +} + +func (x *Database) GetDatabase() string { + if x != nil { + return x.xxx_hidden_Database + } + return "" +} + +func (x *Database) GetEnvironment() string { + if x != nil { + return x.xxx_hidden_Environment + } + return "" +} + +func (x *Database) GetTeamSlug() string { + if x != nil { + return x.xxx_hidden_TeamSlug + } + return "" +} + +func (x *Database) GetType() DatabaseType { + if x != nil { + return x.xxx_hidden_Type + } + return DatabaseType_DATABASE_TYPE_UNSPECIFIED +} + +func (x *Database) SetName(v string) { + x.xxx_hidden_Name = v +} + +func (x *Database) SetDatabase(v string) { + x.xxx_hidden_Database = v +} + +func (x *Database) SetEnvironment(v string) { + x.xxx_hidden_Environment = v +} + +func (x *Database) SetTeamSlug(v string) { + x.xxx_hidden_TeamSlug = v +} + +func (x *Database) SetType(v DatabaseType) { + x.xxx_hidden_Type = v +} + +type Database_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Name string + Database string + Environment string + TeamSlug string + Type DatabaseType +} + +func (b0 Database_builder) Build() *Database { + m0 := &Database{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Name = b.Name + x.xxx_hidden_Database = b.Database + x.xxx_hidden_Environment = b.Environment + x.xxx_hidden_TeamSlug = b.TeamSlug + x.xxx_hidden_Type = b.Type + return m0 +} + +type ListDatabasesRequest struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Limit int64 `protobuf:"varint,1,opt,name=limit,proto3"` + xxx_hidden_Offset int64 `protobuf:"varint,2,opt,name=offset,proto3"` + xxx_hidden_TeamSlug string `protobuf:"bytes,3,opt,name=team_slug,json=teamSlug,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDatabasesRequest) Reset() { + *x = ListDatabasesRequest{} + mi := &file_databases_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDatabasesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesRequest) ProtoMessage() {} + +func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListDatabasesRequest) GetLimit() int64 { + if x != nil { + return x.xxx_hidden_Limit + } + return 0 +} + +func (x *ListDatabasesRequest) GetOffset() int64 { + if x != nil { + return x.xxx_hidden_Offset + } + return 0 +} + +func (x *ListDatabasesRequest) GetTeamSlug() string { + if x != nil { + return x.xxx_hidden_TeamSlug + } + return "" +} + +func (x *ListDatabasesRequest) SetLimit(v int64) { + x.xxx_hidden_Limit = v +} + +func (x *ListDatabasesRequest) SetOffset(v int64) { + x.xxx_hidden_Offset = v +} + +func (x *ListDatabasesRequest) SetTeamSlug(v string) { + x.xxx_hidden_TeamSlug = v +} + +type ListDatabasesRequest_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Limit int64 + Offset int64 + TeamSlug string +} + +func (b0 ListDatabasesRequest_builder) Build() *ListDatabasesRequest { + m0 := &ListDatabasesRequest{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Limit = b.Limit + x.xxx_hidden_Offset = b.Offset + x.xxx_hidden_TeamSlug = b.TeamSlug + return m0 +} + +type ListDatabasesResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Nodes *[]*Database `protobuf:"bytes,1,rep,name=nodes,proto3"` + xxx_hidden_PageInfo *PageInfo `protobuf:"bytes,2,opt,name=page_info,json=pageInfo,proto3"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDatabasesResponse) Reset() { + *x = ListDatabasesResponse{} + mi := &file_databases_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDatabasesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDatabasesResponse) ProtoMessage() {} + +func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message { + mi := &file_databases_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *ListDatabasesResponse) GetNodes() []*Database { + if x != nil { + if x.xxx_hidden_Nodes != nil { + return *x.xxx_hidden_Nodes + } + } + return nil +} + +func (x *ListDatabasesResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.xxx_hidden_PageInfo + } + return nil +} + +func (x *ListDatabasesResponse) SetNodes(v []*Database) { + x.xxx_hidden_Nodes = &v +} + +func (x *ListDatabasesResponse) SetPageInfo(v *PageInfo) { + x.xxx_hidden_PageInfo = v +} + +func (x *ListDatabasesResponse) HasPageInfo() bool { + if x == nil { + return false + } + return x.xxx_hidden_PageInfo != nil +} + +func (x *ListDatabasesResponse) ClearPageInfo() { + x.xxx_hidden_PageInfo = nil +} + +type ListDatabasesResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Nodes []*Database + PageInfo *PageInfo +} + +func (b0 ListDatabasesResponse_builder) Build() *ListDatabasesResponse { + m0 := &ListDatabasesResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Nodes = &b.Nodes + x.xxx_hidden_PageInfo = b.PageInfo + return m0 +} + +var File_databases_proto protoreflect.FileDescriptor + +var file_databases_proto_rawDesc = string([]byte{ + 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x11, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x1a, 0x10, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, + 0x75, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, + 0x75, 0x67, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x61, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x22, 0x84, 0x01, 0x0a, 0x15, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x50, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x2a, 0x52, 0x0a, 0x0c, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4c, 0x4f, 0x55, 0x44, 0x5f, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x12, + 0x14, 0x0a, 0x10, 0x5a, 0x41, 0x4c, 0x41, 0x4e, 0x44, 0x4f, 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x47, + 0x52, 0x45, 0x53, 0x10, 0x02, 0x32, 0x68, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x73, 0x12, 0x5b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x6e, 0x61, 0x69, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6e, 0x61, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +}) + +var file_databases_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_databases_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_databases_proto_goTypes = []any{ + (DatabaseType)(0), // 0: nais.api.protobuf.DatabaseType + (*Database)(nil), // 1: nais.api.protobuf.Database + (*ListDatabasesRequest)(nil), // 2: nais.api.protobuf.ListDatabasesRequest + (*ListDatabasesResponse)(nil), // 3: nais.api.protobuf.ListDatabasesResponse + (*PageInfo)(nil), // 4: nais.api.protobuf.PageInfo +} +var file_databases_proto_depIdxs = []int32{ + 0, // 0: nais.api.protobuf.Database.type:type_name -> nais.api.protobuf.DatabaseType + 1, // 1: nais.api.protobuf.ListDatabasesResponse.nodes:type_name -> nais.api.protobuf.Database + 4, // 2: nais.api.protobuf.ListDatabasesResponse.page_info:type_name -> nais.api.protobuf.PageInfo + 2, // 3: nais.api.protobuf.Databases.List:input_type -> nais.api.protobuf.ListDatabasesRequest + 3, // 4: nais.api.protobuf.Databases.List:output_type -> nais.api.protobuf.ListDatabasesResponse + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_databases_proto_init() } +func file_databases_proto_init() { + if File_databases_proto != nil { + return + } + file_pagination_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_databases_proto_rawDesc), len(file_databases_proto_rawDesc)), + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_databases_proto_goTypes, + DependencyIndexes: file_databases_proto_depIdxs, + EnumInfos: file_databases_proto_enumTypes, + MessageInfos: file_databases_proto_msgTypes, + }.Build() + File_databases_proto = out.File + file_databases_proto_goTypes = nil + file_databases_proto_depIdxs = nil +} diff --git a/pkg/apiclient/protoapi/mock_databases_server.go b/pkg/apiclient/protoapi/mock_databases_server.go new file mode 100644 index 000000000..b6568c998 --- /dev/null +++ b/pkg/apiclient/protoapi/mock_databases_server.go @@ -0,0 +1,140 @@ +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify + +package protoapi + +import ( + "context" + + mock "github.com/stretchr/testify/mock" +) + +// NewMockDatabasesServer creates a new instance of MockDatabasesServer. 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 NewMockDatabasesServer(t interface { + mock.TestingT + Cleanup(func()) +}, +) *MockDatabasesServer { + mock := &MockDatabasesServer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + +// MockDatabasesServer is an autogenerated mock type for the DatabasesServer type +type MockDatabasesServer struct { + mock.Mock +} + +type MockDatabasesServer_Expecter struct { + mock *mock.Mock +} + +func (_m *MockDatabasesServer) EXPECT() *MockDatabasesServer_Expecter { + return &MockDatabasesServer_Expecter{mock: &_m.Mock} +} + +// List provides a mock function for the type MockDatabasesServer +func (_mock *MockDatabasesServer) List(context1 context.Context, listDatabasesRequest *ListDatabasesRequest) (*ListDatabasesResponse, error) { + ret := _mock.Called(context1, listDatabasesRequest) + + if len(ret) == 0 { + panic("no return value specified for List") + } + + var r0 *ListDatabasesResponse + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error)); ok { + return returnFunc(context1, listDatabasesRequest) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, *ListDatabasesRequest) *ListDatabasesResponse); ok { + r0 = returnFunc(context1, listDatabasesRequest) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*ListDatabasesResponse) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, *ListDatabasesRequest) error); ok { + r1 = returnFunc(context1, listDatabasesRequest) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockDatabasesServer_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' +type MockDatabasesServer_List_Call struct { + *mock.Call +} + +// List is a helper method to define mock.On call +// - context1 context.Context +// - listDatabasesRequest *ListDatabasesRequest +func (_e *MockDatabasesServer_Expecter) List(context1 interface{}, listDatabasesRequest interface{}) *MockDatabasesServer_List_Call { + return &MockDatabasesServer_List_Call{Call: _e.mock.On("List", context1, listDatabasesRequest)} +} + +func (_c *MockDatabasesServer_List_Call) Run(run func(context1 context.Context, listDatabasesRequest *ListDatabasesRequest)) *MockDatabasesServer_List_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 *ListDatabasesRequest + if args[1] != nil { + arg1 = args[1].(*ListDatabasesRequest) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockDatabasesServer_List_Call) Return(listDatabasesResponse *ListDatabasesResponse, err error) *MockDatabasesServer_List_Call { + _c.Call.Return(listDatabasesResponse, err) + return _c +} + +func (_c *MockDatabasesServer_List_Call) RunAndReturn(run func(context1 context.Context, listDatabasesRequest *ListDatabasesRequest) (*ListDatabasesResponse, error)) *MockDatabasesServer_List_Call { + _c.Call.Return(run) + return _c +} + +// mustEmbedUnimplementedDatabasesServer provides a mock function for the type MockDatabasesServer +func (_mock *MockDatabasesServer) mustEmbedUnimplementedDatabasesServer() { + _mock.Called() + return +} + +// MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'mustEmbedUnimplementedDatabasesServer' +type MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call struct { + *mock.Call +} + +// mustEmbedUnimplementedDatabasesServer is a helper method to define mock.On call +func (_e *MockDatabasesServer_Expecter) mustEmbedUnimplementedDatabasesServer() *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call { + return &MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call{Call: _e.mock.On("mustEmbedUnimplementedDatabasesServer")} +} + +func (_c *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call) Run(run func()) *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call) Return() *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call { + _c.Call.Return() + return _c +} + +func (_c *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call) RunAndReturn(run func()) *MockDatabasesServer_mustEmbedUnimplementedDatabasesServer_Call { + _c.Run(run) + return _c +} diff --git a/pkg/apiclient/protoapi/schema/databases.proto b/pkg/apiclient/protoapi/schema/databases.proto new file mode 100644 index 000000000..6876580c5 --- /dev/null +++ b/pkg/apiclient/protoapi/schema/databases.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package nais.api.protobuf; + +import "pagination.proto"; + +option go_package = "./pkg/apiclient/protoapi"; + +enum DatabaseType { + DATABASE_TYPE_UNSPECIFIED = 0; + CLOUD_SQL = 1; + ZALANDO_POSTGRES = 2; +} + +message Database { + string name = 1; + string database = 2; + string environment = 3; + string team_slug = 4; + DatabaseType type = 5; +} + +service Databases { + rpc List(ListDatabasesRequest) returns (ListDatabasesResponse) {} +} + +message ListDatabasesRequest { + int64 limit = 1; + int64 offset = 2; + string team_slug = 3; +} + +message ListDatabasesResponse { + repeated Database nodes = 1; + PageInfo page_info = 2; +}