From 9ef9b31188032727d2f42a744a569f2e8e55f9bb Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Mon, 12 Jul 2021 09:41:07 -0700 Subject: [PATCH] Version CLI (#23) - client version command - registry version endpoint - Set release docker build version from git tag on make - Generate proto - Remove unused vertical align from success template - bump version to 0.0.10 - Update Makefile tags --- .goreleaser.yml | 2 + Dockerfile | 3 +- Makefile | 2 +- helm/charts/infra/Chart.yaml | 4 +- helm/charts/infra/charts/engine/Chart.yaml | 4 +- internal/cmd/cmd.go | 34 +++ internal/cmd/pages/success.html | 3 +- internal/registry/grpc.go | 5 + internal/v1/v1.pb.go | 310 +++++++++++++-------- internal/v1/v1.pb.validate.go | 67 +++++ internal/v1/v1.proto | 5 + internal/v1/v1_grpc.pb.go | 36 +++ internal/version/version.go | 5 + 13 files changed, 351 insertions(+), 129 deletions(-) create mode 100644 internal/version/version.go diff --git a/.goreleaser.yml b/.goreleaser.yml index a693d00405..6b4817b6a9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,6 +7,8 @@ env: project_name: infra builds: - id: infra + ldflags: + - -s -w -X github.com/infrahq/infra/internal/version.Version={{ .Version }} binary: infra main: ./main.go goos: diff --git a/Dockerfile b/Dockerfile index 725cc4a825..e29a6406d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,10 @@ RUN apt-get update && \ ln -s /usr/bin/aarch64-linux-gnu-gcc /usr/bin/arm64-linux-gnu-gcc && \ ln -s /usr/bin/x86_64-linux-gnu-gcc /usr/bin/amd64-linux-gnu-gcc ARG TARGETARCH +ARG BUILDVERSION=development WORKDIR /go/src/github.com/infrahq/infra COPY . . -RUN CGO_ENABLED=1 GOOS=linux GOARCH=$TARGETARCH CC=$TARGETARCH-linux-gnu-gcc go build -ldflags '-linkmode external -w -extldflags "-static"' . +RUN CGO_ENABLED=1 GOOS=linux GOARCH=$TARGETARCH CC=$TARGETARCH-linux-gnu-gcc go build -ldflags '-s -w -X github.com/infrahq/infra/internal/version.Version='"$BUILDVERSION"' -linkmode external -w -extldflags "-static"' . FROM alpine COPY --from=builder /go/src/github.com/infrahq/infra/infra /bin/infra diff --git a/Makefile b/Makefile index daf42c39f9..c40a7b1b9f 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ release: goreleaser release -f .goreleaser.yml --rm-dist release/docker: - docker buildx build --push --platform linux/amd64,linux/arm64 . -t infrahq/infra:$(tag:v%=%) -t infrahq/infra + docker buildx build --push --platform linux/amd64,linux/arm64 --build-arg BUILDVERSION=$(tag:v%=%) . -t infrahq/infra:$(tag:v%=%) -t infrahq/infra release/helm: make helm diff --git a/helm/charts/infra/Chart.yaml b/helm/charts/infra/Chart.yaml index ad06caf5df..65ccbb89e9 100644 --- a/helm/charts/infra/Chart.yaml +++ b/helm/charts/infra/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: infra description: Infra type: application -version: 0.0.9 -appVersion: "0.0.9" +version: 0.0.10 +appVersion: "0.0.10" diff --git a/helm/charts/infra/charts/engine/Chart.yaml b/helm/charts/infra/charts/engine/Chart.yaml index 8861d4ebe6..6d8c46ef51 100644 --- a/helm/charts/infra/charts/engine/Chart.yaml +++ b/helm/charts/infra/charts/engine/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: engine description: Infra Engine type: application -version: 0.0.9 -appVersion: "0.0.9" +version: 0.0.10 +appVersion: "0.0.10" diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 1b9b9c26ad..bdb0a906fd 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -16,6 +16,7 @@ import ( "strconv" "strings" "syscall" + "text/tabwriter" "time" survey "github.com/AlecAivazis/survey/v2" @@ -28,6 +29,7 @@ import ( "github.com/infrahq/infra/internal/generate" "github.com/infrahq/infra/internal/registry" v1 "github.com/infrahq/infra/internal/v1" + "github.com/infrahq/infra/internal/version" "github.com/mitchellh/go-homedir" "github.com/muesli/termenv" "github.com/olekukonko/tablewriter" @@ -975,6 +977,36 @@ func newEngineCmd() *cobra.Command { return cmd } +var versionCmd = &cobra.Command{ + Use: "version", + Aliases: []string{"v"}, + Short: "Display the Infra build version", + RunE: func(cmd *cobra.Command, args []string) error { + w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight) + fmt.Fprintln(w) + fmt.Fprintln(w, "Client:\t", version.Version) + + client, err := clientFromConfig() + if err != nil { + return err + } + + // Note that we use the client to get this version, but it is in fact the server version + res, err := client.Version(context.Background(), &emptypb.Empty{}) + if err != nil { + fmt.Fprintln(w, blue("✕")+" Could not retrieve registry version") + w.Flush() + return err + } + + fmt.Fprintln(w, "Registry:\t", res.Version) + fmt.Fprintln(w) + w.Flush() + + return nil + }, +} + var credsCmd = &cobra.Command{ Use: "creds", Short: "Generate credentials", @@ -1107,6 +1139,8 @@ func NewRootCmd() (*cobra.Command, error) { rootCmd.AddCommand(registryCmd) rootCmd.AddCommand(newEngineCmd()) + rootCmd.AddCommand(versionCmd) + // Hidden commands rootCmd.AddCommand(credsCmd) rootCmd.AddCommand(clientCmd) diff --git a/internal/cmd/pages/success.html b/internal/cmd/pages/success.html index c3130b4790..c19b990ba5 100644 --- a/internal/cmd/pages/success.html +++ b/internal/cmd/pages/success.html @@ -105,8 +105,7 @@ object, svg, video { - display: block; - vertical-align: middle + display: block } img, diff --git a/internal/registry/grpc.go b/internal/registry/grpc.go index 77e21b696d..e240b334ac 100644 --- a/internal/registry/grpc.go +++ b/internal/registry/grpc.go @@ -10,6 +10,7 @@ import ( "github.com/infrahq/infra/internal/generate" "github.com/infrahq/infra/internal/okta" v1 "github.com/infrahq/infra/internal/v1" + "github.com/infrahq/infra/internal/version" "golang.org/x/crypto/bcrypt" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -649,3 +650,7 @@ func (v *V1Server) Status(ctx context.Context, in *emptypb.Empty) (*v1.StatusRes return &v1.StatusResponse{Admin: count > 0}, nil } + +func (v *V1Server) Version(ctx context.Context, in *emptypb.Empty) (*v1.VersionResponse, error) { + return &v1.VersionResponse{Version: version.Version}, nil +} diff --git a/internal/v1/v1.pb.go b/internal/v1/v1.pb.go index 790106d7e0..7cf8c6237a 100644 --- a/internal/v1/v1.pb.go +++ b/internal/v1/v1.pb.go @@ -1385,6 +1385,53 @@ func (x *StatusResponse) GetAdmin() bool { return false } +type VersionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *VersionResponse) Reset() { + *x = VersionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_v1_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VersionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VersionResponse) ProtoMessage() {} + +func (x *VersionResponse) ProtoReflect() protoreflect.Message { + mi := &file_v1_proto_msgTypes[22] + 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 VersionResponse.ProtoReflect.Descriptor instead. +func (*VersionResponse) Descriptor() ([]byte, []int) { + return file_v1_proto_rawDescGZIP(), []int{22} +} + +func (x *VersionResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type Source_Okta struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1397,7 +1444,7 @@ type Source_Okta struct { func (x *Source_Okta) Reset() { *x = Source_Okta{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[22] + mi := &file_v1_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1410,7 +1457,7 @@ func (x *Source_Okta) String() string { func (*Source_Okta) ProtoMessage() {} func (x *Source_Okta) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[22] + mi := &file_v1_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1454,7 +1501,7 @@ type CreateSourceRequest_Okta struct { func (x *CreateSourceRequest_Okta) Reset() { *x = CreateSourceRequest_Okta{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[23] + mi := &file_v1_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1467,7 +1514,7 @@ func (x *CreateSourceRequest_Okta) String() string { func (*CreateSourceRequest_Okta) ProtoMessage() {} func (x *CreateSourceRequest_Okta) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[23] + mi := &file_v1_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1524,7 +1571,7 @@ type Destination_Kubernetes struct { func (x *Destination_Kubernetes) Reset() { *x = Destination_Kubernetes{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[24] + mi := &file_v1_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1537,7 +1584,7 @@ func (x *Destination_Kubernetes) String() string { func (*Destination_Kubernetes) ProtoMessage() {} func (x *Destination_Kubernetes) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[24] + mi := &file_v1_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1587,7 +1634,7 @@ type CreateDestinationRequest_Kubernetes struct { func (x *CreateDestinationRequest_Kubernetes) Reset() { *x = CreateDestinationRequest_Kubernetes{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[25] + mi := &file_v1_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1600,7 +1647,7 @@ func (x *CreateDestinationRequest_Kubernetes) String() string { func (*CreateDestinationRequest_Kubernetes) ProtoMessage() {} func (x *CreateDestinationRequest_Kubernetes) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[25] + mi := &file_v1_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1649,7 +1696,7 @@ type LoginRequest_Infra struct { func (x *LoginRequest_Infra) Reset() { *x = LoginRequest_Infra{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[26] + mi := &file_v1_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1662,7 +1709,7 @@ func (x *LoginRequest_Infra) String() string { func (*LoginRequest_Infra) ProtoMessage() {} func (x *LoginRequest_Infra) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[26] + mi := &file_v1_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1704,7 +1751,7 @@ type LoginRequest_Okta struct { func (x *LoginRequest_Okta) Reset() { *x = LoginRequest_Okta{} if protoimpl.UnsafeEnabled { - mi := &file_v1_proto_msgTypes[27] + mi := &file_v1_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1717,7 +1764,7 @@ func (x *LoginRequest_Okta) String() string { func (*LoginRequest_Okta) ProtoMessage() {} func (x *LoginRequest_Okta) ProtoReflect() protoreflect.Message { - mi := &file_v1_proto_msgTypes[27] + mi := &file_v1_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1919,73 +1966,79 @@ var file_v1_proto_rawDesc = []byte{ 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x26, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2a, 0x21, 0x0a, 0x0a, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x46, 0x52, 0x41, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x4b, 0x54, 0x41, 0x10, 0x01, 0x2a, 0x21, 0x0a, 0x0f, - 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0e, 0x0a, 0x0a, 0x4b, 0x55, 0x42, 0x45, 0x52, 0x4e, 0x45, 0x54, 0x45, 0x53, 0x10, 0x00, 0x32, - 0xa3, 0x07, 0x0a, 0x02, 0x56, 0x31, 0x12, 0x3a, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x12, 0x14, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x15, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x08, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x15, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, - 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x0f, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0a, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, - 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x17, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, - 0x12, 0x4c, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, - 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, - 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, - 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x2e, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x3a, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x28, 0x08, 0x52, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x22, 0x2b, 0x0a, 0x0f, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x21, 0x0a, 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x10, 0x00, 0x12, + 0x08, 0x0a, 0x04, 0x4f, 0x4b, 0x54, 0x41, 0x10, 0x01, 0x2a, 0x21, 0x0a, 0x0f, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, + 0x4b, 0x55, 0x42, 0x45, 0x52, 0x4e, 0x45, 0x54, 0x45, 0x53, 0x10, 0x00, 0x32, 0xdd, 0x07, 0x0a, + 0x02, 0x56, 0x31, 0x12, 0x3a, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, + 0x12, 0x14, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x2f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x08, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x00, + 0x12, 0x3d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x4a, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x00, 0x12, 0x40, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0c, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x17, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, + 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x06, 0x53, - 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, - 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, - 0x12, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x68, 0x71, 0x2f, 0x69, 0x6e, 0x66, 0x72, - 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x72, 0x65, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0b, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2e, 0x0a, 0x05, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x06, + 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, + 0x75, 0x70, 0x12, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x38, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x68, 0x71, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2001,7 +2054,7 @@ func file_v1_proto_rawDescGZIP() []byte { } var file_v1_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_v1_proto_goTypes = []interface{}{ (SourceType)(0), // 0: v1.SourceType (DestinationType)(0), // 1: v1.DestinationType @@ -2027,65 +2080,68 @@ var file_v1_proto_goTypes = []interface{}{ (*LoginResponse)(nil), // 21: v1.LoginResponse (*SignupRequest)(nil), // 22: v1.SignupRequest (*StatusResponse)(nil), // 23: v1.StatusResponse - (*Source_Okta)(nil), // 24: v1.Source.Okta - (*CreateSourceRequest_Okta)(nil), // 25: v1.CreateSourceRequest.Okta - (*Destination_Kubernetes)(nil), // 26: v1.Destination.Kubernetes - (*CreateDestinationRequest_Kubernetes)(nil), // 27: v1.CreateDestinationRequest.Kubernetes - (*LoginRequest_Infra)(nil), // 28: v1.LoginRequest.Infra - (*LoginRequest_Okta)(nil), // 29: v1.LoginRequest.Okta - (*emptypb.Empty)(nil), // 30: google.protobuf.Empty + (*VersionResponse)(nil), // 24: v1.VersionResponse + (*Source_Okta)(nil), // 25: v1.Source.Okta + (*CreateSourceRequest_Okta)(nil), // 26: v1.CreateSourceRequest.Okta + (*Destination_Kubernetes)(nil), // 27: v1.Destination.Kubernetes + (*CreateDestinationRequest_Kubernetes)(nil), // 28: v1.CreateDestinationRequest.Kubernetes + (*LoginRequest_Infra)(nil), // 29: v1.LoginRequest.Infra + (*LoginRequest_Okta)(nil), // 30: v1.LoginRequest.Okta + (*emptypb.Empty)(nil), // 31: google.protobuf.Empty } var file_v1_proto_depIdxs = []int32{ 2, // 0: v1.ListUsersResponse.users:type_name -> v1.User 0, // 1: v1.Source.type:type_name -> v1.SourceType - 24, // 2: v1.Source.okta:type_name -> v1.Source.Okta + 25, // 2: v1.Source.okta:type_name -> v1.Source.Okta 7, // 3: v1.ListSourcesResponse.sources:type_name -> v1.Source 0, // 4: v1.CreateSourceRequest.type:type_name -> v1.SourceType - 25, // 5: v1.CreateSourceRequest.okta:type_name -> v1.CreateSourceRequest.Okta + 26, // 5: v1.CreateSourceRequest.okta:type_name -> v1.CreateSourceRequest.Okta 1, // 6: v1.Destination.type:type_name -> v1.DestinationType - 26, // 7: v1.Destination.kubernetes:type_name -> v1.Destination.Kubernetes + 27, // 7: v1.Destination.kubernetes:type_name -> v1.Destination.Kubernetes 11, // 8: v1.ListDestinationsResponse.destinations:type_name -> v1.Destination 1, // 9: v1.CreateDestinationRequest.type:type_name -> v1.DestinationType - 27, // 10: v1.CreateDestinationRequest.kubernetes:type_name -> v1.CreateDestinationRequest.Kubernetes + 28, // 10: v1.CreateDestinationRequest.kubernetes:type_name -> v1.CreateDestinationRequest.Kubernetes 2, // 11: v1.Permission.user:type_name -> v1.User 11, // 12: v1.Permission.destination:type_name -> v1.Destination 14, // 13: v1.ListPermissionsResponse.permissions:type_name -> v1.Permission 18, // 14: v1.ListApiKeyResponse.api_keys:type_name -> v1.ApiKey 0, // 15: v1.LoginRequest.type:type_name -> v1.SourceType - 28, // 16: v1.LoginRequest.infra:type_name -> v1.LoginRequest.Infra - 29, // 17: v1.LoginRequest.okta:type_name -> v1.LoginRequest.Okta + 29, // 16: v1.LoginRequest.infra:type_name -> v1.LoginRequest.Infra + 30, // 17: v1.LoginRequest.okta:type_name -> v1.LoginRequest.Okta 3, // 18: v1.V1.ListUsers:input_type -> v1.ListUsersRequest 5, // 19: v1.V1.CreateUser:input_type -> v1.CreateUserRequest 6, // 20: v1.V1.DeleteUser:input_type -> v1.DeleteUserRequest - 30, // 21: v1.V1.ListDestinations:input_type -> google.protobuf.Empty + 31, // 21: v1.V1.ListDestinations:input_type -> google.protobuf.Empty 13, // 22: v1.V1.CreateDestination:input_type -> v1.CreateDestinationRequest - 30, // 23: v1.V1.ListSources:input_type -> google.protobuf.Empty + 31, // 23: v1.V1.ListSources:input_type -> google.protobuf.Empty 9, // 24: v1.V1.CreateSource:input_type -> v1.CreateSourceRequest 10, // 25: v1.V1.DeleteSource:input_type -> v1.DeleteSourceRequest 15, // 26: v1.V1.ListPermissions:input_type -> v1.ListPermissionsRequest - 30, // 27: v1.V1.CreateCred:input_type -> google.protobuf.Empty - 30, // 28: v1.V1.ListApiKeys:input_type -> google.protobuf.Empty + 31, // 27: v1.V1.CreateCred:input_type -> google.protobuf.Empty + 31, // 28: v1.V1.ListApiKeys:input_type -> google.protobuf.Empty 20, // 29: v1.V1.Login:input_type -> v1.LoginRequest - 30, // 30: v1.V1.Logout:input_type -> google.protobuf.Empty + 31, // 30: v1.V1.Logout:input_type -> google.protobuf.Empty 22, // 31: v1.V1.Signup:input_type -> v1.SignupRequest - 30, // 32: v1.V1.Status:input_type -> google.protobuf.Empty - 4, // 33: v1.V1.ListUsers:output_type -> v1.ListUsersResponse - 2, // 34: v1.V1.CreateUser:output_type -> v1.User - 30, // 35: v1.V1.DeleteUser:output_type -> google.protobuf.Empty - 12, // 36: v1.V1.ListDestinations:output_type -> v1.ListDestinationsResponse - 11, // 37: v1.V1.CreateDestination:output_type -> v1.Destination - 8, // 38: v1.V1.ListSources:output_type -> v1.ListSourcesResponse - 7, // 39: v1.V1.CreateSource:output_type -> v1.Source - 30, // 40: v1.V1.DeleteSource:output_type -> google.protobuf.Empty - 16, // 41: v1.V1.ListPermissions:output_type -> v1.ListPermissionsResponse - 17, // 42: v1.V1.CreateCred:output_type -> v1.CreateCredResponse - 19, // 43: v1.V1.ListApiKeys:output_type -> v1.ListApiKeyResponse - 21, // 44: v1.V1.Login:output_type -> v1.LoginResponse - 30, // 45: v1.V1.Logout:output_type -> google.protobuf.Empty - 21, // 46: v1.V1.Signup:output_type -> v1.LoginResponse - 23, // 47: v1.V1.Status:output_type -> v1.StatusResponse - 33, // [33:48] is the sub-list for method output_type - 18, // [18:33] is the sub-list for method input_type + 31, // 32: v1.V1.Status:input_type -> google.protobuf.Empty + 31, // 33: v1.V1.Version:input_type -> google.protobuf.Empty + 4, // 34: v1.V1.ListUsers:output_type -> v1.ListUsersResponse + 2, // 35: v1.V1.CreateUser:output_type -> v1.User + 31, // 36: v1.V1.DeleteUser:output_type -> google.protobuf.Empty + 12, // 37: v1.V1.ListDestinations:output_type -> v1.ListDestinationsResponse + 11, // 38: v1.V1.CreateDestination:output_type -> v1.Destination + 8, // 39: v1.V1.ListSources:output_type -> v1.ListSourcesResponse + 7, // 40: v1.V1.CreateSource:output_type -> v1.Source + 31, // 41: v1.V1.DeleteSource:output_type -> google.protobuf.Empty + 16, // 42: v1.V1.ListPermissions:output_type -> v1.ListPermissionsResponse + 17, // 43: v1.V1.CreateCred:output_type -> v1.CreateCredResponse + 19, // 44: v1.V1.ListApiKeys:output_type -> v1.ListApiKeyResponse + 21, // 45: v1.V1.Login:output_type -> v1.LoginResponse + 31, // 46: v1.V1.Logout:output_type -> google.protobuf.Empty + 21, // 47: v1.V1.Signup:output_type -> v1.LoginResponse + 23, // 48: v1.V1.Status:output_type -> v1.StatusResponse + 24, // 49: v1.V1.Version:output_type -> v1.VersionResponse + 34, // [34:50] is the sub-list for method output_type + 18, // [18:34] is the sub-list for method input_type 18, // [18:18] is the sub-list for extension type_name 18, // [18:18] is the sub-list for extension extendee 0, // [0:18] is the sub-list for field type_name @@ -2362,7 +2418,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Source_Okta); i { + switch v := v.(*VersionResponse); i { case 0: return &v.state case 1: @@ -2374,7 +2430,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSourceRequest_Okta); i { + switch v := v.(*Source_Okta); i { case 0: return &v.state case 1: @@ -2386,7 +2442,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Destination_Kubernetes); i { + switch v := v.(*CreateSourceRequest_Okta); i { case 0: return &v.state case 1: @@ -2398,7 +2454,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDestinationRequest_Kubernetes); i { + switch v := v.(*Destination_Kubernetes); i { case 0: return &v.state case 1: @@ -2410,7 +2466,7 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginRequest_Infra); i { + switch v := v.(*CreateDestinationRequest_Kubernetes); i { case 0: return &v.state case 1: @@ -2422,6 +2478,18 @@ func file_v1_proto_init() { } } file_v1_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest_Infra); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_v1_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginRequest_Okta); i { case 0: return &v.state @@ -2440,7 +2508,7 @@ func file_v1_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_v1_proto_rawDesc, NumEnums: 2, - NumMessages: 28, + NumMessages: 29, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/v1/v1.pb.validate.go b/internal/v1/v1.pb.validate.go index c7894908ab..e16c02d714 100644 --- a/internal/v1/v1.pb.validate.go +++ b/internal/v1/v1.pb.validate.go @@ -1913,6 +1913,73 @@ var _ interface { ErrorName() string } = StatusResponseValidationError{} +// Validate checks the field values on VersionResponse with the rules defined +// in the proto definition for this message. If any rules are violated, an +// error is returned. +func (m *VersionResponse) Validate() error { + if m == nil { + return nil + } + + // no validation rules for Version + + return nil +} + +// VersionResponseValidationError is the validation error returned by +// VersionResponse.Validate if the designated constraints aren't met. +type VersionResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VersionResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VersionResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VersionResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VersionResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VersionResponseValidationError) ErrorName() string { return "VersionResponseValidationError" } + +// Error satisfies the builtin error interface +func (e VersionResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sVersionResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VersionResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VersionResponseValidationError{} + // Validate checks the field values on Source_Okta with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned. diff --git a/internal/v1/v1.proto b/internal/v1/v1.proto index 5af3728126..8a2b425147 100644 --- a/internal/v1/v1.proto +++ b/internal/v1/v1.proto @@ -23,6 +23,7 @@ service V1 { rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) {} rpc Signup(SignupRequest) returns (LoginResponse) {} rpc Status(google.protobuf.Empty) returns (StatusResponse) {} + rpc Version(google.protobuf.Empty) returns (VersionResponse) {} } enum SourceType { @@ -195,3 +196,7 @@ message SignupRequest { message StatusResponse { bool admin = 1; } + +message VersionResponse { + string version = 1; +} diff --git a/internal/v1/v1_grpc.pb.go b/internal/v1/v1_grpc.pb.go index df82df5040..0039fa8153 100644 --- a/internal/v1/v1_grpc.pb.go +++ b/internal/v1/v1_grpc.pb.go @@ -34,6 +34,7 @@ type V1Client interface { Logout(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) Signup(ctx context.Context, in *SignupRequest, opts ...grpc.CallOption) (*LoginResponse, error) Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*StatusResponse, error) + Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error) } type v1Client struct { @@ -179,6 +180,15 @@ func (c *v1Client) Status(ctx context.Context, in *emptypb.Empty, opts ...grpc.C return out, nil } +func (c *v1Client) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error) { + out := new(VersionResponse) + err := c.cc.Invoke(ctx, "/v1.V1/Version", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // V1Server is the server API for V1 service. // All implementations must embed UnimplementedV1Server // for forward compatibility @@ -198,6 +208,7 @@ type V1Server interface { Logout(context.Context, *emptypb.Empty) (*emptypb.Empty, error) Signup(context.Context, *SignupRequest) (*LoginResponse, error) Status(context.Context, *emptypb.Empty) (*StatusResponse, error) + Version(context.Context, *emptypb.Empty) (*VersionResponse, error) mustEmbedUnimplementedV1Server() } @@ -250,6 +261,9 @@ func (UnimplementedV1Server) Signup(context.Context, *SignupRequest) (*LoginResp func (UnimplementedV1Server) Status(context.Context, *emptypb.Empty) (*StatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } +func (UnimplementedV1Server) Version(context.Context, *emptypb.Empty) (*VersionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") +} func (UnimplementedV1Server) mustEmbedUnimplementedV1Server() {} // UnsafeV1Server may be embedded to opt out of forward compatibility for this service. @@ -533,6 +547,24 @@ func _V1_Status_Handler(srv interface{}, ctx context.Context, dec func(interface return interceptor(ctx, in, info, handler) } +func _V1_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(V1Server).Version(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/v1.V1/Version", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(V1Server).Version(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + // V1_ServiceDesc is the grpc.ServiceDesc for V1 service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -600,6 +632,10 @@ var V1_ServiceDesc = grpc.ServiceDesc{ MethodName: "Status", Handler: _V1_Status_Handler, }, + { + MethodName: "Version", + Handler: _V1_Version_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1.proto", diff --git a/internal/version/version.go b/internal/version/version.go new file mode 100644 index 0000000000..b93b842a06 --- /dev/null +++ b/internal/version/version.go @@ -0,0 +1,5 @@ +package version + +// Version is set on build +// Release build version is the git tag (set in the .goreleaser ldflags and the Dockerfile BUILDVERSION arg) +var Version = "development"