From 47421e8078e2da14a91a5283b9730761942ff79e Mon Sep 17 00:00:00 2001 From: Thomas Krampl Date: Wed, 21 Feb 2024 12:41:06 +0100 Subject: [PATCH 1/2] Use nais-api instead of teams backend Generate GRPC client using proto files from nais/api. --- Makefile | 22 + charts/hookd/Feature.yaml | 11 +- charts/hookd/templates/netpol.yaml | 3 +- charts/hookd/templates/secret.yaml | 4 +- charts/hookd/values.yaml | 5 +- cmd/hookd/main.go | 9 +- pkg/hookd/config/config.go | 44 +- pkg/naisapi/naisapi.go | 45 + pkg/naisapi/protoapi/pagination.pb.go | 163 +++ pkg/naisapi/protoapi/teams.pb.go | 1808 +++++++++++++++++++++++++ pkg/naisapi/protoapi/teams_grpc.pb.go | 405 ++++++ pkg/naisapi/protoapi/users.pb.go | 476 +++++++ pkg/naisapi/protoapi/users_grpc.pb.go | 146 ++ 13 files changed, 3104 insertions(+), 37 deletions(-) create mode 100644 pkg/naisapi/naisapi.go create mode 100644 pkg/naisapi/protoapi/pagination.pb.go create mode 100644 pkg/naisapi/protoapi/teams.pb.go create mode 100644 pkg/naisapi/protoapi/teams_grpc.pb.go create mode 100644 pkg/naisapi/protoapi/users.pb.go create mode 100644 pkg/naisapi/protoapi/users_grpc.pb.go diff --git a/Makefile b/Makefile index 9f6bca1a..fa0e3371 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ K8S_VERSION := 1.27.1 LAST_COMMIT = $(shell git rev-parse --short HEAD) VERSION ?= $(DATE)-$(LAST_COMMIT) LDFLAGS := -X github.com/nais/deploy/pkg/version.Revision=$(LAST_COMMIT) -X github.com/nais/deploy/pkg/version.Date=$(DATE) -X github.com/nais/deploy/pkg/version.BuildUnixTime=$(BUILDTIME) +NAIS_API_COMMIT_SHA := 0f2590f0befcdc5473474007174bb4a5d0b1f97e +NAIS_API_TARGET_DIR=pkg/naisapi/protoapi arch := $(shell uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) os := $(shell uname -s | tr '[:upper:]' '[:lower:]') testbin_dir := ./.testbin/ @@ -88,3 +90,23 @@ hookd-alpine: deploy-alpine: go build -a -installsuffix cgo -o bin/deploy -ldflags "-s $(LDFLAGS)" ./cmd/deploy/ + +generate-nais-api: + mkdir -p ./$(NAIS_API_TARGET_DIR) + wget -O ./$(NAIS_API_TARGET_DIR)/teams.proto https://raw.githubusercontent.com/nais/api/$(NAIS_API_COMMIT_SHA)/pkg/protoapi/schema/teams.proto + wget -O ./$(NAIS_API_TARGET_DIR)/users.proto https://raw.githubusercontent.com/nais/api/$(NAIS_API_COMMIT_SHA)/pkg/protoapi/schema/users.proto + wget -O ./$(NAIS_API_TARGET_DIR)/pagination.proto https://raw.githubusercontent.com/nais/api/$(NAIS_API_COMMIT_SHA)/pkg/protoapi/schema/pagination.proto + $(PROTOC) \ + --proto_path=$(NAIS_API_TARGET_DIR) \ + --go_opt=Mpagination.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go_opt=Musers.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go_opt=Mteams.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go_opt=paths=source_relative \ + --go_out=$(NAIS_API_TARGET_DIR) \ + --go-grpc_opt=Mpagination.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go-grpc_opt=Musers.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go-grpc_opt=Mteams.proto=github.com/nais/deploy/$(NAIS_API_TARGET_DIR) \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_out=$(NAIS_API_TARGET_DIR) \ + $(NAIS_API_TARGET_DIR)/*.proto + rm -f $(NAIS_API_TARGET_DIR)/*.proto diff --git a/charts/hookd/Feature.yaml b/charts/hookd/Feature.yaml index 7f00e9f0..9bed26be 100644 --- a/charts/hookd/Feature.yaml +++ b/charts/hookd/Feature.yaml @@ -1,6 +1,6 @@ dependencies: - allOf: - - teams-backend + - nais-api environmentKinds: - management values: @@ -61,13 +61,12 @@ values: displayName: Ingress URL computed: template: '"{{ subdomain . "deploy" }}"' - teamsAPIKey: - displayName: "teams api key" - computed: - template: "{{.Management.hookd_teams_api_key | quote}}" - description: "API key used for teams integration" frontendPreSharedKey: displayName: "console-backend pre-shared key" computed: template: "{{.Management.hookd_frontend_pre_shared_key | quote}}" description: "The pre-shared key used to authenticate the console-backend" + naisAPI.insecure: + displayName: Insecure connection to NAIS API + config: + type: bool diff --git a/charts/hookd/templates/netpol.yaml b/charts/hookd/templates/netpol.yaml index aa201b52..fdb720d3 100644 --- a/charts/hookd/templates/netpol.yaml +++ b/charts/hookd/templates/netpol.yaml @@ -25,8 +25,7 @@ spec: kubernetes.io/metadata.name: nais-system podSelector: matchLabels: - app.kubernetes.io/instance: teams-backend - app.kubernetes.io/name: teams-backend + app: nais-api podSelector: matchLabels: {{- include "hookd.selectorLabels" . | nindent 6 }} diff --git a/charts/hookd/templates/secret.yaml b/charts/hookd/templates/secret.yaml index 31932c1e..959485dd 100644 --- a/charts/hookd/templates/secret.yaml +++ b/charts/hookd/templates/secret.yaml @@ -25,5 +25,5 @@ stringData: HOOKD_LOG_LINK_FORMATTER: "{{ .Values.logLinkFormatter }}" HOOKD_OAUTH_ENABLED: "true" HOOKD_PROVISION_KEY: "{{ .Values.provisionKey }}" - HOOKD_TEAMS_API_KEY: "{{ .Values.teamsAPIKey }}" - HOOKD_TEAMS_URL: "{{ .Values.teamsURL }}" + HOOKD_NAIS_API_ADDRESS: "{{ .Values.naisAPI.address }}" + HOOKD_NAIS_API_INSECURE_CONNECTION: "{{ .Values.naisAPI.insecureConnection }}" diff --git a/charts/hookd/values.yaml b/charts/hookd/values.yaml index 571a80ec..99ecc887 100644 --- a/charts/hookd/values.yaml +++ b/charts/hookd/values.yaml @@ -44,5 +44,6 @@ frontendPreSharedKey: # mapped by fasit imagePullSecrets: [] -teamsAPIKey: # mapped by fasit -teamsURL: "http://teams-backend/query" +naisAPI: + address: "nais-api:3001" + insecureConnection: "false" diff --git a/cmd/hookd/main.go b/cmd/hookd/main.go index 287acb63..aa490477 100644 --- a/cmd/hookd/main.go +++ b/cmd/hookd/main.go @@ -31,8 +31,8 @@ import ( "github.com/nais/deploy/pkg/hookd/logproxy" "github.com/nais/deploy/pkg/hookd/middleware" "github.com/nais/deploy/pkg/logging" + "github.com/nais/deploy/pkg/naisapi" "github.com/nais/deploy/pkg/pb" - "github.com/nais/deploy/pkg/teams" "github.com/nais/deploy/pkg/version" ) @@ -179,8 +179,11 @@ func startGrpcServer(cfg config.Config, db database.DeploymentStore, apikeys dat return nil, nil, fmt.Errorf("unable to set up github validator: %w", err) } - teamsClient := teams.New(cfg.TeamsURL, cfg.TeamsAPIKey) - authInterceptor := auth_interceptor.NewServerInterceptor(apikeys, ghValidator, teamsClient) + apiClient, err := naisapi.NewClient(cfg.NaisAPIAddress, cfg.NaisAPIInsecureConnection) + if err != nil { + return nil, nil, fmt.Errorf("unable to set up nais-api client: %w", err) + } + authInterceptor := auth_interceptor.NewServerInterceptor(apikeys, ghValidator, apiClient) interceptor.Add(pb.Deploy_ServiceDesc.ServiceName, authInterceptor) log.Infof("Authentication enabled for deployment requests") diff --git a/pkg/hookd/config/config.go b/pkg/hookd/config/config.go index 6c6ca57a..d1a28e7d 100644 --- a/pkg/hookd/config/config.go +++ b/pkg/hookd/config/config.go @@ -16,24 +16,24 @@ type GRPC struct { } type Config struct { - BaseURL string `json:"base-url"` - DatabaseConnectTimeout time.Duration `json:"database-connect-timeout"` - DatabaseEncryptionKey string `json:"database-encryption-key"` - DatabaseURL string `json:"database-url"` - DeploydKeys []string `json:"deployd-keys"` - FrontendKeys []string `json:"frontend-keys"` - GRPC GRPC `json:"grpc"` - GoogleAllowedDomains []string `json:"google-allowed-domains"` - GoogleClientId string `json:"google-client-id"` - GoogleClusterProjects []string `json:"google-cluster-projects"` - ListenAddress string `json:"listen-address"` - LogFormat string `json:"log-format"` - LogLevel string `json:"log-level"` - LogLinkFormatter string `json:"log-link-formatter"` - MetricsPath string `json:"metrics-path"` - ProvisionKey string `json:"provision-key"` - TeamsAPIKey string `json:"teams-api-key"` - TeamsURL string `json:"teams-url"` + BaseURL string `json:"base-url"` + DatabaseConnectTimeout time.Duration `json:"database-connect-timeout"` + DatabaseEncryptionKey string `json:"database-encryption-key"` + DatabaseURL string `json:"database-url"` + DeploydKeys []string `json:"deployd-keys"` + FrontendKeys []string `json:"frontend-keys"` + GRPC GRPC `json:"grpc"` + GoogleAllowedDomains []string `json:"google-allowed-domains"` + GoogleClientId string `json:"google-client-id"` + GoogleClusterProjects []string `json:"google-cluster-projects"` + ListenAddress string `json:"listen-address"` + LogFormat string `json:"log-format"` + LogLevel string `json:"log-level"` + LogLinkFormatter string `json:"log-link-formatter"` + MetricsPath string `json:"metrics-path"` + ProvisionKey string `json:"provision-key"` + NaisAPIAddress string `json:"nais-api-address"` + NaisAPIInsecureConnection bool `json:"nais-api-insecure-connection"` } const ( @@ -56,8 +56,8 @@ const ( LogLinkFormatter = "log-link-formatter" MetricsPath = "metrics-path" ProvisionKey = "provision-key" - TeamsAPIKey = "teams-api-key" - TeamsURL = "teams-url" + NaisAPIAddress = "nais-api-address" + NaisAPIInsecureConnection = "nais-api-insecure-connection" ) // Bind environment variables provided by the NAIS platform @@ -99,8 +99,8 @@ func Initialize() *Config { flag.StringSlice(GoogleAllowedDomains, []string{}, "Allowed Google Domains") flag.StringSlice(GoogleClusterProjects, []string{}, "Mapping cluster to google project: cluster1=project1,cluster2=project2") - flag.String(TeamsAPIKey, "", "Teams API Key") - flag.String(TeamsURL, "http://localhost:3000/query", "Teams URL") + flag.Bool(NaisAPIInsecureConnection, false, "Insecure connection to API server") + flag.String(NaisAPIAddress, "localhost:3001", "NAIS API target") return &Config{} } diff --git a/pkg/naisapi/naisapi.go b/pkg/naisapi/naisapi.go new file mode 100644 index 00000000..ac670d5c --- /dev/null +++ b/pkg/naisapi/naisapi.go @@ -0,0 +1,45 @@ +package naisapi + +import ( + "context" + "fmt" + + "github.com/nais/deploy/pkg/naisapi/protoapi" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +type Client struct { + client protoapi.TeamsClient +} + +func NewClient(target string, insecureConnection bool) (*Client, error) { + opts := []grpc.DialOption{} + if insecureConnection { + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } + + gclient, err := grpc.Dial(target, opts...) + if err != nil { + return nil, fmt.Errorf("failed to connect to nais-api: %w", err) + } + + return &Client{ + client: protoapi.NewTeamsClient(gclient), + }, nil +} + +func (c *Client) IsAuthorized(ctx context.Context, repo, team string) bool { + resp, err := c.client.IsRepositoryAuthorized(ctx, &protoapi.IsRepositoryAuthorizedRequest{ + TeamSlug: team, + Repository: repo, + Authorization: protoapi.RepositoryAuthorization_DEPLOY, + }) + if err != nil { + log.WithError(err).Error("checking repo authorization in teams") + return false + } + + return resp.IsAuthorized +} diff --git a/pkg/naisapi/protoapi/pagination.pb.go b/pkg/naisapi/protoapi/pagination.pb.go new file mode 100644 index 00000000..3a1f4c6d --- /dev/null +++ b/pkg/naisapi/protoapi/pagination.pb.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.2 +// source: pagination.proto + +package protoapi + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TotalCount int64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + HasNextPage bool `protobuf:"varint,2,opt,name=has_next_page,json=hasNextPage,proto3" json:"has_next_page,omitempty"` + HasPreviousPage bool `protobuf:"varint,3,opt,name=has_previous_page,json=hasPreviousPage,proto3" json:"has_previous_page,omitempty"` +} + +func (x *PageInfo) Reset() { + *x = PageInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_pagination_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageInfo) ProtoMessage() {} + +func (x *PageInfo) ProtoReflect() protoreflect.Message { + mi := &file_pagination_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PageInfo.ProtoReflect.Descriptor instead. +func (*PageInfo) Descriptor() ([]byte, []int) { + return file_pagination_proto_rawDescGZIP(), []int{0} +} + +func (x *PageInfo) GetTotalCount() int64 { + if x != nil { + return x.TotalCount + } + return 0 +} + +func (x *PageInfo) GetHasNextPage() bool { + if x != nil { + return x.HasNextPage + } + return false +} + +func (x *PageInfo) GetHasPreviousPage() bool { + if x != nil { + return x.HasPreviousPage + } + return false +} + +var File_pagination_proto protoreflect.FileDescriptor + +var file_pagination_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x7b, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x22, 0x0a, 0x0d, 0x68, 0x61, 0x73, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x50, + 0x61, 0x67, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, + 0x68, 0x61, 0x73, 0x50, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x50, 0x61, 0x67, 0x65, 0x42, + 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, + 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pagination_proto_rawDescOnce sync.Once + file_pagination_proto_rawDescData = file_pagination_proto_rawDesc +) + +func file_pagination_proto_rawDescGZIP() []byte { + file_pagination_proto_rawDescOnce.Do(func() { + file_pagination_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagination_proto_rawDescData) + }) + return file_pagination_proto_rawDescData +} + +var file_pagination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pagination_proto_goTypes = []interface{}{ + (*PageInfo)(nil), // 0: PageInfo +} +var file_pagination_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_pagination_proto_init() } +func file_pagination_proto_init() { + if File_pagination_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pagination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PageInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pagination_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pagination_proto_goTypes, + DependencyIndexes: file_pagination_proto_depIdxs, + MessageInfos: file_pagination_proto_msgTypes, + }.Build() + File_pagination_proto = out.File + file_pagination_proto_rawDesc = nil + file_pagination_proto_goTypes = nil + file_pagination_proto_depIdxs = nil +} diff --git a/pkg/naisapi/protoapi/teams.pb.go b/pkg/naisapi/protoapi/teams.pb.go new file mode 100644 index 00000000..659c394e --- /dev/null +++ b/pkg/naisapi/protoapi/teams.pb.go @@ -0,0 +1,1808 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.2 +// source: teams.proto + +package protoapi + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RepositoryAuthorization int32 + +const ( + RepositoryAuthorization_UNKNOWN RepositoryAuthorization = 0 + RepositoryAuthorization_DEPLOY RepositoryAuthorization = 1 +) + +// Enum value maps for RepositoryAuthorization. +var ( + RepositoryAuthorization_name = map[int32]string{ + 0: "UNKNOWN", + 1: "DEPLOY", + } + RepositoryAuthorization_value = map[string]int32{ + "UNKNOWN": 0, + "DEPLOY": 1, + } +) + +func (x RepositoryAuthorization) Enum() *RepositoryAuthorization { + p := new(RepositoryAuthorization) + *p = x + return p +} + +func (x RepositoryAuthorization) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RepositoryAuthorization) Descriptor() protoreflect.EnumDescriptor { + return file_teams_proto_enumTypes[0].Descriptor() +} + +func (RepositoryAuthorization) Type() protoreflect.EnumType { + return &file_teams_proto_enumTypes[0] +} + +func (x RepositoryAuthorization) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RepositoryAuthorization.Descriptor instead. +func (RepositoryAuthorization) EnumDescriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{0} +} + +type Team struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` + Purpose string `protobuf:"bytes,2,opt,name=purpose,proto3" json:"purpose,omitempty"` + SlackChannel string `protobuf:"bytes,3,opt,name=slack_channel,json=slackChannel,proto3" json:"slack_channel,omitempty"` + AzureGroupId *string `protobuf:"bytes,4,opt,name=azure_group_id,json=azureGroupId,proto3,oneof" json:"azure_group_id,omitempty"` + GithubTeamSlug *string `protobuf:"bytes,5,opt,name=github_team_slug,json=githubTeamSlug,proto3,oneof" json:"github_team_slug,omitempty"` + GoogleGroupEmail *string `protobuf:"bytes,6,opt,name=google_group_email,json=googleGroupEmail,proto3,oneof" json:"google_group_email,omitempty"` + GarRepository *string `protobuf:"bytes,7,opt,name=gar_repository,json=garRepository,proto3,oneof" json:"gar_repository,omitempty"` +} + +func (x *Team) Reset() { + *x = Team{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Team) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Team) ProtoMessage() {} + +func (x *Team) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Team.ProtoReflect.Descriptor instead. +func (*Team) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{0} +} + +func (x *Team) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *Team) GetPurpose() string { + if x != nil { + return x.Purpose + } + return "" +} + +func (x *Team) GetSlackChannel() string { + if x != nil { + return x.SlackChannel + } + return "" +} + +func (x *Team) GetAzureGroupId() string { + if x != nil && x.AzureGroupId != nil { + return *x.AzureGroupId + } + return "" +} + +func (x *Team) GetGithubTeamSlug() string { + if x != nil && x.GithubTeamSlug != nil { + return *x.GithubTeamSlug + } + return "" +} + +func (x *Team) GetGoogleGroupEmail() string { + if x != nil && x.GoogleGroupEmail != nil { + return *x.GoogleGroupEmail + } + return "" +} + +func (x *Team) GetGarRepository() string { + if x != nil && x.GarRepository != nil { + return *x.GarRepository + } + return "" +} + +type ListAuthorizedRepositoriesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TeamSlug string `protobuf:"bytes,1,opt,name=teamSlug,proto3" json:"teamSlug,omitempty"` +} + +func (x *ListAuthorizedRepositoriesRequest) Reset() { + *x = ListAuthorizedRepositoriesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAuthorizedRepositoriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAuthorizedRepositoriesRequest) ProtoMessage() {} + +func (x *ListAuthorizedRepositoriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAuthorizedRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*ListAuthorizedRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{1} +} + +func (x *ListAuthorizedRepositoriesRequest) GetTeamSlug() string { + if x != nil { + return x.TeamSlug + } + return "" +} + +type ListAuthorizedRepositoriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GithubRepositories []string `protobuf:"bytes,1,rep,name=github_repositories,json=githubRepositories,proto3" json:"github_repositories,omitempty"` +} + +func (x *ListAuthorizedRepositoriesResponse) Reset() { + *x = ListAuthorizedRepositoriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAuthorizedRepositoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAuthorizedRepositoriesResponse) ProtoMessage() {} + +func (x *ListAuthorizedRepositoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAuthorizedRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*ListAuthorizedRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{2} +} + +func (x *ListAuthorizedRepositoriesResponse) GetGithubRepositories() []string { + if x != nil { + return x.GithubRepositories + } + return nil +} + +type DeleteTeamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` +} + +func (x *DeleteTeamRequest) Reset() { + *x = DeleteTeamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTeamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTeamRequest) ProtoMessage() {} + +func (x *DeleteTeamRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTeamRequest.ProtoReflect.Descriptor instead. +func (*DeleteTeamRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteTeamRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +type DeleteTeamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteTeamResponse) Reset() { + *x = DeleteTeamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteTeamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteTeamResponse) ProtoMessage() {} + +func (x *DeleteTeamResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteTeamResponse.ProtoReflect.Descriptor instead. +func (*DeleteTeamResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{4} +} + +type SetTeamExternalReferencesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` + AzureGroupId *string `protobuf:"bytes,2,opt,name=azure_group_id,json=azureGroupId,proto3,oneof" json:"azure_group_id,omitempty"` + GithubTeamSlug *string `protobuf:"bytes,3,opt,name=github_team_slug,json=githubTeamSlug,proto3,oneof" json:"github_team_slug,omitempty"` + GoogleGroupEmail *string `protobuf:"bytes,4,opt,name=google_group_email,json=googleGroupEmail,proto3,oneof" json:"google_group_email,omitempty"` + GarRepository *string `protobuf:"bytes,5,opt,name=gar_repository,json=garRepository,proto3,oneof" json:"gar_repository,omitempty"` +} + +func (x *SetTeamExternalReferencesRequest) Reset() { + *x = SetTeamExternalReferencesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTeamExternalReferencesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTeamExternalReferencesRequest) ProtoMessage() {} + +func (x *SetTeamExternalReferencesRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetTeamExternalReferencesRequest.ProtoReflect.Descriptor instead. +func (*SetTeamExternalReferencesRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{5} +} + +func (x *SetTeamExternalReferencesRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *SetTeamExternalReferencesRequest) GetAzureGroupId() string { + if x != nil && x.AzureGroupId != nil { + return *x.AzureGroupId + } + return "" +} + +func (x *SetTeamExternalReferencesRequest) GetGithubTeamSlug() string { + if x != nil && x.GithubTeamSlug != nil { + return *x.GithubTeamSlug + } + return "" +} + +func (x *SetTeamExternalReferencesRequest) GetGoogleGroupEmail() string { + if x != nil && x.GoogleGroupEmail != nil { + return *x.GoogleGroupEmail + } + return "" +} + +func (x *SetTeamExternalReferencesRequest) GetGarRepository() string { + if x != nil && x.GarRepository != nil { + return *x.GarRepository + } + return "" +} + +type SetTeamExternalReferencesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetTeamExternalReferencesResponse) Reset() { + *x = SetTeamExternalReferencesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTeamExternalReferencesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTeamExternalReferencesResponse) ProtoMessage() {} + +func (x *SetTeamExternalReferencesResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetTeamExternalReferencesResponse.ProtoReflect.Descriptor instead. +func (*SetTeamExternalReferencesResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{6} +} + +type SetTeamEnvironmentExternalReferencesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` + EnvironmentName string `protobuf:"bytes,2,opt,name=environment_name,json=environmentName,proto3" json:"environment_name,omitempty"` + // GCP project ID. If not set, no changes will be made. Set to empty string to remove the project ID. + GcpProjectId *string `protobuf:"bytes,3,opt,name=gcp_project_id,json=gcpProjectId,proto3,oneof" json:"gcp_project_id,omitempty"` +} + +func (x *SetTeamEnvironmentExternalReferencesRequest) Reset() { + *x = SetTeamEnvironmentExternalReferencesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTeamEnvironmentExternalReferencesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTeamEnvironmentExternalReferencesRequest) ProtoMessage() {} + +func (x *SetTeamEnvironmentExternalReferencesRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetTeamEnvironmentExternalReferencesRequest.ProtoReflect.Descriptor instead. +func (*SetTeamEnvironmentExternalReferencesRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{7} +} + +func (x *SetTeamEnvironmentExternalReferencesRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *SetTeamEnvironmentExternalReferencesRequest) GetEnvironmentName() string { + if x != nil { + return x.EnvironmentName + } + return "" +} + +func (x *SetTeamEnvironmentExternalReferencesRequest) GetGcpProjectId() string { + if x != nil && x.GcpProjectId != nil { + return *x.GcpProjectId + } + return "" +} + +type SetTeamEnvironmentExternalReferencesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetTeamEnvironmentExternalReferencesResponse) Reset() { + *x = SetTeamEnvironmentExternalReferencesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetTeamEnvironmentExternalReferencesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetTeamEnvironmentExternalReferencesResponse) ProtoMessage() {} + +func (x *SetTeamEnvironmentExternalReferencesResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetTeamEnvironmentExternalReferencesResponse.ProtoReflect.Descriptor instead. +func (*SetTeamEnvironmentExternalReferencesResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{8} +} + +type ListTeamEnvironmentsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"` +} + +func (x *ListTeamEnvironmentsRequest) Reset() { + *x = ListTeamEnvironmentsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamEnvironmentsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamEnvironmentsRequest) ProtoMessage() {} + +func (x *ListTeamEnvironmentsRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamEnvironmentsRequest.ProtoReflect.Descriptor instead. +func (*ListTeamEnvironmentsRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{9} +} + +func (x *ListTeamEnvironmentsRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListTeamEnvironmentsRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListTeamEnvironmentsRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +type ListTeamEnvironmentsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*TeamEnvironment `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"` +} + +func (x *ListTeamEnvironmentsResponse) Reset() { + *x = ListTeamEnvironmentsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamEnvironmentsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamEnvironmentsResponse) ProtoMessage() {} + +func (x *ListTeamEnvironmentsResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamEnvironmentsResponse.ProtoReflect.Descriptor instead. +func (*ListTeamEnvironmentsResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{10} +} + +func (x *ListTeamEnvironmentsResponse) GetNodes() []*TeamEnvironment { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *ListTeamEnvironmentsResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.PageInfo + } + return nil +} + +type TeamEnvironment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Slug string `protobuf:"bytes,2,opt,name=slug,proto3" json:"slug,omitempty"` + Gcp bool `protobuf:"varint,3,opt,name=gcp,proto3" json:"gcp,omitempty"` + EnvironmentName string `protobuf:"bytes,4,opt,name=environment_name,json=environmentName,proto3" json:"environment_name,omitempty"` + GcpProjectId *string `protobuf:"bytes,5,opt,name=gcp_project_id,json=gcpProjectId,proto3,oneof" json:"gcp_project_id,omitempty"` + SlackAlertsChannel string `protobuf:"bytes,6,opt,name=slack_alerts_channel,json=slackAlertsChannel,proto3" json:"slack_alerts_channel,omitempty"` +} + +func (x *TeamEnvironment) Reset() { + *x = TeamEnvironment{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TeamEnvironment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TeamEnvironment) ProtoMessage() {} + +func (x *TeamEnvironment) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TeamEnvironment.ProtoReflect.Descriptor instead. +func (*TeamEnvironment) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{11} +} + +func (x *TeamEnvironment) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *TeamEnvironment) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +func (x *TeamEnvironment) GetGcp() bool { + if x != nil { + return x.Gcp + } + return false +} + +func (x *TeamEnvironment) GetEnvironmentName() string { + if x != nil { + return x.EnvironmentName + } + return "" +} + +func (x *TeamEnvironment) GetGcpProjectId() string { + if x != nil && x.GcpProjectId != nil { + return *x.GcpProjectId + } + return "" +} + +func (x *TeamEnvironment) GetSlackAlertsChannel() string { + if x != nil { + return x.SlackAlertsChannel + } + return "" +} + +type GetTeamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Team *Team `protobuf:"bytes,1,opt,name=team,proto3" json:"team,omitempty"` +} + +func (x *GetTeamResponse) Reset() { + *x = GetTeamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTeamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTeamResponse) ProtoMessage() {} + +func (x *GetTeamResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTeamResponse.ProtoReflect.Descriptor instead. +func (*GetTeamResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{12} +} + +func (x *GetTeamResponse) GetTeam() *Team { + if x != nil { + return x.Team + } + return nil +} + +type GetTeamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` +} + +func (x *GetTeamRequest) Reset() { + *x = GetTeamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTeamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTeamRequest) ProtoMessage() {} + +func (x *GetTeamRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetTeamRequest.ProtoReflect.Descriptor instead. +func (*GetTeamRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{13} +} + +func (x *GetTeamRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +type ListTeamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *ListTeamsRequest) Reset() { + *x = ListTeamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamsRequest) ProtoMessage() {} + +func (x *ListTeamsRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamsRequest.ProtoReflect.Descriptor instead. +func (*ListTeamsRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{14} +} + +func (x *ListTeamsRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListTeamsRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +type ListTeamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*Team `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"` +} + +func (x *ListTeamsResponse) Reset() { + *x = ListTeamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamsResponse) ProtoMessage() {} + +func (x *ListTeamsResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamsResponse.ProtoReflect.Descriptor instead. +func (*ListTeamsResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{15} +} + +func (x *ListTeamsResponse) GetNodes() []*Team { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *ListTeamsResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.PageInfo + } + return nil +} + +type ListTeamMembersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Slug string `protobuf:"bytes,3,opt,name=slug,proto3" json:"slug,omitempty"` +} + +func (x *ListTeamMembersRequest) Reset() { + *x = ListTeamMembersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamMembersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamMembersRequest) ProtoMessage() {} + +func (x *ListTeamMembersRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamMembersRequest.ProtoReflect.Descriptor instead. +func (*ListTeamMembersRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{16} +} + +func (x *ListTeamMembersRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListTeamMembersRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListTeamMembersRequest) GetSlug() string { + if x != nil { + return x.Slug + } + return "" +} + +type ListTeamMembersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*TeamMember `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"` +} + +func (x *ListTeamMembersResponse) Reset() { + *x = ListTeamMembersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListTeamMembersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListTeamMembersResponse) ProtoMessage() {} + +func (x *ListTeamMembersResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListTeamMembersResponse.ProtoReflect.Descriptor instead. +func (*ListTeamMembersResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{17} +} + +func (x *ListTeamMembersResponse) GetNodes() []*TeamMember { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *ListTeamMembersResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.PageInfo + } + return nil +} + +type TeamMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *TeamMember) Reset() { + *x = TeamMember{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TeamMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TeamMember) ProtoMessage() {} + +func (x *TeamMember) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TeamMember.ProtoReflect.Descriptor instead. +func (*TeamMember) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{18} +} + +func (x *TeamMember) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type IsRepositoryAuthorizedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TeamSlug string `protobuf:"bytes,1,opt,name=team_slug,json=teamSlug,proto3" json:"team_slug,omitempty"` + Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` + Authorization RepositoryAuthorization `protobuf:"varint,3,opt,name=authorization,proto3,enum=RepositoryAuthorization" json:"authorization,omitempty"` +} + +func (x *IsRepositoryAuthorizedRequest) Reset() { + *x = IsRepositoryAuthorizedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRepositoryAuthorizedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRepositoryAuthorizedRequest) ProtoMessage() {} + +func (x *IsRepositoryAuthorizedRequest) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRepositoryAuthorizedRequest.ProtoReflect.Descriptor instead. +func (*IsRepositoryAuthorizedRequest) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{19} +} + +func (x *IsRepositoryAuthorizedRequest) GetTeamSlug() string { + if x != nil { + return x.TeamSlug + } + return "" +} + +func (x *IsRepositoryAuthorizedRequest) GetRepository() string { + if x != nil { + return x.Repository + } + return "" +} + +func (x *IsRepositoryAuthorizedRequest) GetAuthorization() RepositoryAuthorization { + if x != nil { + return x.Authorization + } + return RepositoryAuthorization_UNKNOWN +} + +type IsRepositoryAuthorizedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsAuthorized bool `protobuf:"varint,1,opt,name=is_authorized,json=isAuthorized,proto3" json:"is_authorized,omitempty"` +} + +func (x *IsRepositoryAuthorizedResponse) Reset() { + *x = IsRepositoryAuthorizedResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_teams_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IsRepositoryAuthorizedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsRepositoryAuthorizedResponse) ProtoMessage() {} + +func (x *IsRepositoryAuthorizedResponse) ProtoReflect() protoreflect.Message { + mi := &file_teams_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsRepositoryAuthorizedResponse.ProtoReflect.Descriptor instead. +func (*IsRepositoryAuthorizedResponse) Descriptor() ([]byte, []int) { + return file_teams_proto_rawDescGZIP(), []int{20} +} + +func (x *IsRepositoryAuthorizedResponse) GetIsAuthorized() bool { + if x != nil { + return x.IsAuthorized + } + return false +} + +var File_teams_proto protoreflect.FileDescriptor + +var file_teams_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe4, 0x02, 0x0a, + 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x75, 0x72, + 0x70, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x75, 0x72, 0x70, + 0x6f, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6c, 0x61, 0x63, + 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x29, 0x0a, 0x0e, 0x61, 0x7a, 0x75, 0x72, + 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0c, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x10, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x74, 0x65, + 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, + 0x0e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x88, + 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, + 0x52, 0x10, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x67, 0x61, 0x72, 0x5f, 0x72, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, + 0x0d, 0x67, 0x61, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x88, 0x01, + 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x69, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, + 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x67, 0x61, 0x72, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0x22, 0x3f, 0x0a, 0x21, 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, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x61, 0x6d, + 0x53, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, 0x6d, + 0x53, 0x6c, 0x75, 0x67, 0x22, 0x55, 0x0a, 0x22, 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, 0x12, 0x2f, 0x0a, 0x13, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x27, 0x0a, 0x11, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x73, 0x6c, 0x75, 0x67, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc1, 0x02, 0x0a, 0x20, 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, 0x12, + 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, + 0x6c, 0x75, 0x67, 0x12, 0x29, 0x0a, 0x0e, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x61, + 0x7a, 0x75, 0x72, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2d, + 0x0a, 0x10, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x6c, + 0x75, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, + 0x12, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x10, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, + 0x12, 0x2a, 0x0a, 0x0e, 0x67, 0x61, 0x72, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x0d, 0x67, 0x61, 0x72, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, + 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x42, + 0x13, 0x0a, 0x11, 0x5f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, + 0x73, 0x6c, 0x75, 0x67, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x11, 0x0a, 0x0f, 0x5f, + 0x67, 0x61, 0x72, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x23, + 0x0a, 0x21, 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, 0xaa, 0x01, 0x0a, 0x2b, 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, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x6e, 0x76, 0x69, 0x72, + 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0e, 0x67, 0x63, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x63, + 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, + 0x0f, 0x5f, 0x67, 0x63, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, + 0x22, 0x2e, 0x0a, 0x2c, 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, 0x5f, 0x0a, 0x1b, 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, 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, 0x6e, 0x0a, 0x1c, 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, 0x12, 0x26, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x50, + 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x22, 0xe2, 0x01, 0x0a, 0x0f, 0x54, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, + 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x63, 0x70, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x67, 0x63, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x65, + 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0e, 0x67, 0x63, 0x70, 0x5f, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0c, 0x67, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x88, 0x01, + 0x01, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x61, 0x6c, 0x65, 0x72, 0x74, + 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x73, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6c, 0x65, 0x72, 0x74, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x67, 0x63, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x74, 0x65, 0x61, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x04, + 0x74, 0x65, 0x61, 0x6d, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x22, 0x40, 0x0a, 0x10, 0x4c, 0x69, + 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 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, 0x22, 0x58, 0x0a, 0x11, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1b, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x05, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x26, + 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x09, 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, 0x64, 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, 0x21, 0x0a, + 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x54, + 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, + 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x27, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x22, 0x9c, 0x01, 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, + 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 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, 0x2a, 0x32, 0x0a, 0x17, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x10, 0x01, 0x32, 0xdc, 0x05, 0x0a, 0x05, + 0x54, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x67, 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, 0x22, 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, 0x23, 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, 0x2a, + 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x04, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x11, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x07, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x17, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, + 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 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, 0x4d, 0x0a, 0x0c, 0x45, + 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 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, 0x1d, 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, 0x64, 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, 0x21, 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, 0x22, 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, 0x85, 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, 0x2c, 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, 0x2d, 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, 0x33, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x12, 0x12, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 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, 0x1e, 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, 0x1f, 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, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_teams_proto_rawDescOnce sync.Once + file_teams_proto_rawDescData = file_teams_proto_rawDesc +) + +func file_teams_proto_rawDescGZIP() []byte { + file_teams_proto_rawDescOnce.Do(func() { + file_teams_proto_rawDescData = protoimpl.X.CompressGZIP(file_teams_proto_rawDescData) + }) + return file_teams_proto_rawDescData +} + +var file_teams_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_teams_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_teams_proto_goTypes = []interface{}{ + (RepositoryAuthorization)(0), // 0: RepositoryAuthorization + (*Team)(nil), // 1: Team + (*ListAuthorizedRepositoriesRequest)(nil), // 2: ListAuthorizedRepositoriesRequest + (*ListAuthorizedRepositoriesResponse)(nil), // 3: ListAuthorizedRepositoriesResponse + (*DeleteTeamRequest)(nil), // 4: DeleteTeamRequest + (*DeleteTeamResponse)(nil), // 5: DeleteTeamResponse + (*SetTeamExternalReferencesRequest)(nil), // 6: SetTeamExternalReferencesRequest + (*SetTeamExternalReferencesResponse)(nil), // 7: SetTeamExternalReferencesResponse + (*SetTeamEnvironmentExternalReferencesRequest)(nil), // 8: SetTeamEnvironmentExternalReferencesRequest + (*SetTeamEnvironmentExternalReferencesResponse)(nil), // 9: SetTeamEnvironmentExternalReferencesResponse + (*ListTeamEnvironmentsRequest)(nil), // 10: ListTeamEnvironmentsRequest + (*ListTeamEnvironmentsResponse)(nil), // 11: ListTeamEnvironmentsResponse + (*TeamEnvironment)(nil), // 12: TeamEnvironment + (*GetTeamResponse)(nil), // 13: GetTeamResponse + (*GetTeamRequest)(nil), // 14: GetTeamRequest + (*ListTeamsRequest)(nil), // 15: ListTeamsRequest + (*ListTeamsResponse)(nil), // 16: ListTeamsResponse + (*ListTeamMembersRequest)(nil), // 17: ListTeamMembersRequest + (*ListTeamMembersResponse)(nil), // 18: ListTeamMembersResponse + (*TeamMember)(nil), // 19: TeamMember + (*IsRepositoryAuthorizedRequest)(nil), // 20: IsRepositoryAuthorizedRequest + (*IsRepositoryAuthorizedResponse)(nil), // 21: IsRepositoryAuthorizedResponse + (*PageInfo)(nil), // 22: PageInfo + (*User)(nil), // 23: User +} +var file_teams_proto_depIdxs = []int32{ + 12, // 0: ListTeamEnvironmentsResponse.nodes:type_name -> TeamEnvironment + 22, // 1: ListTeamEnvironmentsResponse.page_info:type_name -> PageInfo + 1, // 2: GetTeamResponse.team:type_name -> Team + 1, // 3: ListTeamsResponse.nodes:type_name -> Team + 22, // 4: ListTeamsResponse.page_info:type_name -> PageInfo + 19, // 5: ListTeamMembersResponse.nodes:type_name -> TeamMember + 22, // 6: ListTeamMembersResponse.page_info:type_name -> PageInfo + 23, // 7: TeamMember.user:type_name -> User + 0, // 8: IsRepositoryAuthorizedRequest.authorization:type_name -> RepositoryAuthorization + 2, // 9: Teams.ListAuthorizedRepositories:input_type -> ListAuthorizedRepositoriesRequest + 14, // 10: Teams.Get:input_type -> GetTeamRequest + 15, // 11: Teams.List:input_type -> ListTeamsRequest + 17, // 12: Teams.Members:input_type -> ListTeamMembersRequest + 10, // 13: Teams.Environments:input_type -> ListTeamEnvironmentsRequest + 6, // 14: Teams.SetTeamExternalReferences:input_type -> SetTeamExternalReferencesRequest + 8, // 15: Teams.SetTeamEnvironmentExternalReferences:input_type -> SetTeamEnvironmentExternalReferencesRequest + 4, // 16: Teams.Delete:input_type -> DeleteTeamRequest + 20, // 17: Teams.IsRepositoryAuthorized:input_type -> IsRepositoryAuthorizedRequest + 3, // 18: Teams.ListAuthorizedRepositories:output_type -> ListAuthorizedRepositoriesResponse + 13, // 19: Teams.Get:output_type -> GetTeamResponse + 16, // 20: Teams.List:output_type -> ListTeamsResponse + 18, // 21: Teams.Members:output_type -> ListTeamMembersResponse + 11, // 22: Teams.Environments:output_type -> ListTeamEnvironmentsResponse + 7, // 23: Teams.SetTeamExternalReferences:output_type -> SetTeamExternalReferencesResponse + 9, // 24: Teams.SetTeamEnvironmentExternalReferences:output_type -> SetTeamEnvironmentExternalReferencesResponse + 5, // 25: Teams.Delete:output_type -> DeleteTeamResponse + 21, // 26: Teams.IsRepositoryAuthorized:output_type -> IsRepositoryAuthorizedResponse + 18, // [18:27] is the sub-list for method output_type + 9, // [9:18] 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 +} + +func init() { file_teams_proto_init() } +func file_teams_proto_init() { + if File_teams_proto != nil { + return + } + file_pagination_proto_init() + file_users_proto_init() + if !protoimpl.UnsafeEnabled { + file_teams_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Team); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAuthorizedRepositoriesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAuthorizedRepositoriesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTeamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteTeamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTeamExternalReferencesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTeamExternalReferencesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTeamEnvironmentExternalReferencesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetTeamEnvironmentExternalReferencesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamEnvironmentsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamEnvironmentsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TeamEnvironment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTeamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTeamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamMembersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListTeamMembersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TeamMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRepositoryAuthorizedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_teams_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsRepositoryAuthorizedResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_teams_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_teams_proto_msgTypes[5].OneofWrappers = []interface{}{} + file_teams_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_teams_proto_msgTypes[11].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_teams_proto_rawDesc, + NumEnums: 1, + NumMessages: 21, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_teams_proto_goTypes, + DependencyIndexes: file_teams_proto_depIdxs, + EnumInfos: file_teams_proto_enumTypes, + MessageInfos: file_teams_proto_msgTypes, + }.Build() + File_teams_proto = out.File + file_teams_proto_rawDesc = nil + file_teams_proto_goTypes = nil + file_teams_proto_depIdxs = nil +} diff --git a/pkg/naisapi/protoapi/teams_grpc.pb.go b/pkg/naisapi/protoapi/teams_grpc.pb.go new file mode 100644 index 00000000..61026dd0 --- /dev/null +++ b/pkg/naisapi/protoapi/teams_grpc.pb.go @@ -0,0 +1,405 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: teams.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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Teams_ListAuthorizedRepositories_FullMethodName = "/Teams/ListAuthorizedRepositories" + Teams_Get_FullMethodName = "/Teams/Get" + Teams_List_FullMethodName = "/Teams/List" + Teams_Members_FullMethodName = "/Teams/Members" + Teams_Environments_FullMethodName = "/Teams/Environments" + Teams_SetTeamExternalReferences_FullMethodName = "/Teams/SetTeamExternalReferences" + Teams_SetTeamEnvironmentExternalReferences_FullMethodName = "/Teams/SetTeamEnvironmentExternalReferences" + Teams_Delete_FullMethodName = "/Teams/Delete" + Teams_IsRepositoryAuthorized_FullMethodName = "/Teams/IsRepositoryAuthorized" +) + +// TeamsClient is the client API for Teams 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 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) + 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) + SetTeamEnvironmentExternalReferences(ctx context.Context, in *SetTeamEnvironmentExternalReferencesRequest, opts ...grpc.CallOption) (*SetTeamEnvironmentExternalReferencesResponse, error) + Delete(ctx context.Context, in *DeleteTeamRequest, opts ...grpc.CallOption) (*DeleteTeamResponse, error) + IsRepositoryAuthorized(ctx context.Context, in *IsRepositoryAuthorizedRequest, opts ...grpc.CallOption) (*IsRepositoryAuthorizedResponse, error) +} + +type teamsClient struct { + cc grpc.ClientConnInterface +} + +func NewTeamsClient(cc grpc.ClientConnInterface) TeamsClient { + return &teamsClient{cc} +} + +func (c *teamsClient) ListAuthorizedRepositories(ctx context.Context, in *ListAuthorizedRepositoriesRequest, opts ...grpc.CallOption) (*ListAuthorizedRepositoriesResponse, error) { + out := new(ListAuthorizedRepositoriesResponse) + err := c.cc.Invoke(ctx, Teams_ListAuthorizedRepositories_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) Get(ctx context.Context, in *GetTeamRequest, opts ...grpc.CallOption) (*GetTeamResponse, error) { + out := new(GetTeamResponse) + err := c.cc.Invoke(ctx, Teams_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) List(ctx context.Context, in *ListTeamsRequest, opts ...grpc.CallOption) (*ListTeamsResponse, error) { + out := new(ListTeamsResponse) + err := c.cc.Invoke(ctx, Teams_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) Members(ctx context.Context, in *ListTeamMembersRequest, opts ...grpc.CallOption) (*ListTeamMembersResponse, error) { + out := new(ListTeamMembersResponse) + err := c.cc.Invoke(ctx, Teams_Members_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) Environments(ctx context.Context, in *ListTeamEnvironmentsRequest, opts ...grpc.CallOption) (*ListTeamEnvironmentsResponse, error) { + out := new(ListTeamEnvironmentsResponse) + err := c.cc.Invoke(ctx, Teams_Environments_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) SetTeamExternalReferences(ctx context.Context, in *SetTeamExternalReferencesRequest, opts ...grpc.CallOption) (*SetTeamExternalReferencesResponse, error) { + out := new(SetTeamExternalReferencesResponse) + err := c.cc.Invoke(ctx, Teams_SetTeamExternalReferences_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) SetTeamEnvironmentExternalReferences(ctx context.Context, in *SetTeamEnvironmentExternalReferencesRequest, opts ...grpc.CallOption) (*SetTeamEnvironmentExternalReferencesResponse, error) { + out := new(SetTeamEnvironmentExternalReferencesResponse) + err := c.cc.Invoke(ctx, Teams_SetTeamEnvironmentExternalReferences_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) Delete(ctx context.Context, in *DeleteTeamRequest, opts ...grpc.CallOption) (*DeleteTeamResponse, error) { + out := new(DeleteTeamResponse) + err := c.cc.Invoke(ctx, Teams_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *teamsClient) IsRepositoryAuthorized(ctx context.Context, in *IsRepositoryAuthorizedRequest, opts ...grpc.CallOption) (*IsRepositoryAuthorizedResponse, error) { + out := new(IsRepositoryAuthorizedResponse) + err := c.cc.Invoke(ctx, Teams_IsRepositoryAuthorized_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TeamsServer is the server API for Teams service. +// All implementations must embed UnimplementedTeamsServer +// for forward compatibility +type TeamsServer interface { + ListAuthorizedRepositories(context.Context, *ListAuthorizedRepositoriesRequest) (*ListAuthorizedRepositoriesResponse, error) + Get(context.Context, *GetTeamRequest) (*GetTeamResponse, error) + List(context.Context, *ListTeamsRequest) (*ListTeamsResponse, error) + Members(context.Context, *ListTeamMembersRequest) (*ListTeamMembersResponse, error) + Environments(context.Context, *ListTeamEnvironmentsRequest) (*ListTeamEnvironmentsResponse, error) + SetTeamExternalReferences(context.Context, *SetTeamExternalReferencesRequest) (*SetTeamExternalReferencesResponse, error) + SetTeamEnvironmentExternalReferences(context.Context, *SetTeamEnvironmentExternalReferencesRequest) (*SetTeamEnvironmentExternalReferencesResponse, error) + Delete(context.Context, *DeleteTeamRequest) (*DeleteTeamResponse, error) + IsRepositoryAuthorized(context.Context, *IsRepositoryAuthorizedRequest) (*IsRepositoryAuthorizedResponse, error) + mustEmbedUnimplementedTeamsServer() +} + +// UnimplementedTeamsServer must be embedded to have forward compatible implementations. +type UnimplementedTeamsServer struct { +} + +func (UnimplementedTeamsServer) ListAuthorizedRepositories(context.Context, *ListAuthorizedRepositoriesRequest) (*ListAuthorizedRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAuthorizedRepositories not implemented") +} +func (UnimplementedTeamsServer) Get(context.Context, *GetTeamRequest) (*GetTeamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedTeamsServer) List(context.Context, *ListTeamsRequest) (*ListTeamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedTeamsServer) Members(context.Context, *ListTeamMembersRequest) (*ListTeamMembersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Members not implemented") +} +func (UnimplementedTeamsServer) Environments(context.Context, *ListTeamEnvironmentsRequest) (*ListTeamEnvironmentsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Environments not implemented") +} +func (UnimplementedTeamsServer) SetTeamExternalReferences(context.Context, *SetTeamExternalReferencesRequest) (*SetTeamExternalReferencesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTeamExternalReferences not implemented") +} +func (UnimplementedTeamsServer) SetTeamEnvironmentExternalReferences(context.Context, *SetTeamEnvironmentExternalReferencesRequest) (*SetTeamEnvironmentExternalReferencesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetTeamEnvironmentExternalReferences not implemented") +} +func (UnimplementedTeamsServer) Delete(context.Context, *DeleteTeamRequest) (*DeleteTeamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedTeamsServer) IsRepositoryAuthorized(context.Context, *IsRepositoryAuthorizedRequest) (*IsRepositoryAuthorizedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsRepositoryAuthorized not implemented") +} +func (UnimplementedTeamsServer) mustEmbedUnimplementedTeamsServer() {} + +// UnsafeTeamsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TeamsServer will +// result in compilation errors. +type UnsafeTeamsServer interface { + mustEmbedUnimplementedTeamsServer() +} + +func RegisterTeamsServer(s grpc.ServiceRegistrar, srv TeamsServer) { + s.RegisterService(&Teams_ServiceDesc, srv) +} + +func _Teams_ListAuthorizedRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAuthorizedRepositoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).ListAuthorizedRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_ListAuthorizedRepositories_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).ListAuthorizedRepositories(ctx, req.(*ListAuthorizedRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTeamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).Get(ctx, req.(*GetTeamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTeamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).List(ctx, req.(*ListTeamsRequest)) + } + 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 { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).Members(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_Members_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).Members(ctx, req.(*ListTeamMembersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_Environments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListTeamEnvironmentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).Environments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_Environments_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).Environments(ctx, req.(*ListTeamEnvironmentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_SetTeamExternalReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetTeamExternalReferencesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).SetTeamExternalReferences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_SetTeamExternalReferences_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).SetTeamExternalReferences(ctx, req.(*SetTeamExternalReferencesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_SetTeamEnvironmentExternalReferences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetTeamEnvironmentExternalReferencesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).SetTeamEnvironmentExternalReferences(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_SetTeamEnvironmentExternalReferences_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).SetTeamEnvironmentExternalReferences(ctx, req.(*SetTeamEnvironmentExternalReferencesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTeamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).Delete(ctx, req.(*DeleteTeamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Teams_IsRepositoryAuthorized_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsRepositoryAuthorizedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TeamsServer).IsRepositoryAuthorized(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Teams_IsRepositoryAuthorized_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TeamsServer).IsRepositoryAuthorized(ctx, req.(*IsRepositoryAuthorizedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Teams_ServiceDesc is the grpc.ServiceDesc for Teams service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Teams_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Teams", + HandlerType: (*TeamsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAuthorizedRepositories", + Handler: _Teams_ListAuthorizedRepositories_Handler, + }, + { + MethodName: "Get", + Handler: _Teams_Get_Handler, + }, + { + MethodName: "List", + Handler: _Teams_List_Handler, + }, + { + MethodName: "Members", + Handler: _Teams_Members_Handler, + }, + { + MethodName: "Environments", + Handler: _Teams_Environments_Handler, + }, + { + MethodName: "SetTeamExternalReferences", + Handler: _Teams_SetTeamExternalReferences_Handler, + }, + { + MethodName: "SetTeamEnvironmentExternalReferences", + Handler: _Teams_SetTeamEnvironmentExternalReferences_Handler, + }, + { + MethodName: "Delete", + Handler: _Teams_Delete_Handler, + }, + { + MethodName: "IsRepositoryAuthorized", + Handler: _Teams_IsRepositoryAuthorized_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "teams.proto", +} diff --git a/pkg/naisapi/protoapi/users.pb.go b/pkg/naisapi/protoapi/users.pb.go new file mode 100644 index 00000000..9b11b491 --- /dev/null +++ b/pkg/naisapi/protoapi/users.pb.go @@ -0,0 +1,476 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.2 +// source: users.proto + +package protoapi + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + ExternalId string `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_users_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_users_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_users_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *User) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +type GetUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *GetUserResponse) Reset() { + *x = GetUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_users_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserResponse) ProtoMessage() {} + +func (x *GetUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_users_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. +func (*GetUserResponse) Descriptor() ([]byte, []int) { + return file_users_proto_rawDescGZIP(), []int{1} +} + +func (x *GetUserResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +type GetUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + ExternalId string `protobuf:"bytes,3,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` +} + +func (x *GetUserRequest) Reset() { + *x = GetUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_users_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserRequest) ProtoMessage() {} + +func (x *GetUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_users_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. +func (*GetUserRequest) Descriptor() ([]byte, []int) { + return file_users_proto_rawDescGZIP(), []int{2} +} + +func (x *GetUserRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetUserRequest) GetExternalId() string { + if x != nil { + return x.ExternalId + } + return "" +} + +type ListUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` +} + +func (x *ListUsersRequest) Reset() { + *x = ListUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_users_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersRequest) ProtoMessage() {} + +func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_users_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead. +func (*ListUsersRequest) Descriptor() ([]byte, []int) { + return file_users_proto_rawDescGZIP(), []int{3} +} + +func (x *ListUsersRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *ListUsersRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +type ListUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*User `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"` +} + +func (x *ListUsersResponse) Reset() { + *x = ListUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_users_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUsersResponse) ProtoMessage() {} + +func (x *ListUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_users_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead. +func (*ListUsersResponse) Descriptor() ([]byte, []int) { + return file_users_proto_rawDescGZIP(), []int{4} +} + +func (x *ListUsersResponse) GetNodes() []*User { + if x != nil { + return x.Nodes + } + return nil +} + +func (x *ListUsersResponse) GetPageInfo() *PageInfo { + if x != nil { + return x.PageInfo + } + return nil +} + +var File_users_proto protoreflect.FileDescriptor + +var file_users_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x61, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x49, 0x64, 0x22, 0x2c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x22, 0x57, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x40, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 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, 0x22, 0x58, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1b, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x26, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x09, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x32, 0x64, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2a, + 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0f, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x04, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x11, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2e, + 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_users_proto_rawDescOnce sync.Once + file_users_proto_rawDescData = file_users_proto_rawDesc +) + +func file_users_proto_rawDescGZIP() []byte { + file_users_proto_rawDescOnce.Do(func() { + file_users_proto_rawDescData = protoimpl.X.CompressGZIP(file_users_proto_rawDescData) + }) + return file_users_proto_rawDescData +} + +var file_users_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_users_proto_goTypes = []interface{}{ + (*User)(nil), // 0: User + (*GetUserResponse)(nil), // 1: GetUserResponse + (*GetUserRequest)(nil), // 2: GetUserRequest + (*ListUsersRequest)(nil), // 3: ListUsersRequest + (*ListUsersResponse)(nil), // 4: ListUsersResponse + (*PageInfo)(nil), // 5: PageInfo +} +var file_users_proto_depIdxs = []int32{ + 0, // 0: GetUserResponse.user:type_name -> User + 0, // 1: ListUsersResponse.nodes:type_name -> User + 5, // 2: ListUsersResponse.page_info:type_name -> PageInfo + 2, // 3: Users.Get:input_type -> GetUserRequest + 3, // 4: Users.List:input_type -> ListUsersRequest + 1, // 5: Users.Get:output_type -> GetUserResponse + 4, // 6: Users.List:output_type -> ListUsersResponse + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] 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_users_proto_init() } +func file_users_proto_init() { + if File_users_proto != nil { + return + } + file_pagination_proto_init() + if !protoimpl.UnsafeEnabled { + file_users_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_users_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_users_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_users_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_users_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUsersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_users_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_users_proto_goTypes, + DependencyIndexes: file_users_proto_depIdxs, + MessageInfos: file_users_proto_msgTypes, + }.Build() + File_users_proto = out.File + file_users_proto_rawDesc = nil + file_users_proto_goTypes = nil + file_users_proto_depIdxs = nil +} diff --git a/pkg/naisapi/protoapi/users_grpc.pb.go b/pkg/naisapi/protoapi/users_grpc.pb.go new file mode 100644 index 00000000..e4a5ef04 --- /dev/null +++ b/pkg/naisapi/protoapi/users_grpc.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: users.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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Users_Get_FullMethodName = "/Users/Get" + Users_List_FullMethodName = "/Users/List" +) + +// UsersClient is the client API for Users 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 UsersClient interface { + Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) + List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) +} + +type usersClient struct { + cc grpc.ClientConnInterface +} + +func NewUsersClient(cc grpc.ClientConnInterface) UsersClient { + return &usersClient{cc} +} + +func (c *usersClient) Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { + out := new(GetUserResponse) + err := c.cc.Invoke(ctx, Users_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *usersClient) List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) { + out := new(ListUsersResponse) + err := c.cc.Invoke(ctx, Users_List_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UsersServer is the server API for Users service. +// All implementations must embed UnimplementedUsersServer +// for forward compatibility +type UsersServer interface { + Get(context.Context, *GetUserRequest) (*GetUserResponse, error) + List(context.Context, *ListUsersRequest) (*ListUsersResponse, error) + mustEmbedUnimplementedUsersServer() +} + +// UnimplementedUsersServer must be embedded to have forward compatible implementations. +type UnimplementedUsersServer struct { +} + +func (UnimplementedUsersServer) Get(context.Context, *GetUserRequest) (*GetUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedUsersServer) List(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method List not implemented") +} +func (UnimplementedUsersServer) mustEmbedUnimplementedUsersServer() {} + +// UnsafeUsersServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UsersServer will +// result in compilation errors. +type UnsafeUsersServer interface { + mustEmbedUnimplementedUsersServer() +} + +func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer) { + s.RegisterService(&Users_ServiceDesc, srv) +} + +func _Users_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Users_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersServer).Get(ctx, req.(*GetUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Users_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersServer).List(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Users_List_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersServer).List(ctx, req.(*ListUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Users_ServiceDesc is the grpc.ServiceDesc for Users service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Users_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Users", + HandlerType: (*UsersServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _Users_Get_Handler, + }, + { + MethodName: "List", + Handler: _Users_List_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "users.proto", +} From 4ed0afbdfe6fbdc9f73a7af24052ab84db18da72 Mon Sep 17 00:00:00 2001 From: Thomas Krampl Date: Wed, 21 Feb 2024 12:44:07 +0100 Subject: [PATCH 2/2] Remove unused teams package --- pkg/teams/httpclient.go | 17 -------- pkg/teams/teams.go | 96 ----------------------------------------- 2 files changed, 113 deletions(-) delete mode 100644 pkg/teams/httpclient.go delete mode 100644 pkg/teams/teams.go diff --git a/pkg/teams/httpclient.go b/pkg/teams/httpclient.go deleted file mode 100644 index 49e1c6d2..00000000 --- a/pkg/teams/httpclient.go +++ /dev/null @@ -1,17 +0,0 @@ -package teams - -import ( - "net/http" -) - -type httpClient struct { - client *http.Client - apiToken string -} - -func (c *httpClient) Do(req *http.Request) (*http.Response, error) { - req.Header.Set("Authorization", "Bearer "+c.apiToken) - req.Header.Set("Accept", "application/json") - req.Header.Set("Content-Type", "application/json") - return c.client.Do(req) -} diff --git a/pkg/teams/teams.go b/pkg/teams/teams.go deleted file mode 100644 index 5963a404..00000000 --- a/pkg/teams/teams.go +++ /dev/null @@ -1,96 +0,0 @@ -package teams - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "os" - - log "github.com/sirupsen/logrus" -) - -type teamsClient struct { - url string - httpClient *httpClient -} - -func New(url, apiToken string) *teamsClient { - return &teamsClient{ - url: url, - httpClient: &httpClient{ - client: http.DefaultClient, - apiToken: apiToken, - }, - } -} - -func (t *teamsClient) IsAuthorized(ctx context.Context, repo, team string) bool { - query := `query ($repoName: String! $teamSlug: Slug! $authorization: RepositoryAuthorization!) { - isRepositoryAuthorized(repoName: $repoName, teamSlug: $teamSlug, authorization: $authorization) - }` - - vars := map[string]string{ - "repoName": repo, - "teamSlug": team, - "authorization": "DEPLOY", - } - - respBody := struct { - Data struct { - IsRepositoryAuthorized bool `json:"isRepositoryAuthorized"` - } `json:"data"` - Errors []map[string]any `json:"errors"` - }{} - - if err := t.teamsQuery(ctx, query, vars, &respBody); err != nil { - log.WithError(err).Error("checking repo authorization in teams") - return false - } - - if len(respBody.Errors) > 0 { - log.Errorf("checking repo authorization in teams: %v", respBody.Errors) - return false - } - - return respBody.Data.IsRepositoryAuthorized -} - -func (t *teamsClient) teamsQuery(ctx context.Context, query string, vars map[string]string, respBody interface{}) error { - q := struct { - Query string `json:"query"` - Variables map[string]string `json:"variables"` - }{ - Query: query, - Variables: vars, - } - - body, err := json.Marshal(q) - if err != nil { - return err - } - - req, err := http.NewRequestWithContext(ctx, http.MethodPost, t.url, bytes.NewReader(body)) - if err != nil { - return err - } - - resp, err := t.httpClient.Do(req) - if err != nil { - return err - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - io.Copy(os.Stdout, resp.Body) - return fmt.Errorf(resp.Status) - } - - if err := json.NewDecoder(resp.Body).Decode(&respBody); err != nil { - return err - } - - return nil -}