From 3c4e6b48f9e17b25641de486046687460a0e8694 Mon Sep 17 00:00:00 2001 From: Christer Edvartsen Date: Mon, 27 Jan 2025 10:35:51 +0100 Subject: [PATCH 1/2] Write deployments to nais/api using gRPC Relevant changes: - Use apiclient package from nais/api instead of generating and wrapping the client - Enrich deployment request to include deployer username and trigger URL - All errors that occurs when writing deployments to nais/api will trigger log entries, and will not abort any other process Other changes: - Bump version of staticcheck to make it run (the version used was broken) - Fixed warning on using Errorf without constant format strings in touched files Co-authored-by: Thomas Krampl --- Makefile | 22 - cmd/hookd/main.go | 41 +- go.mod | 46 +- go.sum | 42 +- pkg/deployclient/request.go | 8 +- pkg/grpc/deployserver/deployserver.go | 66 +- pkg/grpc/dispatchserver/broker.go | 40 +- pkg/grpc/dispatchserver/dispatchserver.go | 7 +- .../dispatchserver/dispatchserver_test.go | 7 +- pkg/grpc/interceptor/auth/server.go | 27 +- pkg/grpc/interceptor/auth/server_test.go | 26 +- pkg/naisapi/naisapi.go | 44 - pkg/naisapi/protoapi/pagination.pb.go | 163 -- pkg/naisapi/protoapi/teams.pb.go | 1766 ----------------- pkg/naisapi/protoapi/teams_grpc.pb.go | 405 ---- pkg/naisapi/protoapi/users.pb.go | 476 ----- pkg/naisapi/protoapi/users_grpc.pb.go | 146 -- pkg/pb/deployment.pb.go | 121 +- pkg/pb/deployment.proto | 2 + pkg/pb/deployment_grpc.pb.go | 12 + 20 files changed, 305 insertions(+), 3162 deletions(-) delete mode 100644 pkg/naisapi/naisapi.go delete mode 100644 pkg/naisapi/protoapi/pagination.pb.go delete mode 100644 pkg/naisapi/protoapi/teams.pb.go delete mode 100644 pkg/naisapi/protoapi/teams_grpc.pb.go delete mode 100644 pkg/naisapi/protoapi/users.pb.go delete mode 100644 pkg/naisapi/protoapi/users_grpc.pb.go diff --git a/Makefile b/Makefile index 67567d90..9f6bca1a 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,6 @@ 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 := e1c532d516dfdd586dc98e6f7e5275d91c53dcf5 -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/ @@ -90,23 +88,3 @@ 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/cmd/hookd/main.go b/cmd/hookd/main.go index 19218462..efeb528b 100644 --- a/cmd/hookd/main.go +++ b/cmd/hookd/main.go @@ -13,13 +13,7 @@ import ( "time" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus" - "github.com/nais/deploy/pkg/telemetry" - "github.com/nais/liberator/pkg/conftools" - "github.com/prometheus/client_golang/prometheus" - log "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/keepalive" - + "github.com/nais/api/pkg/apiclient" "github.com/nais/deploy/pkg/grpc/deployserver" "github.com/nais/deploy/pkg/grpc/dispatchserver" auth_interceptor "github.com/nais/deploy/pkg/grpc/interceptor/auth" @@ -32,9 +26,15 @@ 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/telemetry" "github.com/nais/deploy/pkg/version" + "github.com/nais/liberator/pkg/conftools" + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/keepalive" ) var maskedConfig = []string{ @@ -171,13 +171,28 @@ func run() error { return nil } +func newApiClient(target string, insecureConnection bool) (*apiclient.APIClient, error) { + opts := []grpc.DialOption{} + if insecureConnection { + opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } + + return apiclient.New(target, opts...) +} + func startGrpcServer(cfg config.Config, db database.DeploymentStore, apikeys database.ApiKeyStore) (*grpc.Server, dispatchserver.DispatchServer, error) { clusterRedirects, err := parseKeyVal(cfg.ClusterMigrationRedirect) if err != nil { return nil, nil, fmt.Errorf("unable to parse cluster migration redirects: %v", err) } - dispatchServer := dispatchserver.New(db) - deployServer := deployserver.New(dispatchServer, db, clusterRedirects) + + apiClient, err := newApiClient(cfg.NaisAPIAddress, cfg.NaisAPIInsecureConnection) + if err != nil { + return nil, nil, fmt.Errorf("unable to set up nais-api client: %w", err) + } + + dispatchServer := dispatchserver.New(db, apiClient.Deployments()) + deployServer := deployserver.New(dispatchServer, db, clusterRedirects, apiClient.Deployments()) unaryInterceptors := make([]grpc.UnaryServerInterceptor, 0) streamInterceptors := make([]grpc.StreamServerInterceptor, 0) @@ -204,11 +219,7 @@ func startGrpcServer(cfg config.Config, db database.DeploymentStore, apikeys dat return nil, nil, fmt.Errorf("unable to set up github validator: %w", err) } - 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) + authInterceptor := auth_interceptor.NewServerInterceptor(apikeys, ghValidator, apiClient.Teams()) interceptor.Add(pb.Deploy_ServiceDesc.ServiceName, authInterceptor) log.Infof("Authentication enabled for deployment requests") diff --git a/go.mod b/go.mod index 471a9282..66e161d5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nais/deploy -go 1.22 +go 1.22.1 require ( github.com/aymerick/raymond v2.0.2+incompatible @@ -8,43 +8,40 @@ require ( github.com/go-chi/chi v4.1.2+incompatible github.com/go-chi/render v1.0.3 github.com/golang/protobuf v1.5.3 + github.com/google/go-github/v41 v41.0.0 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 github.com/jackc/pgx/v4 v4.18.2 + github.com/lestrrat-go/jwx/v2 v2.0.21 github.com/lib/pq v1.10.9 + github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0 github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73 github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.17.0 github.com/stretchr/testify v1.9.0 - golang.org/x/oauth2 v0.22.0 // indirect - google.golang.org/grpc v1.66.0 - google.golang.org/protobuf v1.34.2 - gopkg.in/sakura-internet/go-rison.v3 v3.2.0 - gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.28.0 - k8s.io/apimachinery v0.28.0 - k8s.io/client-go v0.28.0 - sigs.k8s.io/controller-runtime v0.15.0 -) - -require ( - github.com/google/go-github/v41 v41.0.0 - github.com/lestrrat-go/jwx/v2 v2.0.21 github.com/vektra/mockery/v2 v2.38.0 go.opentelemetry.io/otel v1.29.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 go.opentelemetry.io/otel/sdk v1.29.0 go.opentelemetry.io/otel/trace v1.29.0 golang.org/x/vuln v1.0.1 + google.golang.org/grpc v1.66.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 - honnef.co/go/tools v0.4.6 + google.golang.org/protobuf v1.36.4 + gopkg.in/sakura-internet/go-rison.v3 v3.2.0 + gopkg.in/yaml.v2 v2.4.0 + honnef.co/go/tools v0.5.1 + k8s.io/api v0.28.0 + k8s.io/apimachinery v0.28.0 + k8s.io/client-go v0.28.0 mvdan.cc/gofumpt v0.5.0 + sigs.k8s.io/controller-runtime v0.15.0 ) require ( - github.com/BurntSushi/toml v1.2.1 // indirect + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect github.com/ajg/form v1.5.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect @@ -123,17 +120,18 @@ require ( go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect - golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect + golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/net v0.34.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 // indirect gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect diff --git a/go.sum b/go.sum index 1b89db24..48511e95 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= @@ -347,6 +347,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0 h1:x7OCiGd4izlRe6vV4bVna/pJKoZSRLI+TWPC+bR3LyQ= +github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0/go.mod h1:B4YXj9CpfjDwrFrgp/y4bbkmkzhdGxmUZPdzx7XnkrU= github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73 h1:BgKMybHE+cfRy86/Yh7A9CjxyjA9+kXyWHT861RGXl0= github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73/go.mod h1:cWThp1WBBbkRFhMI2DQMvBTTEN+6GPzmmh+Xjv8vffE= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= @@ -487,8 +489,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -499,10 +501,10 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= -golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb h1:WGs/bGIWYyAY5PVgGGMXqGGCxSJz4fpoUExb/vgqNCU= -golang.org/x/exp/typeparams v0.0.0-20230213192124-5e25df0256eb/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ= +golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -561,8 +563,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -634,12 +636,12 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -709,8 +711,8 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 h1:SHq4Rl+B7WvyM4XODon1LXtP7gcG49+7Jubt1gWWswY= +golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3/go.mod h1:bqv7PJ/TtlrzgJKhOAGdDUkUltQapRik/UEHubLVBWo= golang.org/x/vuln v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= golang.org/x/vuln v1.0.1/go.mod h1:bb2hMwln/tqxg32BNY4CcxHWtHXuYa3SbIBmtsyjxtM= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -819,8 +821,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -847,8 +849,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= -honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= k8s.io/api v0.28.0 h1:3j3VPWmN9tTDI68NETBWlDiA9qOiGJ7sdKeufehBYsM= k8s.io/api v0.28.0/go.mod h1:0l8NZJzB0i/etuWnIXcwfIv+xnDOhL3lLW919AWYDuY= k8s.io/apiextensions-apiserver v0.28.0 h1:CszgmBL8CizEnj4sj7/PtLGey6Na3YgWyGCPONv7E9E= diff --git a/pkg/deployclient/request.go b/pkg/deployclient/request.go index f18821bd..6dc8cee6 100644 --- a/pkg/deployclient/request.go +++ b/pkg/deployclient/request.go @@ -1,12 +1,14 @@ package deployclient import ( + "os" "time" "github.com/nais/deploy/pkg/pb" ) func MakeDeploymentRequest(cfg Config, deadline time.Time, kubernetes *pb.Kubernetes) *pb.DeploymentRequest { + annotations := BuildEnvironmentAnnotations() return &pb.DeploymentRequest{ Cluster: cfg.Cluster, Deadline: pb.TimeAsTimestamp(deadline), @@ -17,7 +19,9 @@ func MakeDeploymentRequest(cfg Config, deadline time.Time, kubernetes *pb.Kubern Owner: cfg.Owner, Name: cfg.Repository, }, - Team: cfg.Team, - Time: pb.TimeAsTimestamp(time.Now()), + Team: cfg.Team, + Time: pb.TimeAsTimestamp(time.Now()), + TriggerUrl: annotations[GithubWorkflowRunURL], + DeployerUsername: os.Getenv("GITHUB_ACTOR"), } } diff --git a/pkg/grpc/deployserver/deployserver.go b/pkg/grpc/deployserver/deployserver.go index f9237379..1eed203e 100644 --- a/pkg/grpc/deployserver/deployserver.go +++ b/pkg/grpc/deployserver/deployserver.go @@ -4,6 +4,7 @@ import ( "context" "github.com/google/uuid" + "github.com/nais/api/pkg/apiclient/protoapi" "github.com/nais/deploy/pkg/grpc/dispatchserver" "github.com/nais/deploy/pkg/hookd/database" database_mapper "github.com/nais/deploy/pkg/hookd/database/mapper" @@ -21,20 +22,22 @@ type deployServer struct { dispatchServer dispatchserver.DispatchServer deploymentStore database.DeploymentStore redirect map[string]string + apiClient protoapi.DeploymentsClient } -func New(dispatchServer dispatchserver.DispatchServer, deploymentStore database.DeploymentStore, redirect map[string]string) pb.DeployServer { +func New(dispatchServer dispatchserver.DispatchServer, deploymentStore database.DeploymentStore, redirect map[string]string, apiClient protoapi.DeploymentsClient) pb.DeployServer { return &deployServer{ deploymentStore: deploymentStore, dispatchServer: dispatchServer, redirect: redirect, + apiClient: apiClient, } } func (ds *deployServer) uuidgen() (string, error) { uuidstr, err := uuid.NewRandom() if err != nil { - return "", status.Errorf(codes.Unavailable, err.Error()) + return "", status.Error(codes.Unavailable, err.Error()) } return uuidstr.String(), nil } @@ -66,6 +69,11 @@ func (ds *deployServer) addToDatabase(ctx context.Context, request *pb.Deploymen err = ds.deploymentStore.WriteDeployment(ctx, deployment) if err == nil { + naisApiDeploymentID, err := ds.writeDeploymentToNaisApi(ctx, request, cluster) + if err != nil { + logger.WithError(err).Error("Write deployment to Nais API") + } + // Write metadata of Kubernetes resources to database for i, id := range identifiers { uuidstr, err := ds.uuidgen() @@ -88,6 +96,13 @@ func (ds *deployServer) addToDatabase(ctx context.Context, request *pb.Deploymen logger.Error(err) return ErrDatabaseUnavailable } + + if naisApiDeploymentID != nil { + err := ds.writeDeploymentResourceToNaisApi(ctx, naisApiDeploymentID, id) + if err != nil { + logger.WithError(err).Error("Write deployment resources to Nais API") + } + } } } else { logger.Error(err) @@ -97,6 +112,53 @@ func (ds *deployServer) addToDatabase(ctx context.Context, request *pb.Deploymen return nil } +func (ds *deployServer) writeDeploymentResourceToNaisApi(ctx context.Context, naisApiDeploymentID *string, meta k8sutils.Identifier) error { + _, err := ds.apiClient.CreateDeploymentK8SResource(ctx, protoapi.CreateDeploymentK8SResourceRequest_builder{ + DeploymentId: naisApiDeploymentID, + Group: &meta.Group, + Version: &meta.Version, + Kind: &meta.Kind, + Name: &meta.Name, + Namespace: &meta.Namespace, + }.Build()) + return err +} + +func (ds *deployServer) writeDeploymentToNaisApi(ctx context.Context, request *pb.DeploymentRequest, cluster string) (*string, error) { + reqID := request.GetID() + reqTeam := request.GetTeam() + req := protoapi.CreateDeploymentRequest_builder{ + ExternalId: &reqID, + CreatedAt: request.GetTime(), + TeamSlug: &reqTeam, + Repository: request.GetRepository().FullNamePtr(), + EnvironmentName: &cluster, + }.Build() + + ref := request.GetGitRefSha() + if ref != "" { + req.SetCommitSha(ref) + } + + username := request.GetDeployerUsername() + if username != "" { + req.SetDeployerUsername(username) + } + + triggerUrl := request.GetTriggerUrl() + if triggerUrl != "" { + req.SetTriggerUrl(triggerUrl) + } + + resp, err := ds.apiClient.CreateDeployment(ctx, req) + if err != nil { + return nil, err + } + + respID := resp.GetId() + return &respID, nil +} + func (ds *deployServer) Deploy(ctx context.Context, request *pb.DeploymentRequest) (*pb.DeploymentStatus, error) { uuidstr, err := ds.uuidgen() if err != nil { diff --git a/pkg/grpc/dispatchserver/broker.go b/pkg/grpc/dispatchserver/broker.go index a049eb8f..21380ec2 100644 --- a/pkg/grpc/dispatchserver/broker.go +++ b/pkg/grpc/dispatchserver/broker.go @@ -6,6 +6,7 @@ import ( "context" "fmt" + "github.com/nais/api/pkg/apiclient/protoapi" "github.com/nais/deploy/pkg/hookd/database" database_mapper "github.com/nais/deploy/pkg/hookd/database/mapper" "github.com/nais/deploy/pkg/hookd/metrics" @@ -58,16 +59,20 @@ func (s *dispatchServer) HandleDeploymentStatus(ctx context.Context, st *pb.Depl err := s.db.WriteDeploymentStatus(ctx, dbStatus) if err != nil { if database.IsErrForeignKeyViolation(err) { - return status.Errorf(codes.FailedPrecondition, err.Error()) + return status.Error(codes.FailedPrecondition, err.Error()) } return status.Errorf(codes.Unavailable, "write deployment status to database: %s", err) } metrics.UpdateQueue(st) - logger := log.WithFields(st.LogFields()) logger.Debugf("Saved deployment status in database") + err = s.writeDeploymentStatusToNaisApi(ctx, st) + if err != nil { + logger.WithError(err).Errorf("Write deployment status to Nais API") + } + if st.GetState().Finished() { deployID := st.GetRequest().GetID() s.traceSpansLock.Lock() @@ -81,3 +86,34 @@ func (s *dispatchServer) HandleDeploymentStatus(ctx context.Context, st *pb.Depl return nil } + +func (s *dispatchServer) writeDeploymentStatusToNaisApi(ctx context.Context, status *pb.DeploymentStatus) error { + reqID := status.GetRequest().GetID() + msg := status.GetMessage() + _, err := s.apiClient.CreateDeploymentStatus(ctx, protoapi.CreateDeploymentStatusRequest_builder{ + ExternalDeploymentId: &reqID, + CreatedAt: status.GetTime(), + State: convertDeploymentState(status.GetState()), + Message: &msg, + }.Build()) + return err +} + +func convertDeploymentState(deploymentState pb.DeploymentState) *protoapi.DeploymentState { + ret := protoapi.DeploymentState_pending + switch deploymentState { + case pb.DeploymentState_success: + ret = protoapi.DeploymentState_success + case pb.DeploymentState_error: + ret = protoapi.DeploymentState_error + case pb.DeploymentState_failure: + ret = protoapi.DeploymentState_failure + case pb.DeploymentState_inactive: + ret = protoapi.DeploymentState_inactive + case pb.DeploymentState_in_progress: + ret = protoapi.DeploymentState_in_progress + case pb.DeploymentState_queued: + ret = protoapi.DeploymentState_queued + } + return &ret +} diff --git a/pkg/grpc/dispatchserver/dispatchserver.go b/pkg/grpc/dispatchserver/dispatchserver.go index 73403fae..c796eced 100644 --- a/pkg/grpc/dispatchserver/dispatchserver.go +++ b/pkg/grpc/dispatchserver/dispatchserver.go @@ -12,6 +12,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/nais/api/pkg/apiclient/protoapi" "github.com/nais/deploy/pkg/hookd/database" database_mapper "github.com/nais/deploy/pkg/hookd/database/mapper" "github.com/nais/deploy/pkg/hookd/metrics" @@ -35,6 +36,7 @@ type dispatchServer struct { traceSpans map[string]trace.Span traceSpansLock sync.RWMutex db database.DeploymentStore + apiClient protoapi.DeploymentsClient } var _ DispatchServer = &dispatchServer{} @@ -44,12 +46,13 @@ type requestWithWait struct { wait chan error } -func New(db database.DeploymentStore) DispatchServer { +func New(db database.DeploymentStore, apiClient protoapi.DeploymentsClient) DispatchServer { server := &dispatchServer{ onlineClustersMap: make(map[string]chan<- *requestWithWait), statusStreams: make(map[context.Context]chan<- *pb.DeploymentStatus), traceSpans: make(map[string]trace.Span), db: db, + apiClient: apiClient, } return server @@ -115,7 +118,7 @@ func (s *dispatchServer) Deployments(opts *pb.GetDeploymentOpts, stream pb.Dispa // invalidate older deployments err := s.invalidateHistoric(stream.Context(), opts.GetCluster(), opts.GetStartupTime().AsTime()) if err != nil { - return status.Errorf(codes.Unavailable, err.Error()) + return status.Error(codes.Unavailable, err.Error()) } for { diff --git a/pkg/grpc/dispatchserver/dispatchserver_test.go b/pkg/grpc/dispatchserver/dispatchserver_test.go index f3418cae..896ede22 100644 --- a/pkg/grpc/dispatchserver/dispatchserver_test.go +++ b/pkg/grpc/dispatchserver/dispatchserver_test.go @@ -7,6 +7,7 @@ import ( "testing" "time" + "github.com/nais/api/pkg/apiclient" presharedkey_interceptor "github.com/nais/deploy/pkg/grpc/interceptor/presharedkey" "github.com/nais/deploy/pkg/hookd/database" "github.com/nais/deploy/pkg/pb" @@ -43,7 +44,11 @@ func TestInterceptors(t *testing.T) { deploymentStore.On("WriteDeploymentStatus", mock.Anything, mock.Anything).Return(nil) deploymentStore.On("Deployment", mock.Anything, mock.Anything).Return(mockDeployment, nil) - ds := New(&deploymentStore) + mockApiClients, mockApiServer := apiclient.NewMockClient(t) + + mockApiServer.Deployments.EXPECT().CreateDeploymentStatus(mock.Anything, mock.Anything).Return(nil, nil) + + ds := New(&deploymentStore, mockApiClients.Deployments()) presharedkeyInterceptor := &presharedkey_interceptor.ServerInterceptor{ Keys: []string{CorrectPassword}, diff --git a/pkg/grpc/interceptor/auth/server.go b/pkg/grpc/interceptor/auth/server.go index 16c7ce4c..b7f568d7 100644 --- a/pkg/grpc/interceptor/auth/server.go +++ b/pkg/grpc/interceptor/auth/server.go @@ -9,6 +9,7 @@ import ( "time" "github.com/lestrrat-go/jwx/v2/jwt" + "github.com/nais/api/pkg/apiclient/protoapi" log "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -29,24 +30,20 @@ const ( type ServerInterceptor struct { APIKeyStore database.ApiKeyStore TokenValidator TokenValidator - TeamsClient TeamsClient + TeamsClient protoapi.TeamsClient } type TokenValidator interface { Validate(ctx context.Context, token string) (jwt.Token, error) } -type TeamsClient interface { - IsAuthorized(ctx context.Context, repo, team string) (bool, error) -} - type authData struct { hmac []byte timestamp string team string } -func NewServerInterceptor(apiKeyStore database.ApiKeyStore, tokenValidator TokenValidator, teamsClient TeamsClient) *ServerInterceptor { +func NewServerInterceptor(apiKeyStore database.ApiKeyStore, tokenValidator TokenValidator, teamsClient protoapi.TeamsClient) *ServerInterceptor { return &ServerInterceptor{ APIKeyStore: apiKeyStore, TokenValidator: tokenValidator, @@ -96,12 +93,16 @@ func (s *ServerInterceptor) UnaryServerInterceptor(ctx context.Context, req inte return nil, status.Errorf(codes.InvalidArgument, "missing team in metadata") } - authorized, err := s.TeamsClient.IsAuthorized(ctx, repo, team) + authorized, err := s.TeamsClient.IsRepositoryAuthorized(ctx, protoapi.IsRepositoryAuthorizedRequest_builder{ + TeamSlug: team, + Repository: repo, + }.Build()) if err != nil { + log.WithError(err).Error("checking repo authorization in Nais API") metrics.InterceptorRequest(requestTypeJWT, "teams_service_error") - return nil, status.Errorf(codes.Unavailable, "something wrong happened when communicating with the teams service") + return nil, status.Errorf(codes.Unavailable, "something wrong happened when communicating with Nais API") } - if !authorized { + if !authorized.GetIsAuthorized() { metrics.InterceptorRequest(requestTypeJWT, "repo_not_authorized") return nil, status.Errorf(codes.PermissionDenied, fmt.Sprintf("repo %q not authorized by team %q", repo, team)) } @@ -201,11 +202,15 @@ func (s *ServerInterceptor) StreamServerInterceptor(srv interface{}, ss grpc.Ser return status.Errorf(codes.InvalidArgument, "missing team in metadata") } - authorized, err := s.TeamsClient.IsAuthorized(ss.Context(), repo, team) + authorized, err := s.TeamsClient.IsRepositoryAuthorized(ss.Context(), protoapi.IsRepositoryAuthorizedRequest_builder{ + TeamSlug: team, + Repository: repo, + }.Build()) if err != nil { + log.WithError(err).Error("checking repo authorization in Nais API") return status.Errorf(codes.Unavailable, "something wrong happened when communicating with the teams service") } - if !authorized { + if !authorized.GetIsAuthorized() { return status.Errorf(codes.PermissionDenied, fmt.Sprintf("repo %q not authorized by team %q", repo, team)) } } else { diff --git a/pkg/grpc/interceptor/auth/server_test.go b/pkg/grpc/interceptor/auth/server_test.go index ac8aa335..cf40f3f8 100644 --- a/pkg/grpc/interceptor/auth/server_test.go +++ b/pkg/grpc/interceptor/auth/server_test.go @@ -8,9 +8,12 @@ import ( "time" "github.com/lestrrat-go/jwx/v2/jwt" + "github.com/nais/api/pkg/apiclient" + "github.com/nais/api/pkg/apiclient/protoapi" api_v1 "github.com/nais/deploy/pkg/hookd/api/v1" "github.com/nais/deploy/pkg/hookd/database" "github.com/nais/deploy/pkg/pb" + "github.com/stretchr/testify/mock" "google.golang.org/grpc/metadata" ) @@ -82,15 +85,24 @@ func TestServerInterceptorApiKey(t *testing.T) { } func TestServerInterceptorJWT(t *testing.T) { + apiClients, apiMocks := apiclient.NewMockClient(t) + apiMocks.Teams.EXPECT(). + IsRepositoryAuthorized(mock.Anything, mock.Anything). + RunAndReturn(func(ctx context.Context, irar *protoapi.IsRepositoryAuthorizedRequest) (*protoapi.IsRepositoryAuthorizedResponse, error) { + if irar.GetTeamSlug() == "team" && irar.GetRepository() == "repo" { + return protoapi.IsRepositoryAuthorizedResponse_builder{IsAuthorized: true}.Build(), nil + } + + return protoapi.IsRepositoryAuthorizedResponse_builder{IsAuthorized: false}.Build(), nil + }) + i := &ServerInterceptor{ APIKeyStore: &mockAPIKeyStore{}, TokenValidator: &mockTokenValidator{ repo: "repo", valid: "valid", }, - TeamsClient: &mockTeamsClient{ - authorized: map[string]string{"repo": "team"}, - }, + TeamsClient: apiClients.Teams(), } ctx := metadata.NewIncomingContext(context.Background(), metadata.MD{ @@ -176,14 +188,6 @@ func (m *mockTokenValidator) Validate(ctx context.Context, token string) (jwt.To return jwt.NewBuilder().Claim("repository", m.repo).Build() } -type mockTeamsClient struct { - authorized map[string]string -} - -func (m *mockTeamsClient) IsAuthorized(ctx context.Context, repo, team string) (bool, error) { - return m.authorized[repo] == team, nil -} - func handler(ctx context.Context, req any) (any, error) { return nil, nil } diff --git a/pkg/naisapi/naisapi.go b/pkg/naisapi/naisapi.go deleted file mode 100644 index 65a41e52..00000000 --- a/pkg/naisapi/naisapi.go +++ /dev/null @@ -1,44 +0,0 @@ -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, error) { - resp, err := c.client.IsRepositoryAuthorized(ctx, &protoapi.IsRepositoryAuthorizedRequest{ - TeamSlug: team, - Repository: repo, - }) - if err != nil { - log.WithError(err).Error("checking repo authorization in teams") - return false, err - } - - return resp.IsAuthorized, nil -} diff --git a/pkg/naisapi/protoapi/pagination.pb.go b/pkg/naisapi/protoapi/pagination.pb.go deleted file mode 100644 index 13b5c3a7..00000000 --- a/pkg/naisapi/protoapi/pagination.pb.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 -// 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 deleted file mode 100644 index da9137b1..00000000 --- a/pkg/naisapi/protoapi/teams.pb.go +++ /dev/null @@ -1,1766 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 -// 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 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"` - CdnBucket *string `protobuf:"bytes,8,opt,name=cdn_bucket,json=cdnBucket,proto3,oneof" json:"cdn_bucket,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 "" -} - -func (x *Team) GetCdnBucket() string { - if x != nil && x.CdnBucket != nil { - return *x.CdnBucket - } - 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"` - CdnBucket *string `protobuf:"bytes,6,opt,name=cdn_bucket,json=cdnBucket,proto3,oneof" json:"cdn_bucket,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 "" -} - -func (x *SetTeamExternalReferencesRequest) GetCdnBucket() string { - if x != nil && x.CdnBucket != nil { - return *x.CdnBucket - } - 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"` -} - -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 "" -} - -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, 0x97, 0x03, 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, 0x12, 0x22, 0x0a, 0x0a, 0x63, 0x64, 0x6e, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x09, 0x63, 0x64, 0x6e, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 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, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x64, 0x6e, 0x5f, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 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, 0xf4, 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, 0x12, - 0x22, 0x0a, 0x0a, 0x63, 0x64, 0x6e, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x09, 0x63, 0x64, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 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, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x64, 0x6e, 0x5f, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 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, 0x71, 0x0a, 0x1d, 0x49, 0x73, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x65, 0x61, 0x6d, - 0x5f, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x61, - 0x6d, 0x53, 0x6c, 0x75, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x0d, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x49, 0x73, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x69, 0x73, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x32, 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_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_teams_proto_goTypes = []interface{}{ - (*Team)(nil), // 0: Team - (*ListAuthorizedRepositoriesRequest)(nil), // 1: ListAuthorizedRepositoriesRequest - (*ListAuthorizedRepositoriesResponse)(nil), // 2: ListAuthorizedRepositoriesResponse - (*DeleteTeamRequest)(nil), // 3: DeleteTeamRequest - (*DeleteTeamResponse)(nil), // 4: DeleteTeamResponse - (*SetTeamExternalReferencesRequest)(nil), // 5: SetTeamExternalReferencesRequest - (*SetTeamExternalReferencesResponse)(nil), // 6: SetTeamExternalReferencesResponse - (*SetTeamEnvironmentExternalReferencesRequest)(nil), // 7: SetTeamEnvironmentExternalReferencesRequest - (*SetTeamEnvironmentExternalReferencesResponse)(nil), // 8: SetTeamEnvironmentExternalReferencesResponse - (*ListTeamEnvironmentsRequest)(nil), // 9: ListTeamEnvironmentsRequest - (*ListTeamEnvironmentsResponse)(nil), // 10: ListTeamEnvironmentsResponse - (*TeamEnvironment)(nil), // 11: TeamEnvironment - (*GetTeamResponse)(nil), // 12: GetTeamResponse - (*GetTeamRequest)(nil), // 13: GetTeamRequest - (*ListTeamsRequest)(nil), // 14: ListTeamsRequest - (*ListTeamsResponse)(nil), // 15: ListTeamsResponse - (*ListTeamMembersRequest)(nil), // 16: ListTeamMembersRequest - (*ListTeamMembersResponse)(nil), // 17: ListTeamMembersResponse - (*TeamMember)(nil), // 18: TeamMember - (*IsRepositoryAuthorizedRequest)(nil), // 19: IsRepositoryAuthorizedRequest - (*IsRepositoryAuthorizedResponse)(nil), // 20: IsRepositoryAuthorizedResponse - (*PageInfo)(nil), // 21: PageInfo - (*User)(nil), // 22: User -} -var file_teams_proto_depIdxs = []int32{ - 11, // 0: ListTeamEnvironmentsResponse.nodes:type_name -> TeamEnvironment - 21, // 1: ListTeamEnvironmentsResponse.page_info:type_name -> PageInfo - 0, // 2: GetTeamResponse.team:type_name -> Team - 0, // 3: ListTeamsResponse.nodes:type_name -> Team - 21, // 4: ListTeamsResponse.page_info:type_name -> PageInfo - 18, // 5: ListTeamMembersResponse.nodes:type_name -> TeamMember - 21, // 6: ListTeamMembersResponse.page_info:type_name -> PageInfo - 22, // 7: TeamMember.user:type_name -> User - 1, // 8: Teams.ListAuthorizedRepositories:input_type -> ListAuthorizedRepositoriesRequest - 13, // 9: Teams.Get:input_type -> GetTeamRequest - 14, // 10: Teams.List:input_type -> ListTeamsRequest - 16, // 11: Teams.Members:input_type -> ListTeamMembersRequest - 9, // 12: Teams.Environments:input_type -> ListTeamEnvironmentsRequest - 5, // 13: Teams.SetTeamExternalReferences:input_type -> SetTeamExternalReferencesRequest - 7, // 14: Teams.SetTeamEnvironmentExternalReferences:input_type -> SetTeamEnvironmentExternalReferencesRequest - 3, // 15: Teams.Delete:input_type -> DeleteTeamRequest - 19, // 16: Teams.IsRepositoryAuthorized:input_type -> IsRepositoryAuthorizedRequest - 2, // 17: Teams.ListAuthorizedRepositories:output_type -> ListAuthorizedRepositoriesResponse - 12, // 18: Teams.Get:output_type -> GetTeamResponse - 15, // 19: Teams.List:output_type -> ListTeamsResponse - 17, // 20: Teams.Members:output_type -> ListTeamMembersResponse - 10, // 21: Teams.Environments:output_type -> ListTeamEnvironmentsResponse - 6, // 22: Teams.SetTeamExternalReferences:output_type -> SetTeamExternalReferencesResponse - 8, // 23: Teams.SetTeamEnvironmentExternalReferences:output_type -> SetTeamEnvironmentExternalReferencesResponse - 4, // 24: Teams.Delete:output_type -> DeleteTeamResponse - 20, // 25: Teams.IsRepositoryAuthorized:output_type -> IsRepositoryAuthorizedResponse - 17, // [17:26] is the sub-list for method output_type - 8, // [8:17] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] 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: 0, - NumMessages: 21, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_teams_proto_goTypes, - DependencyIndexes: file_teams_proto_depIdxs, - 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 deleted file mode 100644 index fbfd4c68..00000000 --- a/pkg/naisapi/protoapi/teams_grpc.pb.go +++ /dev/null @@ -1,405 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.1 -// 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 deleted file mode 100644 index 20948384..00000000 --- a/pkg/naisapi/protoapi/users.pb.go +++ /dev/null @@ -1,476 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 -// 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 deleted file mode 100644 index 16023764..00000000 --- a/pkg/naisapi/protoapi/users_grpc.pb.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.1 -// 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", -} diff --git a/pkg/pb/deployment.pb.go b/pkg/pb/deployment.pb.go index d65572b4..541e600b 100644 --- a/pkg/pb/deployment.pb.go +++ b/pkg/pb/deployment.pb.go @@ -200,6 +200,8 @@ type DeploymentRequest struct { Repository *GithubRepository `protobuf:"bytes,8,opt,name=repository,proto3" json:"repository,omitempty"` GithubEnvironment string `protobuf:"bytes,9,opt,name=GithubEnvironment,proto3" json:"GithubEnvironment,omitempty"` TraceParent string `protobuf:"bytes,10,opt,name=traceParent,proto3" json:"traceParent,omitempty"` + DeployerUsername string `protobuf:"bytes,11,opt,name=deployerUsername,proto3" json:"deployerUsername,omitempty"` + TriggerUrl string `protobuf:"bytes,12,opt,name=triggerUrl,proto3" json:"triggerUrl,omitempty"` } func (x *DeploymentRequest) Reset() { @@ -304,6 +306,20 @@ func (x *DeploymentRequest) GetTraceParent() string { return "" } +func (x *DeploymentRequest) GetDeployerUsername() string { + if x != nil { + return x.DeployerUsername + } + return "" +} + +func (x *DeploymentRequest) GetTriggerUrl() string { + if x != nil { + return x.TriggerUrl + } + return "" +} + type DeploymentStatus struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -485,7 +501,7 @@ var file_pkg_pb_deployment_proto_rawDesc = []byte{ 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, - 0x8d, 0x03, 0x0a, 0x11, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0xd9, 0x03, 0x0a, 0x11, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, @@ -509,55 +525,60 @@ var file_pkg_pb_deployment_proto_rawDesc = []byte{ 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, - 0xb8, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x6b, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x75, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x75, 0x70, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4f, 0x70, 0x74, 0x73, 0x2a, 0x6e, 0x0a, 0x0f, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, - 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, - 0x65, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, - 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x10, 0x05, 0x12, 0x0b, - 0x0a, 0x07, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x06, 0x32, 0x89, 0x01, 0x0a, 0x08, - 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6c, - 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x73, 0x1a, 0x15, - 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x0c, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, - 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x4f, 0x70, 0x74, 0x73, 0x22, 0x00, 0x32, 0x7c, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x12, 0x37, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x15, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x00, 0x30, 0x01, 0x42, 0x39, 0x0a, 0x18, 0x6e, 0x6f, 0x2e, 0x6e, 0x61, 0x76, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x61, - 0x69, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, + 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x22, 0xb8, 0x01, 0x0a, 0x10, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x2f, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, + 0x65, 0x12, 0x29, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x6b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x54, + 0x69, 0x6d, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x4f, 0x70, 0x74, 0x73, 0x2a, 0x6e, 0x0a, 0x0f, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x10, 0x02, 0x12, + 0x0c, 0x0a, 0x08, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x03, 0x12, 0x0f, 0x0a, + 0x0b, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x10, 0x04, 0x12, 0x0a, + 0x0a, 0x06, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x06, 0x32, 0x89, 0x01, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x70, + 0x61, 0x74, 0x63, 0x68, 0x12, 0x3f, 0x0a, 0x0b, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x70, 0x74, 0x73, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4f, 0x70, 0x74, + 0x73, 0x22, 0x00, 0x32, 0x7c, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x37, 0x0a, + 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x30, + 0x01, 0x42, 0x39, 0x0a, 0x18, 0x6e, 0x6f, 0x2e, 0x6e, 0x61, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5a, 0x1d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x61, 0x69, 0x73, 0x2f, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/pb/deployment.proto b/pkg/pb/deployment.proto index ae7a327e..d7081c32 100644 --- a/pkg/pb/deployment.proto +++ b/pkg/pb/deployment.proto @@ -40,6 +40,8 @@ message DeploymentRequest { GithubRepository repository = 8; string GithubEnvironment = 9; string traceParent = 10; + string deployerUsername = 11; + string triggerUrl = 12; } message DeploymentStatus { diff --git a/pkg/pb/deployment_grpc.pb.go b/pkg/pb/deployment_grpc.pb.go index 7b18a129..c5fc7fdd 100644 --- a/pkg/pb/deployment_grpc.pb.go +++ b/pkg/pb/deployment_grpc.pb.go @@ -26,8 +26,12 @@ const ( // DispatchClient is the client API for Dispatch 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. +// +// This service is used by deployd. type DispatchClient interface { + // Continuous streaming of deployments that should be processed by deployd. Deployments(ctx context.Context, in *GetDeploymentOpts, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeploymentRequest], error) + // Deployd returns back statuses for deploys using this API. ReportStatus(ctx context.Context, in *DeploymentStatus, opts ...grpc.CallOption) (*ReportStatusOpts, error) } @@ -71,8 +75,12 @@ func (c *dispatchClient) ReportStatus(ctx context.Context, in *DeploymentStatus, // DispatchServer is the server API for Dispatch service. // All implementations must embed UnimplementedDispatchServer // for forward compatibility. +// +// This service is used by deployd. type DispatchServer interface { + // Continuous streaming of deployments that should be processed by deployd. Deployments(*GetDeploymentOpts, grpc.ServerStreamingServer[DeploymentRequest]) error + // Deployd returns back statuses for deploys using this API. ReportStatus(context.Context, *DeploymentStatus) (*ReportStatusOpts, error) mustEmbedUnimplementedDispatchServer() } @@ -170,6 +178,8 @@ const ( // DeployClient is the client API for Deploy 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. +// +// This service is used by end-users in their CI pipelines. type DeployClient interface { Deploy(ctx context.Context, in *DeploymentRequest, opts ...grpc.CallOption) (*DeploymentStatus, error) Status(ctx context.Context, in *DeploymentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeploymentStatus], error) @@ -215,6 +225,8 @@ type Deploy_StatusClient = grpc.ServerStreamingClient[DeploymentStatus] // DeployServer is the server API for Deploy service. // All implementations must embed UnimplementedDeployServer // for forward compatibility. +// +// This service is used by end-users in their CI pipelines. type DeployServer interface { Deploy(context.Context, *DeploymentRequest) (*DeploymentStatus, error) Status(*DeploymentRequest, grpc.ServerStreamingServer[DeploymentStatus]) error From 14a49b2c6003e619ef16cca500b240620d52d043 Mon Sep 17 00:00:00 2001 From: Thomas Krampl Date: Fri, 31 Jan 2025 16:06:27 +0100 Subject: [PATCH 2/2] Use proper nais/api reference sha --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 66e161d5..fef6f7f1 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/jackc/pgx/v4 v4.18.2 github.com/lestrrat-go/jwx/v2 v2.0.21 github.com/lib/pq v1.10.9 - github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0 + github.com/nais/api/pkg/apiclient v0.0.0-20250131144942-6e5893ff46b1 github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73 github.com/prometheus/client_golang v1.16.0 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index 48511e95..30b585c1 100644 --- a/go.sum +++ b/go.sum @@ -349,6 +349,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0 h1:x7OCiGd4izlRe6vV4bVna/pJKoZSRLI+TWPC+bR3LyQ= github.com/nais/api/pkg/apiclient v0.0.0-20250128091125-da8997435cd0/go.mod h1:B4YXj9CpfjDwrFrgp/y4bbkmkzhdGxmUZPdzx7XnkrU= +github.com/nais/api/pkg/apiclient v0.0.0-20250131144942-6e5893ff46b1 h1:HCDOKGSydFpoF+sOP48qZoNURXo5KIHVRBQKBLCqpAU= +github.com/nais/api/pkg/apiclient v0.0.0-20250131144942-6e5893ff46b1/go.mod h1:B4YXj9CpfjDwrFrgp/y4bbkmkzhdGxmUZPdzx7XnkrU= github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73 h1:BgKMybHE+cfRy86/Yh7A9CjxyjA9+kXyWHT861RGXl0= github.com/nais/liberator v0.0.0-20240304153811-0ce820054e73/go.mod h1:cWThp1WBBbkRFhMI2DQMvBTTEN+6GPzmmh+Xjv8vffE= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=