From f9feb97f84315a1444142ee3115cd814036230b8 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 9 Feb 2024 21:42:36 +0000 Subject: [PATCH 01/27] frontend hacking --- .../CreateWorkspacePageView.stories.tsx | 27 +++++++++++++++++++ .../CreateWorkspacePageView.tsx | 4 +-- .../ExternalAuthItem.stories.tsx | 2 +- .../ExternalAuthItem.test.tsx | 0 .../ExternalAuthItem.tsx | 4 +++ .../ExternalAuthWall.stories.tsx} | 10 +++---- .../ExternalAuthWall.tsx} | 12 ++++----- 7 files changed, 45 insertions(+), 14 deletions(-) rename site/src/pages/CreateWorkspacePage/{ExternalAuthBanner => ExternalAuthWall}/ExternalAuthItem.stories.tsx (93%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthBanner => ExternalAuthWall}/ExternalAuthItem.test.tsx (100%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthBanner => ExternalAuthWall}/ExternalAuthItem.tsx (94%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthBanner/ExternalAuthBanner.stories.tsx => ExternalAuthWall/ExternalAuthWall.stories.tsx} (70%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthBanner/ExternalAuthBanner.tsx => ExternalAuthWall/ExternalAuthWall.tsx} (84%) diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx index 5662f96338ef6..5a0586701c5e6 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx @@ -130,3 +130,30 @@ export const RequiresExternalAuth: Story = { ], }, }; + +export const OptionalExternalAuth: Story = { + args: { + externalAuth: [ + { + id: "github", + type: "github", + authenticated: false, + authenticate_url: "", + display_icon: "/icon/github.svg", + display_name: "GitHub", + // @ts-expect-error + optional: true, + }, + { + id: "gitlab", + type: "gitlab", + authenticated: true, + authenticate_url: "", + display_icon: "/icon/gitlab.svg", + display_name: "GitLab", + // @ts-expect-error + optional: true, + }, + ], + }, +}; diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx index 1d2cdcf660a4f..a1e3b25fea54c 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx @@ -42,7 +42,7 @@ import { CreateWorkspaceMode, ExternalAuthPollingState, } from "./CreateWorkspacePage"; -import { ExternalAuthBanner } from "./ExternalAuthBanner/ExternalAuthBanner"; +import { ExternalAuthWall } from "./ExternalAuthWall/ExternalAuthWall"; import { CreateWSPermissions } from "./permissions"; export const Language = { @@ -172,7 +172,7 @@ export const CreateWorkspacePageView: FC = ({ {requiresExternalAuth ? ( - = { - title: "pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem", + title: "pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem", component: ExternalAuthItem, decorators: [ (Story) => ( diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.test.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.test.tsx similarity index 100% rename from site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.test.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.test.tsx diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx similarity index 94% rename from site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx index 45d5e6057875e..da369122c7bc0 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx @@ -6,6 +6,7 @@ import { ExternalImage } from "components/ExternalImage/ExternalImage"; import { FC, useEffect, useState } from "react"; // eslint-disable-next-line no-restricted-imports -- used to allow extension with "component" import Box, { BoxProps } from "@mui/material/Box"; +import { Pill } from "components/Pill/Pill"; type Status = "idle" | "connecting"; @@ -36,6 +37,9 @@ export const ExternalAuthItem: FC = ({ {provider.display_name} + {!provider.authenticated && (provider as any).optional && ( + Optional + )} {provider.authenticated ? ( diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.stories.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.stories.tsx similarity index 70% rename from site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.stories.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.stories.tsx index 2d9c4e9c45359..8b09afe07694f 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.stories.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.stories.tsx @@ -1,5 +1,5 @@ import { TemplateVersionExternalAuth } from "api/typesGenerated"; -import { ExternalAuthBanner } from "./ExternalAuthBanner"; +import { ExternalAuthWall } from "./ExternalAuthWall"; import type { Meta, StoryObj } from "@storybook/react"; const MockExternalAuth: TemplateVersionExternalAuth = { @@ -11,13 +11,13 @@ const MockExternalAuth: TemplateVersionExternalAuth = { authenticated: false, }; -const meta: Meta = { - title: "pages/CreateWorkspacePage/ExternalAuthBanner", - component: ExternalAuthBanner, +const meta: Meta = { + title: "pages/CreateWorkspacePage/ExternalAuthWall", + component: ExternalAuthWall, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx similarity index 84% rename from site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx index ee8e4b47f546d..9152afbeac50f 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx @@ -1,16 +1,16 @@ -import { Interpolation, Theme } from "@emotion/react"; -import { TemplateVersionExternalAuth } from "api/typesGenerated"; -import { ExternalAuthPollingState } from "../CreateWorkspacePage"; +import { type Interpolation, type Theme } from "@emotion/react"; +import { type FC } from "react"; +import { type TemplateVersionExternalAuth } from "api/typesGenerated"; +import { type ExternalAuthPollingState } from "../CreateWorkspacePage"; import { ExternalAuthItem } from "./ExternalAuthItem"; -import { FC } from "react"; -type ExternalAuthBannerProps = { +type ExternalAuthWallProps = { providers: TemplateVersionExternalAuth[]; pollingState: ExternalAuthPollingState; onStartPolling: () => void; }; -export const ExternalAuthBanner: FC = ({ +export const ExternalAuthWall: FC = ({ providers, pollingState, onStartPolling, From 179adae6a5c65d7ebdae073c43cd478265ec7469 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 9 Feb 2024 22:00:08 +0000 Subject: [PATCH 02/27] pipe through all of the protobuf stuff --- coderd/apidoc/docs.go | 3 + coderd/apidoc/swagger.json | 3 + .../provisionerdserver/provisionerdserver.go | 12 +- codersdk/templateversions.go | 1 + docs/api/schemas.md | 2 + docs/api/templates.md | 2 + enterprise/coderd/provisionerdaemons.go | 10 + provisioner/terraform/resources.go | 18 +- provisionerd/proto/provisionerd.pb.go | 305 ++--- provisionerd/proto/provisionerd.proto | 3 +- provisionerd/proto/version.go | 12 + provisionerd/runner/runner.go | 2 +- provisionersdk/proto/provisioner.pb.go | 1016 +++++++++-------- provisionersdk/proto/provisioner.proto | 9 +- site/e2e/provisionerGenerated.ts | 34 +- site/src/api/typesGenerated.ts | 1 + 16 files changed, 805 insertions(+), 628 deletions(-) create mode 100644 provisionerd/proto/version.go diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 0ca1742a585ce..a9704ca69b349 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -11470,6 +11470,9 @@ const docTemplate = `{ "id": { "type": "string" }, + "optional": { + "type": "boolean" + }, "type": { "type": "string" } diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 3523b478f0d1b..f9c40209e43b9 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -10387,6 +10387,9 @@ "id": { "type": "string" }, + "optional": { + "type": "boolean" + }, "type": { "type": "string" } diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index a6f7676e85726..55d6add894a4b 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -1133,7 +1133,7 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) for _, externalAuthProvider := range jobType.TemplateImport.ExternalAuthProviders { contains := false for _, configuredProvider := range s.ExternalAuthConfigs { - if configuredProvider.ID == externalAuthProvider { + if configuredProvider.ID == externalAuthProvider.Id { contains = true break } @@ -1147,9 +1147,17 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) } } + externalAuthProviderIds := jobType.TemplateImport.ExternalAuthProvidersNames + if providersLen := len(jobType.TemplateImport.ExternalAuthProviders); providersLen > 0 { + externalAuthProviderIds = make([]string, 0, providersLen) + for _, provider := range jobType.TemplateImport.ExternalAuthProviders { + externalAuthProviderIds = append(externalAuthProviderIds, provider.Id) + } + } + err = s.Database.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ JobID: jobID, - ExternalAuthProviders: jobType.TemplateImport.ExternalAuthProviders, + ExternalAuthProviders: externalAuthProviderIds, UpdatedAt: dbtime.Now(), }) if err != nil { diff --git a/codersdk/templateversions.go b/codersdk/templateversions.go index 4263fbaf06975..f14b673d91af9 100644 --- a/codersdk/templateversions.go +++ b/codersdk/templateversions.go @@ -41,6 +41,7 @@ type TemplateVersionExternalAuth struct { DisplayIcon string `json:"display_icon"` AuthenticateURL string `json:"authenticate_url"` Authenticated bool `json:"authenticated"` + Optional bool `json:"optional"` } type ValidationMonotonicOrder string diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 04b3a1ce6dad6..330f4fcbae4dd 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -5169,6 +5169,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in "display_icon": "string", "display_name": "string", "id": "string", + "optional": true, "type": "string" } ``` @@ -5182,6 +5183,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in | `display_icon` | string | false | | | | `display_name` | string | false | | | | `id` | string | false | | | +| `optional` | boolean | false | | | | `type` | string | false | | | ## codersdk.TemplateVersionParameter diff --git a/docs/api/templates.md b/docs/api/templates.md index 1ea355164af32..1599d593afb10 100644 --- a/docs/api/templates.md +++ b/docs/api/templates.md @@ -1986,6 +1986,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/e "display_icon": "string", "display_name": "string", "id": "string", + "optional": true, "type": "string" } ] @@ -2009,6 +2010,7 @@ Status Code **200** | `» display_icon` | string | false | | | | `» display_name` | string | false | | | | `» id` | string | false | | | +| `» optional` | boolean | false | | | | `» type` | string | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/enterprise/coderd/provisionerdaemons.go b/enterprise/coderd/provisionerdaemons.go index f81f17befdb8d..1dfd72bc87ad3 100644 --- a/enterprise/coderd/provisionerdaemons.go +++ b/enterprise/coderd/provisionerdaemons.go @@ -239,6 +239,16 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request) apiVersion = qv } + if err := proto.CurrentVersion.Validate(apiVersion); err != nil { + httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ + Message: "Incompatible or unparseable version", + Validations: []codersdk.ValidationError{ + {Field: "version", Detail: err.Error()}, + }, + }) + return + } + // Create the daemon in the database. now := dbtime.Now() daemon, err := api.Database.UpsertProvisionerDaemon(authCtx, database.UpsertProvisionerDaemonParams{ diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index b14d86bcbded4..53e1d94d69159 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -123,7 +123,7 @@ type resourceMetadataItem struct { type State struct { Resources []*proto.Resource Parameters []*proto.RichParameter - ExternalAuthProviders []string + ExternalAuthProviders []*proto.ExternalAuthProviderResource } // ConvertState consumes Terraform state and a GraphViz representation @@ -695,7 +695,7 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error } // A map is used to ensure we don't have duplicates! - externalAuthProvidersMap := map[string]struct{}{} + externalAuthProvidersMap := map[string]*proto.ExternalAuthProviderResource{} for _, tfResources := range tfResourcesByLabel { for _, resource := range tfResources { // Checking for `coder_git_auth` is legacy! @@ -706,12 +706,18 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error if !ok { return nil, xerrors.Errorf("external auth id is not a string") } - externalAuthProvidersMap[id] = struct{}{} + + optional := false + optionalAttribute, ok := resource.AttributeValues["optional"].(bool) + if ok { + optional = optionalAttribute + } + externalAuthProvidersMap[id] = &proto.ExternalAuthProviderResource{Optional: optional} } } - externalAuthProviders := make([]string, 0, len(externalAuthProvidersMap)) - for id := range externalAuthProvidersMap { - externalAuthProviders = append(externalAuthProviders, id) + externalAuthProviders := make([]*proto.ExternalAuthProviderResource, 0, len(externalAuthProvidersMap)) + for _, provider := range externalAuthProvidersMap { + externalAuthProviders = append(externalAuthProviders, provider) } return &State{ diff --git a/provisionerd/proto/provisionerd.pb.go b/provisionerd/proto/provisionerd.pb.go index 451d301e9c38d..b9b89d05dbbcf 100644 --- a/provisionerd/proto/provisionerd.pb.go +++ b/provisionerd/proto/provisionerd.pb.go @@ -1251,10 +1251,11 @@ type CompletedJob_TemplateImport struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StartResources []*proto.Resource `protobuf:"bytes,1,rep,name=start_resources,json=startResources,proto3" json:"start_resources,omitempty"` - StopResources []*proto.Resource `protobuf:"bytes,2,rep,name=stop_resources,json=stopResources,proto3" json:"stop_resources,omitempty"` - RichParameters []*proto.RichParameter `protobuf:"bytes,3,rep,name=rich_parameters,json=richParameters,proto3" json:"rich_parameters,omitempty"` - ExternalAuthProviders []string `protobuf:"bytes,4,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` + StartResources []*proto.Resource `protobuf:"bytes,1,rep,name=start_resources,json=startResources,proto3" json:"start_resources,omitempty"` + StopResources []*proto.Resource `protobuf:"bytes,2,rep,name=stop_resources,json=stopResources,proto3" json:"stop_resources,omitempty"` + RichParameters []*proto.RichParameter `protobuf:"bytes,3,rep,name=rich_parameters,json=richParameters,proto3" json:"rich_parameters,omitempty"` + ExternalAuthProvidersNames []string `protobuf:"bytes,4,rep,name=external_auth_providers_names,json=externalAuthProvidersNames,proto3" json:"external_auth_providers_names,omitempty"` + ExternalAuthProviders []*proto.ExternalAuthProviderResource `protobuf:"bytes,5,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` } func (x *CompletedJob_TemplateImport) Reset() { @@ -1310,7 +1311,14 @@ func (x *CompletedJob_TemplateImport) GetRichParameters() []*proto.RichParameter return nil } -func (x *CompletedJob_TemplateImport) GetExternalAuthProviders() []string { +func (x *CompletedJob_TemplateImport) GetExternalAuthProvidersNames() []string { + if x != nil { + return x.ExternalAuthProvidersNames + } + return nil +} + +func (x *CompletedJob_TemplateImport) GetExternalAuthProviders() []*proto.ExternalAuthProviderResource { if x != nil { return x.ExternalAuthProviders } @@ -1489,7 +1497,7 @@ var file_provisionerd_proto_provisionerd_proto_rawDesc = []byte{ 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x10, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x10, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x44, - 0x72, 0x79, 0x52, 0x75, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xe2, 0x05, + 0x72, 0x79, 0x52, 0x75, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd0, 0x06, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x54, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, @@ -1514,7 +1522,7 @@ var file_provisionerd_proto_provisionerd_proto_rawDesc = []byte{ 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x8b, 0x02, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0xf9, 0x02, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3e, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, @@ -1527,99 +1535,106 @@ var file_provisionerd_proto_provisionerd_proto_rawDesc = []byte{ 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0e, 0x72, 0x69, 0x63, - 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x65, + 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x1d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x65, 0x78, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x1a, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x61, + 0x0a, 0x17, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x73, 0x1a, 0x45, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x44, - 0x72, 0x79, 0x52, 0x75, 0x6e, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x22, 0xb0, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, - 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x8a, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, - 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x4c, - 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x4c, 0x0a, 0x12, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, - 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x14, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, - 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x12, 0x75, 0x73, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x03, - 0x10, 0x04, 0x22, 0x7a, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x65, 0x64, 0x12, 0x43, 0x0a, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x4a, - 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, - 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x09, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x13, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, - 0x6b, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6e, - 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x72, 0x65, - 0x64, 0x69, 0x74, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, - 0x64, 0x67, 0x65, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x63, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x2a, 0x34, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, - 0x52, 0x5f, 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, - 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x32, 0xc5, 0x03, 0x0a, 0x11, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x12, 0x41, 0x0a, 0x0a, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x4a, 0x6f, 0x62, 0x12, - 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x64, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x22, - 0x03, 0x88, 0x02, 0x01, 0x12, 0x52, 0x0a, 0x14, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x4a, - 0x6f, 0x62, 0x57, 0x69, 0x74, 0x68, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1b, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x4a, 0x6f, 0x62, 0x28, 0x01, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x15, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x73, 0x1a, 0x45, 0x0a, 0x0e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x72, 0x79, + 0x52, 0x75, 0x6e, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0xb0, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x22, 0x8a, 0x02, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, + 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x4c, 0x6f, 0x67, + 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x4c, 0x0a, 0x12, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x52, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x14, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x72, + 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x12, + 0x75, 0x73, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, + 0x22, 0x7a, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, + 0x64, 0x12, 0x43, 0x0a, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x4a, 0x0a, 0x12, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6a, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6a, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x69, + 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, + 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x12, + 0x29, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, + 0x6d, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x64, 0x69, + 0x74, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, + 0x64, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, + 0x65, 0x74, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x63, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x2a, 0x34, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x16, 0x0a, 0x12, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x52, 0x5f, + 0x44, 0x41, 0x45, 0x4d, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x4f, 0x56, + 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x32, 0xc5, 0x03, 0x0a, 0x11, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, + 0x41, 0x0a, 0x0a, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x13, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x64, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x22, 0x03, 0x88, + 0x02, 0x01, 0x12, 0x52, 0x0a, 0x14, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x4a, 0x6f, 0x62, + 0x57, 0x69, 0x74, 0x68, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x41, 0x63, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x4a, + 0x6f, 0x62, 0x28, 0x01, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x51, 0x75, 0x6f, 0x74, 0x61, 0x12, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, 0x6f, - 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, - 0x75, 0x6f, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, - 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, - 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x46, 0x61, - 0x69, 0x6c, 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x1a, 0x13, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x4a, - 0x6f, 0x62, 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, - 0x64, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x1a, 0x13, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x32, - 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4a, 0x6f, 0x62, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x46, 0x61, 0x69, 0x6c, + 0x4a, 0x6f, 0x62, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, + 0x72, 0x64, 0x2e, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x1a, 0x13, 0x2e, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x3e, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x4a, 0x6f, 0x62, + 0x12, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x1a, 0x13, 0x2e, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x32, 0x2f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1637,35 +1652,36 @@ func file_provisionerd_proto_provisionerd_proto_rawDescGZIP() []byte { var file_provisionerd_proto_provisionerd_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_provisionerd_proto_provisionerd_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_provisionerd_proto_provisionerd_proto_goTypes = []interface{}{ - (LogSource)(0), // 0: provisionerd.LogSource - (*Empty)(nil), // 1: provisionerd.Empty - (*AcquiredJob)(nil), // 2: provisionerd.AcquiredJob - (*FailedJob)(nil), // 3: provisionerd.FailedJob - (*CompletedJob)(nil), // 4: provisionerd.CompletedJob - (*Log)(nil), // 5: provisionerd.Log - (*UpdateJobRequest)(nil), // 6: provisionerd.UpdateJobRequest - (*UpdateJobResponse)(nil), // 7: provisionerd.UpdateJobResponse - (*CommitQuotaRequest)(nil), // 8: provisionerd.CommitQuotaRequest - (*CommitQuotaResponse)(nil), // 9: provisionerd.CommitQuotaResponse - (*CancelAcquire)(nil), // 10: provisionerd.CancelAcquire - (*AcquiredJob_WorkspaceBuild)(nil), // 11: provisionerd.AcquiredJob.WorkspaceBuild - (*AcquiredJob_TemplateImport)(nil), // 12: provisionerd.AcquiredJob.TemplateImport - (*AcquiredJob_TemplateDryRun)(nil), // 13: provisionerd.AcquiredJob.TemplateDryRun - nil, // 14: provisionerd.AcquiredJob.TraceMetadataEntry - (*FailedJob_WorkspaceBuild)(nil), // 15: provisionerd.FailedJob.WorkspaceBuild - (*FailedJob_TemplateImport)(nil), // 16: provisionerd.FailedJob.TemplateImport - (*FailedJob_TemplateDryRun)(nil), // 17: provisionerd.FailedJob.TemplateDryRun - (*CompletedJob_WorkspaceBuild)(nil), // 18: provisionerd.CompletedJob.WorkspaceBuild - (*CompletedJob_TemplateImport)(nil), // 19: provisionerd.CompletedJob.TemplateImport - (*CompletedJob_TemplateDryRun)(nil), // 20: provisionerd.CompletedJob.TemplateDryRun - (proto.LogLevel)(0), // 21: provisioner.LogLevel - (*proto.TemplateVariable)(nil), // 22: provisioner.TemplateVariable - (*proto.VariableValue)(nil), // 23: provisioner.VariableValue - (*proto.RichParameterValue)(nil), // 24: provisioner.RichParameterValue - (*proto.ExternalAuthProvider)(nil), // 25: provisioner.ExternalAuthProvider - (*proto.Metadata)(nil), // 26: provisioner.Metadata - (*proto.Resource)(nil), // 27: provisioner.Resource - (*proto.RichParameter)(nil), // 28: provisioner.RichParameter + (LogSource)(0), // 0: provisionerd.LogSource + (*Empty)(nil), // 1: provisionerd.Empty + (*AcquiredJob)(nil), // 2: provisionerd.AcquiredJob + (*FailedJob)(nil), // 3: provisionerd.FailedJob + (*CompletedJob)(nil), // 4: provisionerd.CompletedJob + (*Log)(nil), // 5: provisionerd.Log + (*UpdateJobRequest)(nil), // 6: provisionerd.UpdateJobRequest + (*UpdateJobResponse)(nil), // 7: provisionerd.UpdateJobResponse + (*CommitQuotaRequest)(nil), // 8: provisionerd.CommitQuotaRequest + (*CommitQuotaResponse)(nil), // 9: provisionerd.CommitQuotaResponse + (*CancelAcquire)(nil), // 10: provisionerd.CancelAcquire + (*AcquiredJob_WorkspaceBuild)(nil), // 11: provisionerd.AcquiredJob.WorkspaceBuild + (*AcquiredJob_TemplateImport)(nil), // 12: provisionerd.AcquiredJob.TemplateImport + (*AcquiredJob_TemplateDryRun)(nil), // 13: provisionerd.AcquiredJob.TemplateDryRun + nil, // 14: provisionerd.AcquiredJob.TraceMetadataEntry + (*FailedJob_WorkspaceBuild)(nil), // 15: provisionerd.FailedJob.WorkspaceBuild + (*FailedJob_TemplateImport)(nil), // 16: provisionerd.FailedJob.TemplateImport + (*FailedJob_TemplateDryRun)(nil), // 17: provisionerd.FailedJob.TemplateDryRun + (*CompletedJob_WorkspaceBuild)(nil), // 18: provisionerd.CompletedJob.WorkspaceBuild + (*CompletedJob_TemplateImport)(nil), // 19: provisionerd.CompletedJob.TemplateImport + (*CompletedJob_TemplateDryRun)(nil), // 20: provisionerd.CompletedJob.TemplateDryRun + (proto.LogLevel)(0), // 21: provisioner.LogLevel + (*proto.TemplateVariable)(nil), // 22: provisioner.TemplateVariable + (*proto.VariableValue)(nil), // 23: provisioner.VariableValue + (*proto.RichParameterValue)(nil), // 24: provisioner.RichParameterValue + (*proto.ExternalAuthProvider)(nil), // 25: provisioner.ExternalAuthProvider + (*proto.Metadata)(nil), // 26: provisioner.Metadata + (*proto.Resource)(nil), // 27: provisioner.Resource + (*proto.RichParameter)(nil), // 28: provisioner.RichParameter + (*proto.ExternalAuthProviderResource)(nil), // 29: provisioner.ExternalAuthProviderResource } var file_provisionerd_proto_provisionerd_proto_depIdxs = []int32{ 11, // 0: provisionerd.AcquiredJob.workspace_build:type_name -> provisionerd.AcquiredJob.WorkspaceBuild @@ -1697,24 +1713,25 @@ var file_provisionerd_proto_provisionerd_proto_depIdxs = []int32{ 27, // 26: provisionerd.CompletedJob.TemplateImport.start_resources:type_name -> provisioner.Resource 27, // 27: provisionerd.CompletedJob.TemplateImport.stop_resources:type_name -> provisioner.Resource 28, // 28: provisionerd.CompletedJob.TemplateImport.rich_parameters:type_name -> provisioner.RichParameter - 27, // 29: provisionerd.CompletedJob.TemplateDryRun.resources:type_name -> provisioner.Resource - 1, // 30: provisionerd.ProvisionerDaemon.AcquireJob:input_type -> provisionerd.Empty - 10, // 31: provisionerd.ProvisionerDaemon.AcquireJobWithCancel:input_type -> provisionerd.CancelAcquire - 8, // 32: provisionerd.ProvisionerDaemon.CommitQuota:input_type -> provisionerd.CommitQuotaRequest - 6, // 33: provisionerd.ProvisionerDaemon.UpdateJob:input_type -> provisionerd.UpdateJobRequest - 3, // 34: provisionerd.ProvisionerDaemon.FailJob:input_type -> provisionerd.FailedJob - 4, // 35: provisionerd.ProvisionerDaemon.CompleteJob:input_type -> provisionerd.CompletedJob - 2, // 36: provisionerd.ProvisionerDaemon.AcquireJob:output_type -> provisionerd.AcquiredJob - 2, // 37: provisionerd.ProvisionerDaemon.AcquireJobWithCancel:output_type -> provisionerd.AcquiredJob - 9, // 38: provisionerd.ProvisionerDaemon.CommitQuota:output_type -> provisionerd.CommitQuotaResponse - 7, // 39: provisionerd.ProvisionerDaemon.UpdateJob:output_type -> provisionerd.UpdateJobResponse - 1, // 40: provisionerd.ProvisionerDaemon.FailJob:output_type -> provisionerd.Empty - 1, // 41: provisionerd.ProvisionerDaemon.CompleteJob:output_type -> provisionerd.Empty - 36, // [36:42] is the sub-list for method output_type - 30, // [30:36] is the sub-list for method input_type - 30, // [30:30] is the sub-list for extension type_name - 30, // [30:30] is the sub-list for extension extendee - 0, // [0:30] is the sub-list for field type_name + 29, // 29: provisionerd.CompletedJob.TemplateImport.external_auth_providers:type_name -> provisioner.ExternalAuthProviderResource + 27, // 30: provisionerd.CompletedJob.TemplateDryRun.resources:type_name -> provisioner.Resource + 1, // 31: provisionerd.ProvisionerDaemon.AcquireJob:input_type -> provisionerd.Empty + 10, // 32: provisionerd.ProvisionerDaemon.AcquireJobWithCancel:input_type -> provisionerd.CancelAcquire + 8, // 33: provisionerd.ProvisionerDaemon.CommitQuota:input_type -> provisionerd.CommitQuotaRequest + 6, // 34: provisionerd.ProvisionerDaemon.UpdateJob:input_type -> provisionerd.UpdateJobRequest + 3, // 35: provisionerd.ProvisionerDaemon.FailJob:input_type -> provisionerd.FailedJob + 4, // 36: provisionerd.ProvisionerDaemon.CompleteJob:input_type -> provisionerd.CompletedJob + 2, // 37: provisionerd.ProvisionerDaemon.AcquireJob:output_type -> provisionerd.AcquiredJob + 2, // 38: provisionerd.ProvisionerDaemon.AcquireJobWithCancel:output_type -> provisionerd.AcquiredJob + 9, // 39: provisionerd.ProvisionerDaemon.CommitQuota:output_type -> provisionerd.CommitQuotaResponse + 7, // 40: provisionerd.ProvisionerDaemon.UpdateJob:output_type -> provisionerd.UpdateJobResponse + 1, // 41: provisionerd.ProvisionerDaemon.FailJob:output_type -> provisionerd.Empty + 1, // 42: provisionerd.ProvisionerDaemon.CompleteJob:output_type -> provisionerd.Empty + 37, // [37:43] is the sub-list for method output_type + 31, // [31:37] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_provisionerd_proto_provisionerd_proto_init() } diff --git a/provisionerd/proto/provisionerd.proto b/provisionerd/proto/provisionerd.proto index 705c0ffbed258..61b3f588b2843 100644 --- a/provisionerd/proto/provisionerd.proto +++ b/provisionerd/proto/provisionerd.proto @@ -77,7 +77,8 @@ message CompletedJob { repeated provisioner.Resource start_resources = 1; repeated provisioner.Resource stop_resources = 2; repeated provisioner.RichParameter rich_parameters = 3; - repeated string external_auth_providers = 4; + repeated string external_auth_providers_names = 4; + repeated provisioner.ExternalAuthProviderResource external_auth_providers = 5; } message TemplateDryRun { repeated provisioner.Resource resources = 1; diff --git a/provisionerd/proto/version.go b/provisionerd/proto/version.go new file mode 100644 index 0000000000000..62d0274071312 --- /dev/null +++ b/provisionerd/proto/version.go @@ -0,0 +1,12 @@ +package proto + +import ( + "github.com/coder/coder/v2/coderd/util/apiversion" +) + +const ( + CurrentMajor = 1 + CurrentMinor = 1 +) + +var CurrentVersion = apiversion.New(CurrentMajor, CurrentMinor) diff --git a/provisionerd/runner/runner.go b/provisionerd/runner/runner.go index 2783335ed19c7..3159df9055a21 100644 --- a/provisionerd/runner/runner.go +++ b/provisionerd/runner/runner.go @@ -629,7 +629,7 @@ func (r *Runner) runTemplateImportParse(ctx context.Context) ( type templateImportProvision struct { Resources []*sdkproto.Resource Parameters []*sdkproto.RichParameter - ExternalAuthProviders []string + ExternalAuthProviders []*sdkproto.ExternalAuthProviderResource } // Performs a dry-run provision when importing a template. diff --git a/provisionersdk/proto/provisioner.pb.go b/provisionersdk/proto/provisioner.pb.go index f6ef7148a60dd..3994cc2ef9ad0 100644 --- a/provisionersdk/proto/provisioner.pb.go +++ b/provisionersdk/proto/provisioner.pb.go @@ -766,6 +766,61 @@ func (x *InstanceIdentityAuth) GetInstanceId() string { return "" } +type ExternalAuthProviderResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Optional bool `protobuf:"varint,2,opt,name=optional,proto3" json:"optional,omitempty"` +} + +func (x *ExternalAuthProviderResource) Reset() { + *x = ExternalAuthProviderResource{} + if protoimpl.UnsafeEnabled { + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExternalAuthProviderResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExternalAuthProviderResource) ProtoMessage() {} + +func (x *ExternalAuthProviderResource) ProtoReflect() protoreflect.Message { + mi := &file_provisionersdk_proto_provisioner_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 ExternalAuthProviderResource.ProtoReflect.Descriptor instead. +func (*ExternalAuthProviderResource) Descriptor() ([]byte, []int) { + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{8} +} + +func (x *ExternalAuthProviderResource) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ExternalAuthProviderResource) GetOptional() bool { + if x != nil { + return x.Optional + } + return false +} + type ExternalAuthProvider struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -778,7 +833,7 @@ type ExternalAuthProvider struct { func (x *ExternalAuthProvider) Reset() { *x = ExternalAuthProvider{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[8] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -791,7 +846,7 @@ func (x *ExternalAuthProvider) String() string { func (*ExternalAuthProvider) ProtoMessage() {} func (x *ExternalAuthProvider) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[8] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -804,7 +859,7 @@ func (x *ExternalAuthProvider) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalAuthProvider.ProtoReflect.Descriptor instead. func (*ExternalAuthProvider) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{8} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{9} } func (x *ExternalAuthProvider) GetId() string { @@ -855,7 +910,7 @@ type Agent struct { func (x *Agent) Reset() { *x = Agent{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[9] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -868,7 +923,7 @@ func (x *Agent) String() string { func (*Agent) ProtoMessage() {} func (x *Agent) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[9] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -881,7 +936,7 @@ func (x *Agent) ProtoReflect() protoreflect.Message { // Deprecated: Use Agent.ProtoReflect.Descriptor instead. func (*Agent) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{9} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{10} } func (x *Agent) GetId() string { @@ -1034,7 +1089,7 @@ type DisplayApps struct { func (x *DisplayApps) Reset() { *x = DisplayApps{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[10] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1047,7 +1102,7 @@ func (x *DisplayApps) String() string { func (*DisplayApps) ProtoMessage() {} func (x *DisplayApps) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[10] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,7 +1115,7 @@ func (x *DisplayApps) ProtoReflect() protoreflect.Message { // Deprecated: Use DisplayApps.ProtoReflect.Descriptor instead. func (*DisplayApps) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{10} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{11} } func (x *DisplayApps) GetVscode() bool { @@ -1110,7 +1165,7 @@ type Env struct { func (x *Env) Reset() { *x = Env{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[11] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1123,7 +1178,7 @@ func (x *Env) String() string { func (*Env) ProtoMessage() {} func (x *Env) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[11] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1136,7 +1191,7 @@ func (x *Env) ProtoReflect() protoreflect.Message { // Deprecated: Use Env.ProtoReflect.Descriptor instead. func (*Env) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{11} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{12} } func (x *Env) GetName() string { @@ -1173,7 +1228,7 @@ type Script struct { func (x *Script) Reset() { *x = Script{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[12] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1186,7 +1241,7 @@ func (x *Script) String() string { func (*Script) ProtoMessage() {} func (x *Script) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[12] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1199,7 +1254,7 @@ func (x *Script) ProtoReflect() protoreflect.Message { // Deprecated: Use Script.ProtoReflect.Descriptor instead. func (*Script) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{12} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{13} } func (x *Script) GetDisplayName() string { @@ -1287,7 +1342,7 @@ type App struct { func (x *App) Reset() { *x = App{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[13] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1300,7 +1355,7 @@ func (x *App) String() string { func (*App) ProtoMessage() {} func (x *App) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[13] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1313,7 +1368,7 @@ func (x *App) ProtoReflect() protoreflect.Message { // Deprecated: Use App.ProtoReflect.Descriptor instead. func (*App) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{13} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{14} } func (x *App) GetSlug() string { @@ -1393,7 +1448,7 @@ type Healthcheck struct { func (x *Healthcheck) Reset() { *x = Healthcheck{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[14] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1406,7 +1461,7 @@ func (x *Healthcheck) String() string { func (*Healthcheck) ProtoMessage() {} func (x *Healthcheck) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[14] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1419,7 +1474,7 @@ func (x *Healthcheck) ProtoReflect() protoreflect.Message { // Deprecated: Use Healthcheck.ProtoReflect.Descriptor instead. func (*Healthcheck) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{14} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{15} } func (x *Healthcheck) GetUrl() string { @@ -1462,7 +1517,7 @@ type Resource struct { func (x *Resource) Reset() { *x = Resource{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[15] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1475,7 +1530,7 @@ func (x *Resource) String() string { func (*Resource) ProtoMessage() {} func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[15] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1488,7 +1543,7 @@ func (x *Resource) ProtoReflect() protoreflect.Message { // Deprecated: Use Resource.ProtoReflect.Descriptor instead. func (*Resource) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{15} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{16} } func (x *Resource) GetName() string { @@ -1571,7 +1626,7 @@ type Metadata struct { func (x *Metadata) Reset() { *x = Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[16] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1584,7 +1639,7 @@ func (x *Metadata) String() string { func (*Metadata) ProtoMessage() {} func (x *Metadata) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[16] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1597,7 +1652,7 @@ func (x *Metadata) ProtoReflect() protoreflect.Message { // Deprecated: Use Metadata.ProtoReflect.Descriptor instead. func (*Metadata) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{16} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{17} } func (x *Metadata) GetCoderUrl() string { @@ -1707,7 +1762,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[17] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1720,7 +1775,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[17] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1733,7 +1788,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{17} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{18} } func (x *Config) GetTemplateSourceArchive() []byte { @@ -1767,7 +1822,7 @@ type ParseRequest struct { func (x *ParseRequest) Reset() { *x = ParseRequest{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[18] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1780,7 +1835,7 @@ func (x *ParseRequest) String() string { func (*ParseRequest) ProtoMessage() {} func (x *ParseRequest) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[18] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1793,7 +1848,7 @@ func (x *ParseRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseRequest.ProtoReflect.Descriptor instead. func (*ParseRequest) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{18} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{19} } // ParseComplete indicates a request to parse completed. @@ -1810,7 +1865,7 @@ type ParseComplete struct { func (x *ParseComplete) Reset() { *x = ParseComplete{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[19] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1823,7 +1878,7 @@ func (x *ParseComplete) String() string { func (*ParseComplete) ProtoMessage() {} func (x *ParseComplete) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[19] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1836,7 +1891,7 @@ func (x *ParseComplete) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseComplete.ProtoReflect.Descriptor instead. func (*ParseComplete) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{19} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{20} } func (x *ParseComplete) GetError() string { @@ -1875,7 +1930,7 @@ type PlanRequest struct { func (x *PlanRequest) Reset() { *x = PlanRequest{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[20] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1888,7 +1943,7 @@ func (x *PlanRequest) String() string { func (*PlanRequest) ProtoMessage() {} func (x *PlanRequest) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[20] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1901,7 +1956,7 @@ func (x *PlanRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PlanRequest.ProtoReflect.Descriptor instead. func (*PlanRequest) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{20} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{21} } func (x *PlanRequest) GetMetadata() *Metadata { @@ -1938,16 +1993,16 @@ type PlanComplete struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` - Parameters []*RichParameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` - ExternalAuthProviders []string `protobuf:"bytes,4,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` + Parameters []*RichParameter `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` + ExternalAuthProviders []*ExternalAuthProviderResource `protobuf:"bytes,4,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` } func (x *PlanComplete) Reset() { *x = PlanComplete{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[21] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1960,7 +2015,7 @@ func (x *PlanComplete) String() string { func (*PlanComplete) ProtoMessage() {} func (x *PlanComplete) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[21] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1973,7 +2028,7 @@ func (x *PlanComplete) ProtoReflect() protoreflect.Message { // Deprecated: Use PlanComplete.ProtoReflect.Descriptor instead. func (*PlanComplete) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{21} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{22} } func (x *PlanComplete) GetError() string { @@ -1997,7 +2052,7 @@ func (x *PlanComplete) GetParameters() []*RichParameter { return nil } -func (x *PlanComplete) GetExternalAuthProviders() []string { +func (x *PlanComplete) GetExternalAuthProviders() []*ExternalAuthProviderResource { if x != nil { return x.ExternalAuthProviders } @@ -2017,7 +2072,7 @@ type ApplyRequest struct { func (x *ApplyRequest) Reset() { *x = ApplyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[22] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2030,7 +2085,7 @@ func (x *ApplyRequest) String() string { func (*ApplyRequest) ProtoMessage() {} func (x *ApplyRequest) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[22] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2043,7 +2098,7 @@ func (x *ApplyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyRequest.ProtoReflect.Descriptor instead. func (*ApplyRequest) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{22} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{23} } func (x *ApplyRequest) GetMetadata() *Metadata { @@ -2059,17 +2114,17 @@ type ApplyComplete struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - State []byte `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - Resources []*Resource `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` - Parameters []*RichParameter `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"` - ExternalAuthProviders []string `protobuf:"bytes,5,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` + State []byte `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + Resources []*Resource `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` + Parameters []*RichParameter `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"` + ExternalAuthProviders []*ExternalAuthProviderResource `protobuf:"bytes,5,rep,name=external_auth_providers,json=externalAuthProviders,proto3" json:"external_auth_providers,omitempty"` } func (x *ApplyComplete) Reset() { *x = ApplyComplete{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[23] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2082,7 +2137,7 @@ func (x *ApplyComplete) String() string { func (*ApplyComplete) ProtoMessage() {} func (x *ApplyComplete) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[23] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2095,7 +2150,7 @@ func (x *ApplyComplete) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplyComplete.ProtoReflect.Descriptor instead. func (*ApplyComplete) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{23} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{24} } func (x *ApplyComplete) GetState() []byte { @@ -2126,7 +2181,7 @@ func (x *ApplyComplete) GetParameters() []*RichParameter { return nil } -func (x *ApplyComplete) GetExternalAuthProviders() []string { +func (x *ApplyComplete) GetExternalAuthProviders() []*ExternalAuthProviderResource { if x != nil { return x.ExternalAuthProviders } @@ -2143,7 +2198,7 @@ type CancelRequest struct { func (x *CancelRequest) Reset() { *x = CancelRequest{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[24] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2156,7 +2211,7 @@ func (x *CancelRequest) String() string { func (*CancelRequest) ProtoMessage() {} func (x *CancelRequest) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[24] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2169,7 +2224,7 @@ func (x *CancelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead. func (*CancelRequest) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{24} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{25} } type Request struct { @@ -2190,7 +2245,7 @@ type Request struct { func (x *Request) Reset() { *x = Request{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[25] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2203,7 +2258,7 @@ func (x *Request) String() string { func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[25] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2216,7 +2271,7 @@ func (x *Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Request.ProtoReflect.Descriptor instead. func (*Request) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{25} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{26} } func (m *Request) GetType() isRequest_Type { @@ -2312,7 +2367,7 @@ type Response struct { func (x *Response) Reset() { *x = Response{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[26] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2325,7 +2380,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[26] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2338,7 +2393,7 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{26} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{27} } func (m *Response) GetType() isResponse_Type { @@ -2420,7 +2475,7 @@ type Agent_Metadata struct { func (x *Agent_Metadata) Reset() { *x = Agent_Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[27] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2433,7 +2488,7 @@ func (x *Agent_Metadata) String() string { func (*Agent_Metadata) ProtoMessage() {} func (x *Agent_Metadata) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[27] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2446,7 +2501,7 @@ func (x *Agent_Metadata) ProtoReflect() protoreflect.Message { // Deprecated: Use Agent_Metadata.ProtoReflect.Descriptor instead. func (*Agent_Metadata) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{9, 0} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{10, 0} } func (x *Agent_Metadata) GetKey() string { @@ -2505,7 +2560,7 @@ type Resource_Metadata struct { func (x *Resource_Metadata) Reset() { *x = Resource_Metadata{} if protoimpl.UnsafeEnabled { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[29] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2518,7 +2573,7 @@ func (x *Resource_Metadata) String() string { func (*Resource_Metadata) ProtoMessage() {} func (x *Resource_Metadata) ProtoReflect() protoreflect.Message { - mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[29] + mi := &file_provisionersdk_proto_provisioner_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2531,7 +2586,7 @@ func (x *Resource_Metadata) ProtoReflect() protoreflect.Message { // Deprecated: Use Resource_Metadata.ProtoReflect.Descriptor instead. func (*Resource_Metadata) Descriptor() ([]byte, []int) { - return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{15, 0} + return file_provisionersdk_proto_provisioner_proto_rawDescGZIP(), []int{16, 0} } func (x *Resource_Metadata) GetKey() string { @@ -2646,311 +2701,321 @@ var file_provisionersdk_proto_provisioner_proto_rawDesc = []byte{ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x75, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x49, 0x64, 0x22, 0x49, 0x0a, 0x14, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, - 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x07, - 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 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, 0x2d, 0x0a, 0x03, 0x65, - 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x76, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, - 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, - 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, - 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x52, 0x04, 0x61, 0x70, 0x70, 0x73, 0x12, 0x16, 0x0a, - 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x74, 0x72, 0x6f, 0x75, 0x62, 0x6c, - 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x12, 0x74, 0x72, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x68, 0x6f, 0x6f, - 0x74, 0x69, 0x6e, 0x67, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x74, 0x64, 0x5f, - 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x74, 0x64, - 0x46, 0x69, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, - 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x14, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x72, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x52, 0x0b, 0x64, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x52, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x0a, 0x65, 0x78, 0x74, - 0x72, 0x61, 0x5f, 0x65, 0x6e, 0x76, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x76, 0x52, - 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x45, 0x6e, 0x76, 0x73, 0x1a, 0xa3, 0x01, 0x0a, 0x08, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x1a, 0x36, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, - 0x4a, 0x04, 0x08, 0x0e, 0x10, 0x0f, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x65, - 0x66, 0x6f, 0x72, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22, 0xc6, 0x01, 0x0a, 0x0b, 0x44, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x73, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x73, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x73, - 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x76, 0x73, 0x63, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x77, - 0x65, 0x62, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x77, 0x65, 0x62, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x73, 0x68, 0x5f, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x73, 0x73, 0x68, 0x48, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x12, 0x34, 0x0a, - 0x16, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, - 0x5f, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, - 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x6c, - 0x70, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9f, 0x02, 0x0a, 0x06, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x72, - 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x12, 0x20, 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x5f, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x4f, 0x6e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x6f, - 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4f, 0x6e, 0x53, 0x74, - 0x6f, 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, - 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, - 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x22, 0xb5, 0x02, 0x0a, 0x03, 0x41, 0x70, 0x70, 0x12, 0x12, - 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, - 0x75, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x75, 0x62, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, - 0x41, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x22, 0x59, - 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, - 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xf1, 0x02, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, - 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x64, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x68, 0x69, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, - 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x23, - 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, - 0x73, 0x74, 0x1a, 0x69, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, - 0x74, 0x69, 0x76, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x81, 0x05, - 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, - 0x64, 0x65, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, - 0x6f, 0x64, 0x65, 0x72, 0x55, 0x72, 0x6c, 0x12, 0x53, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x2c, 0x0a, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, - 0x15, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, - 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x48, 0x0a, 0x21, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x69, 0x64, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1d, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x4f, 0x69, 0x64, 0x63, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x41, 0x0a, 0x1d, 0x77, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x1a, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, - 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, - 0x30, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x17, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x72, 0x63, - 0x68, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x0e, - 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8b, - 0x01, 0x0a, 0x0d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x4c, 0x0a, 0x12, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, - 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x11, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x22, 0xb5, 0x02, 0x0a, - 0x0b, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x53, 0x0a, 0x15, 0x72, 0x69, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, - 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x13, 0x72, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x76, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x17, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x15, 0x65, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x73, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x17, - 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x65, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x73, 0x22, 0x41, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe4, 0x01, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x6c, - 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, - 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0x0f, - 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x8c, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x0a, 0x05, 0x70, 0x61, - 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x12, 0x2e, 0x0a, - 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x31, 0x0a, - 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, - 0x12, 0x34, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x43, - 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd1, - 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x03, 0x6c, - 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x6f, - 0x67, 0x12, 0x32, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, - 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, 0x52, 0x05, - 0x70, 0x61, 0x72, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, - 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, - 0x65, 0x48, 0x00, 0x52, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x2a, 0x3f, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, - 0x0a, 0x05, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, - 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x08, - 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x10, 0x04, 0x2a, 0x3b, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, - 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x02, - 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, 0x32, 0x49, 0x0a, 0x0b, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, - 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x28, 0x01, 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x76, - 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x6b, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x1c, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, + 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x49, + 0x0a, 0x14, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x07, 0x0a, 0x05, 0x41, 0x67, + 0x65, 0x6e, 0x74, 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, 0x2d, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x76, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, + 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x04, 0x61, 0x70, 0x70, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, + 0x41, 0x70, 0x70, 0x52, 0x04, 0x61, 0x70, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x3c, 0x0a, 0x1a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x18, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x74, 0x72, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x68, 0x6f, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x74, 0x72, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x73, 0x68, 0x6f, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x6f, 0x74, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6f, 0x74, 0x64, 0x46, 0x69, 0x6c, 0x65, + 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x12, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0c, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x44, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x73, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x52, 0x07, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x65, + 0x6e, 0x76, 0x73, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x09, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x45, 0x6e, 0x76, 0x73, 0x1a, 0xa3, 0x01, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x1a, 0x36, 0x0a, 0x08, + 0x45, 0x6e, 0x76, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x61, 0x75, 0x74, 0x68, 0x4a, 0x04, 0x08, 0x0e, + 0x10, 0x0f, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22, 0xc6, 0x01, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x41, 0x70, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x27, + 0x0a, 0x0f, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x76, 0x73, 0x63, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x65, 0x62, 0x5f, 0x74, + 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, + 0x65, 0x62, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x73, + 0x68, 0x5f, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x73, 0x73, 0x68, 0x48, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x6f, 0x72, + 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x6c, + 0x70, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, 0x6f, 0x72, 0x74, 0x46, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x22, + 0x2f, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x9f, 0x02, 0x0a, 0x06, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x72, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x12, 0x2c, + 0x0a, 0x12, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x6c, + 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0c, + 0x72, 0x75, 0x6e, 0x5f, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1e, + 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x5f, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x75, 0x6e, 0x4f, 0x6e, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x27, + 0x0a, 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x50, 0x61, + 0x74, 0x68, 0x22, 0xb5, 0x02, 0x0a, 0x03, 0x41, 0x70, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, + 0x75, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, + 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, + 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, + 0x3a, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x0b, + 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x41, 0x0a, 0x0d, 0x73, + 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x22, 0x59, 0x0a, 0x0b, 0x48, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, + 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0xf1, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x06, + 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x68, 0x69, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1d, 0x0a, 0x0a, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x73, 0x74, 0x1a, 0x69, + 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x81, 0x05, 0x0a, 0x08, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x72, + 0x55, 0x72, 0x6c, 0x12, 0x53, 0x0a, 0x14, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x27, 0x0a, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x77, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x23, 0x0a, + 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, + 0x21, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x6f, 0x69, 0x64, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x4f, 0x69, 0x64, 0x63, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x41, 0x0a, 0x1d, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, + 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x01, + 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x17, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x74, 0x65, 0x6d, 0x70, 0x6c, + 0x61, 0x74, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x61, + 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x0d, 0x50, + 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x4c, 0x0a, 0x12, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x11, 0x74, + 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x6d, 0x65, 0x22, 0xb5, 0x02, 0x0a, 0x0b, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x53, 0x0a, 0x15, 0x72, + 0x69, 0x63, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x72, 0x69, 0x63, + 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x12, 0x43, 0x0a, 0x0f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x17, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, + 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, + 0x22, 0xf8, 0x01, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, + 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x61, 0x0a, 0x17, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, + 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0x41, 0x0a, 0x0c, 0x41, + 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x8f, + 0x02, 0x0a, 0x0d, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x69, 0x63, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x61, 0x0a, + 0x17, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x45, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x15, 0x65, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, + 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x8c, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x0a, 0x05, + 0x70, 0x61, 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x12, + 0x2e, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, + 0x31, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, + 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x05, 0x61, 0x70, 0x70, + 0x6c, 0x79, 0x12, 0x34, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0xd1, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, + 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x48, 0x00, 0x52, 0x03, + 0x6c, 0x6f, 0x67, 0x12, 0x32, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, + 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x48, 0x00, + 0x52, 0x05, 0x70, 0x61, 0x72, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x48, 0x00, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x12, 0x32, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x6c, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x48, 0x00, 0x52, 0x05, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x42, 0x06, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x2a, 0x3f, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x09, 0x0a, 0x05, 0x54, 0x52, 0x41, 0x43, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, + 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, + 0x12, 0x08, 0x0a, 0x04, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x10, 0x04, 0x2a, 0x3b, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x53, 0x68, 0x61, 0x72, + 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, + 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, + 0x10, 0x02, 0x2a, 0x37, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, + 0x52, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x10, 0x02, 0x32, 0x49, 0x0a, 0x0b, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x72, + 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x73, + 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2966,82 +3031,85 @@ func file_provisionersdk_proto_provisioner_proto_rawDescGZIP() []byte { } var file_provisionersdk_proto_provisioner_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_provisionersdk_proto_provisioner_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_provisionersdk_proto_provisioner_proto_msgTypes = make([]protoimpl.MessageInfo, 31) var file_provisionersdk_proto_provisioner_proto_goTypes = []interface{}{ - (LogLevel)(0), // 0: provisioner.LogLevel - (AppSharingLevel)(0), // 1: provisioner.AppSharingLevel - (WorkspaceTransition)(0), // 2: provisioner.WorkspaceTransition - (*Empty)(nil), // 3: provisioner.Empty - (*TemplateVariable)(nil), // 4: provisioner.TemplateVariable - (*RichParameterOption)(nil), // 5: provisioner.RichParameterOption - (*RichParameter)(nil), // 6: provisioner.RichParameter - (*RichParameterValue)(nil), // 7: provisioner.RichParameterValue - (*VariableValue)(nil), // 8: provisioner.VariableValue - (*Log)(nil), // 9: provisioner.Log - (*InstanceIdentityAuth)(nil), // 10: provisioner.InstanceIdentityAuth - (*ExternalAuthProvider)(nil), // 11: provisioner.ExternalAuthProvider - (*Agent)(nil), // 12: provisioner.Agent - (*DisplayApps)(nil), // 13: provisioner.DisplayApps - (*Env)(nil), // 14: provisioner.Env - (*Script)(nil), // 15: provisioner.Script - (*App)(nil), // 16: provisioner.App - (*Healthcheck)(nil), // 17: provisioner.Healthcheck - (*Resource)(nil), // 18: provisioner.Resource - (*Metadata)(nil), // 19: provisioner.Metadata - (*Config)(nil), // 20: provisioner.Config - (*ParseRequest)(nil), // 21: provisioner.ParseRequest - (*ParseComplete)(nil), // 22: provisioner.ParseComplete - (*PlanRequest)(nil), // 23: provisioner.PlanRequest - (*PlanComplete)(nil), // 24: provisioner.PlanComplete - (*ApplyRequest)(nil), // 25: provisioner.ApplyRequest - (*ApplyComplete)(nil), // 26: provisioner.ApplyComplete - (*CancelRequest)(nil), // 27: provisioner.CancelRequest - (*Request)(nil), // 28: provisioner.Request - (*Response)(nil), // 29: provisioner.Response - (*Agent_Metadata)(nil), // 30: provisioner.Agent.Metadata - nil, // 31: provisioner.Agent.EnvEntry - (*Resource_Metadata)(nil), // 32: provisioner.Resource.Metadata + (LogLevel)(0), // 0: provisioner.LogLevel + (AppSharingLevel)(0), // 1: provisioner.AppSharingLevel + (WorkspaceTransition)(0), // 2: provisioner.WorkspaceTransition + (*Empty)(nil), // 3: provisioner.Empty + (*TemplateVariable)(nil), // 4: provisioner.TemplateVariable + (*RichParameterOption)(nil), // 5: provisioner.RichParameterOption + (*RichParameter)(nil), // 6: provisioner.RichParameter + (*RichParameterValue)(nil), // 7: provisioner.RichParameterValue + (*VariableValue)(nil), // 8: provisioner.VariableValue + (*Log)(nil), // 9: provisioner.Log + (*InstanceIdentityAuth)(nil), // 10: provisioner.InstanceIdentityAuth + (*ExternalAuthProviderResource)(nil), // 11: provisioner.ExternalAuthProviderResource + (*ExternalAuthProvider)(nil), // 12: provisioner.ExternalAuthProvider + (*Agent)(nil), // 13: provisioner.Agent + (*DisplayApps)(nil), // 14: provisioner.DisplayApps + (*Env)(nil), // 15: provisioner.Env + (*Script)(nil), // 16: provisioner.Script + (*App)(nil), // 17: provisioner.App + (*Healthcheck)(nil), // 18: provisioner.Healthcheck + (*Resource)(nil), // 19: provisioner.Resource + (*Metadata)(nil), // 20: provisioner.Metadata + (*Config)(nil), // 21: provisioner.Config + (*ParseRequest)(nil), // 22: provisioner.ParseRequest + (*ParseComplete)(nil), // 23: provisioner.ParseComplete + (*PlanRequest)(nil), // 24: provisioner.PlanRequest + (*PlanComplete)(nil), // 25: provisioner.PlanComplete + (*ApplyRequest)(nil), // 26: provisioner.ApplyRequest + (*ApplyComplete)(nil), // 27: provisioner.ApplyComplete + (*CancelRequest)(nil), // 28: provisioner.CancelRequest + (*Request)(nil), // 29: provisioner.Request + (*Response)(nil), // 30: provisioner.Response + (*Agent_Metadata)(nil), // 31: provisioner.Agent.Metadata + nil, // 32: provisioner.Agent.EnvEntry + (*Resource_Metadata)(nil), // 33: provisioner.Resource.Metadata } var file_provisionersdk_proto_provisioner_proto_depIdxs = []int32{ 5, // 0: provisioner.RichParameter.options:type_name -> provisioner.RichParameterOption 0, // 1: provisioner.Log.level:type_name -> provisioner.LogLevel - 31, // 2: provisioner.Agent.env:type_name -> provisioner.Agent.EnvEntry - 16, // 3: provisioner.Agent.apps:type_name -> provisioner.App - 30, // 4: provisioner.Agent.metadata:type_name -> provisioner.Agent.Metadata - 13, // 5: provisioner.Agent.display_apps:type_name -> provisioner.DisplayApps - 15, // 6: provisioner.Agent.scripts:type_name -> provisioner.Script - 14, // 7: provisioner.Agent.extra_envs:type_name -> provisioner.Env - 17, // 8: provisioner.App.healthcheck:type_name -> provisioner.Healthcheck + 32, // 2: provisioner.Agent.env:type_name -> provisioner.Agent.EnvEntry + 17, // 3: provisioner.Agent.apps:type_name -> provisioner.App + 31, // 4: provisioner.Agent.metadata:type_name -> provisioner.Agent.Metadata + 14, // 5: provisioner.Agent.display_apps:type_name -> provisioner.DisplayApps + 16, // 6: provisioner.Agent.scripts:type_name -> provisioner.Script + 15, // 7: provisioner.Agent.extra_envs:type_name -> provisioner.Env + 18, // 8: provisioner.App.healthcheck:type_name -> provisioner.Healthcheck 1, // 9: provisioner.App.sharing_level:type_name -> provisioner.AppSharingLevel - 12, // 10: provisioner.Resource.agents:type_name -> provisioner.Agent - 32, // 11: provisioner.Resource.metadata:type_name -> provisioner.Resource.Metadata + 13, // 10: provisioner.Resource.agents:type_name -> provisioner.Agent + 33, // 11: provisioner.Resource.metadata:type_name -> provisioner.Resource.Metadata 2, // 12: provisioner.Metadata.workspace_transition:type_name -> provisioner.WorkspaceTransition 4, // 13: provisioner.ParseComplete.template_variables:type_name -> provisioner.TemplateVariable - 19, // 14: provisioner.PlanRequest.metadata:type_name -> provisioner.Metadata + 20, // 14: provisioner.PlanRequest.metadata:type_name -> provisioner.Metadata 7, // 15: provisioner.PlanRequest.rich_parameter_values:type_name -> provisioner.RichParameterValue 8, // 16: provisioner.PlanRequest.variable_values:type_name -> provisioner.VariableValue - 11, // 17: provisioner.PlanRequest.external_auth_providers:type_name -> provisioner.ExternalAuthProvider - 18, // 18: provisioner.PlanComplete.resources:type_name -> provisioner.Resource + 12, // 17: provisioner.PlanRequest.external_auth_providers:type_name -> provisioner.ExternalAuthProvider + 19, // 18: provisioner.PlanComplete.resources:type_name -> provisioner.Resource 6, // 19: provisioner.PlanComplete.parameters:type_name -> provisioner.RichParameter - 19, // 20: provisioner.ApplyRequest.metadata:type_name -> provisioner.Metadata - 18, // 21: provisioner.ApplyComplete.resources:type_name -> provisioner.Resource - 6, // 22: provisioner.ApplyComplete.parameters:type_name -> provisioner.RichParameter - 20, // 23: provisioner.Request.config:type_name -> provisioner.Config - 21, // 24: provisioner.Request.parse:type_name -> provisioner.ParseRequest - 23, // 25: provisioner.Request.plan:type_name -> provisioner.PlanRequest - 25, // 26: provisioner.Request.apply:type_name -> provisioner.ApplyRequest - 27, // 27: provisioner.Request.cancel:type_name -> provisioner.CancelRequest - 9, // 28: provisioner.Response.log:type_name -> provisioner.Log - 22, // 29: provisioner.Response.parse:type_name -> provisioner.ParseComplete - 24, // 30: provisioner.Response.plan:type_name -> provisioner.PlanComplete - 26, // 31: provisioner.Response.apply:type_name -> provisioner.ApplyComplete - 28, // 32: provisioner.Provisioner.Session:input_type -> provisioner.Request - 29, // 33: provisioner.Provisioner.Session:output_type -> provisioner.Response - 33, // [33:34] is the sub-list for method output_type - 32, // [32:33] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 11, // 20: provisioner.PlanComplete.external_auth_providers:type_name -> provisioner.ExternalAuthProviderResource + 20, // 21: provisioner.ApplyRequest.metadata:type_name -> provisioner.Metadata + 19, // 22: provisioner.ApplyComplete.resources:type_name -> provisioner.Resource + 6, // 23: provisioner.ApplyComplete.parameters:type_name -> provisioner.RichParameter + 11, // 24: provisioner.ApplyComplete.external_auth_providers:type_name -> provisioner.ExternalAuthProviderResource + 21, // 25: provisioner.Request.config:type_name -> provisioner.Config + 22, // 26: provisioner.Request.parse:type_name -> provisioner.ParseRequest + 24, // 27: provisioner.Request.plan:type_name -> provisioner.PlanRequest + 26, // 28: provisioner.Request.apply:type_name -> provisioner.ApplyRequest + 28, // 29: provisioner.Request.cancel:type_name -> provisioner.CancelRequest + 9, // 30: provisioner.Response.log:type_name -> provisioner.Log + 23, // 31: provisioner.Response.parse:type_name -> provisioner.ParseComplete + 25, // 32: provisioner.Response.plan:type_name -> provisioner.PlanComplete + 27, // 33: provisioner.Response.apply:type_name -> provisioner.ApplyComplete + 29, // 34: provisioner.Provisioner.Session:input_type -> provisioner.Request + 30, // 35: provisioner.Provisioner.Session:output_type -> provisioner.Response + 35, // [35:36] is the sub-list for method output_type + 34, // [34:35] is the sub-list for method input_type + 34, // [34:34] is the sub-list for extension type_name + 34, // [34:34] is the sub-list for extension extendee + 0, // [0:34] is the sub-list for field type_name } func init() { file_provisionersdk_proto_provisioner_proto_init() } @@ -3147,7 +3215,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalAuthProvider); i { + switch v := v.(*ExternalAuthProviderResource); i { case 0: return &v.state case 1: @@ -3159,7 +3227,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Agent); i { + switch v := v.(*ExternalAuthProvider); i { case 0: return &v.state case 1: @@ -3171,7 +3239,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayApps); i { + switch v := v.(*Agent); i { case 0: return &v.state case 1: @@ -3183,7 +3251,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Env); i { + switch v := v.(*DisplayApps); i { case 0: return &v.state case 1: @@ -3195,7 +3263,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Script); i { + switch v := v.(*Env); i { case 0: return &v.state case 1: @@ -3207,7 +3275,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*App); i { + switch v := v.(*Script); i { case 0: return &v.state case 1: @@ -3219,7 +3287,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Healthcheck); i { + switch v := v.(*App); i { case 0: return &v.state case 1: @@ -3231,7 +3299,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resource); i { + switch v := v.(*Healthcheck); i { case 0: return &v.state case 1: @@ -3243,7 +3311,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Metadata); i { + switch v := v.(*Resource); i { case 0: return &v.state case 1: @@ -3255,7 +3323,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { + switch v := v.(*Metadata); i { case 0: return &v.state case 1: @@ -3267,7 +3335,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseRequest); i { + switch v := v.(*Config); i { case 0: return &v.state case 1: @@ -3279,7 +3347,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseComplete); i { + switch v := v.(*ParseRequest); i { case 0: return &v.state case 1: @@ -3291,7 +3359,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlanRequest); i { + switch v := v.(*ParseComplete); i { case 0: return &v.state case 1: @@ -3303,7 +3371,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlanComplete); i { + switch v := v.(*PlanRequest); i { case 0: return &v.state case 1: @@ -3315,7 +3383,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyRequest); i { + switch v := v.(*PlanComplete); i { case 0: return &v.state case 1: @@ -3327,7 +3395,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplyComplete); i { + switch v := v.(*ApplyRequest); i { case 0: return &v.state case 1: @@ -3339,7 +3407,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CancelRequest); i { + switch v := v.(*ApplyComplete); i { case 0: return &v.state case 1: @@ -3351,7 +3419,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); i { + switch v := v.(*CancelRequest); i { case 0: return &v.state case 1: @@ -3363,7 +3431,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { + switch v := v.(*Request); i { case 0: return &v.state case 1: @@ -3375,6 +3443,18 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_provisionersdk_proto_provisioner_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Agent_Metadata); i { case 0: return &v.state @@ -3386,7 +3466,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { return nil } } - file_provisionersdk_proto_provisioner_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_provisionersdk_proto_provisioner_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Resource_Metadata); i { case 0: return &v.state @@ -3400,18 +3480,18 @@ func file_provisionersdk_proto_provisioner_proto_init() { } } file_provisionersdk_proto_provisioner_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_provisionersdk_proto_provisioner_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_provisionersdk_proto_provisioner_proto_msgTypes[10].OneofWrappers = []interface{}{ (*Agent_Token)(nil), (*Agent_InstanceId)(nil), } - file_provisionersdk_proto_provisioner_proto_msgTypes[25].OneofWrappers = []interface{}{ + file_provisionersdk_proto_provisioner_proto_msgTypes[26].OneofWrappers = []interface{}{ (*Request_Config)(nil), (*Request_Parse)(nil), (*Request_Plan)(nil), (*Request_Apply)(nil), (*Request_Cancel)(nil), } - file_provisionersdk_proto_provisioner_proto_msgTypes[26].OneofWrappers = []interface{}{ + file_provisionersdk_proto_provisioner_proto_msgTypes[27].OneofWrappers = []interface{}{ (*Response_Log)(nil), (*Response_Parse)(nil), (*Response_Plan)(nil), @@ -3423,7 +3503,7 @@ func file_provisionersdk_proto_provisioner_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_provisionersdk_proto_provisioner_proto_rawDesc, NumEnums: 3, - NumMessages: 30, + NumMessages: 31, NumExtensions: 0, NumServices: 1, }, diff --git a/provisionersdk/proto/provisioner.proto b/provisionersdk/proto/provisioner.proto index 6b61583ba4fec..cf291425cf60e 100644 --- a/provisionersdk/proto/provisioner.proto +++ b/provisionersdk/proto/provisioner.proto @@ -81,6 +81,11 @@ message InstanceIdentityAuth { string instance_id = 1; } +message ExternalAuthProviderResource { + string id = 1; + bool optional = 2; +} + message ExternalAuthProvider { string id = 1; string access_token = 2; @@ -253,7 +258,7 @@ message PlanComplete { string error = 1; repeated Resource resources = 2; repeated RichParameter parameters = 3; - repeated string external_auth_providers = 4; + repeated ExternalAuthProviderResource external_auth_providers = 4; } // ApplyRequest asks the provisioner to apply the changes. Apply MUST be preceded by a successful plan request/response @@ -268,7 +273,7 @@ message ApplyComplete { string error = 2; repeated Resource resources = 3; repeated RichParameter parameters = 4; - repeated string external_auth_providers = 5; + repeated ExternalAuthProviderResource external_auth_providers = 5; } // CancelRequest requests that the previous request be canceled gracefully. diff --git a/site/e2e/provisionerGenerated.ts b/site/e2e/provisionerGenerated.ts index fcaf31801fec6..dc53d19460566 100644 --- a/site/e2e/provisionerGenerated.ts +++ b/site/e2e/provisionerGenerated.ts @@ -94,6 +94,11 @@ export interface InstanceIdentityAuth { instanceId: string; } +export interface ExternalAuthProviderResource { + id: string; + optional: boolean; +} + export interface ExternalAuthProvider { id: string; accessToken: string; @@ -257,7 +262,7 @@ export interface PlanComplete { error: string; resources: Resource[]; parameters: RichParameter[]; - externalAuthProviders: string[]; + externalAuthProviders: ExternalAuthProviderResource[]; } /** @@ -274,7 +279,7 @@ export interface ApplyComplete { error: string; resources: Resource[]; parameters: RichParameter[]; - externalAuthProviders: string[]; + externalAuthProviders: ExternalAuthProviderResource[]; } /** CancelRequest requests that the previous request be canceled gracefully. */ @@ -463,6 +468,21 @@ export const InstanceIdentityAuth = { }, }; +export const ExternalAuthProviderResource = { + encode( + message: ExternalAuthProviderResource, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.optional === true) { + writer.uint32(16).bool(message.optional); + } + return writer; + }, +}; + export const ExternalAuthProvider = { encode( message: ExternalAuthProvider, @@ -889,7 +909,10 @@ export const PlanComplete = { RichParameter.encode(v!, writer.uint32(26).fork()).ldelim(); } for (const v of message.externalAuthProviders) { - writer.uint32(34).string(v!); + ExternalAuthProviderResource.encode( + v!, + writer.uint32(34).fork(), + ).ldelim(); } return writer; }, @@ -925,7 +948,10 @@ export const ApplyComplete = { RichParameter.encode(v!, writer.uint32(34).fork()).ldelim(); } for (const v of message.externalAuthProviders) { - writer.uint32(42).string(v!); + ExternalAuthProviderResource.encode( + v!, + writer.uint32(42).fork(), + ).ldelim(); } return writer; }, diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 9d63f492c29b6..7b31ec38a6cdb 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -1172,6 +1172,7 @@ export interface TemplateVersionExternalAuth { readonly display_icon: string; readonly authenticate_url: string; readonly authenticated: boolean; + readonly optional: boolean; } // From codersdk/templateversions.go From bdf6142c02465879b4beb6534f854dc0d7ca7989 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 9 Feb 2024 23:43:43 +0000 Subject: [PATCH 03/27] db migration --- ...189_external_auth_providers_jsonb.down.sql | 43 +++++++++++++++++++ ...00189_external_auth_providers_jsonb.up.sql | 40 +++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql create mode 100644 coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql diff --git a/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql new file mode 100644 index 0000000000000..aace2c167fd90 --- /dev/null +++ b/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql @@ -0,0 +1,43 @@ +-- We cannot alter the column type while a view depends on it, so we drop it and recreate it. +DROP VIEW template_version_with_user; + +-- Does the opposite of `migrate_external_auth_providers_to_jsonb` +-- eg. `'[{"id": "github"}, {"id": "gitlab"}]'::jsonb` would become `'{github,gitlab}'::text[]` +CREATE OR REPLACE FUNCTION revert_migrate_external_auth_providers_to_jsonb(jsonb) RETURNS text[] +LANGUAGE plpgsql AS $$ +DECLARE + result text[]; +BEGIN + SELECT array_agg(id::text) + INTO result + FROM ( + SELECT jsonb_array_elements($1)->>'id' AS id + ) as external_auth_provider_ids; + RETURN result; +END; +$$; + + +-- Update the column type and migrate the values +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers TYPE text[] + USING revert_migrate_external_auth_providers_to_jsonb(external_auth_providers); + +-- Recreate `template_version_with_user` as described in dump.sql +CREATE VIEW template_version_with_user AS + SELECT template_versions.id, + template_versions.template_id, + template_versions.organization_id, + template_versions.created_at, + template_versions.updated_at, + template_versions.name, + template_versions.readme, + template_versions.job_id, + template_versions.created_by, + template_versions.external_auth_providers, + template_versions.message, + template_versions.archived, + COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, + COALESCE(visible_users.username, ''::text) AS created_by_username + FROM (public.template_versions + LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); diff --git a/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql new file mode 100644 index 0000000000000..60a53a7b4a962 --- /dev/null +++ b/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql @@ -0,0 +1,40 @@ +-- We cannot alter the column type while a view depends on it, so we drop it and recreate it. +DROP VIEW template_version_with_user; + +-- Turns the list of provider names into JSONB with the type `Array<{ id: string; optional?: boolean }>` +-- eg. `'{github,gitlab}'::text[]` would become `'[{"id": "github"}, {"id": "gitlab"}]'::jsonb` +CREATE OR REPLACE FUNCTION migrate_external_auth_providers_to_jsonb(text[]) RETURNS jsonb +LANGUAGE plpgsql AS $$ +DECLARE + result jsonb; +BEGIN + SELECT jsonb_agg(jsonb_build_object('id', value::text)) + INTO result + FROM unnest($1) AS value; + RETURN result; +END; +$$; + +-- Update the column type and migrate the values +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers TYPE jsonb + USING migrate_external_auth_providers_to_jsonb(external_auth_providers); + +-- Recreate `template_version_with_user` as described in dump.sql +CREATE VIEW template_version_with_user AS + SELECT template_versions.id, + template_versions.template_id, + template_versions.organization_id, + template_versions.created_at, + template_versions.updated_at, + template_versions.name, + template_versions.readme, + template_versions.job_id, + template_versions.created_by, + template_versions.external_auth_providers, + template_versions.message, + template_versions.archived, + COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, + COALESCE(visible_users.username, ''::text) AS created_by_username + FROM (public.template_versions + LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); From 751400bed5a28d1b8d03b01c7c23a7d476ce1647 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 18:30:14 +0000 Subject: [PATCH 04/27] =?UTF-8?q?=F0=9F=92=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coderd/database/dump.sql | 18 ++++- ...189_external_auth_providers_jsonb.down.sql | 66 +++++++++++-------- ...00189_external_auth_providers_jsonb.up.sql | 64 +++++++++++------- coderd/database/models.go | 31 +++++---- coderd/database/queries.sql.go | 22 +++---- .../provisionerdserver/provisionerdserver.go | 41 ++++++++---- coderd/templateversions.go | 14 +++- 7 files changed, 160 insertions(+), 96 deletions(-) diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index d7dd73aa5fe16..642584f9b1a44 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -215,6 +215,20 @@ BEGIN END; $$; +CREATE FUNCTION migrate_external_auth_providers_to_jsonb(text[]) RETURNS jsonb + LANGUAGE plpgsql + AS $_$ +DECLARE + result jsonb; +BEGIN + SELECT + jsonb_agg(jsonb_build_object('id', value::text)) INTO result + FROM + unnest($1) AS value; + RETURN result; +END; +$_$; + CREATE FUNCTION tailnet_notify_agent_change() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -760,7 +774,7 @@ CREATE TABLE template_versions ( readme character varying(1048576) NOT NULL, job_id uuid NOT NULL, created_by uuid NOT NULL, - external_auth_providers text[], + external_auth_providers jsonb DEFAULT '[]'::jsonb NOT NULL, message character varying(1048576) DEFAULT ''::character varying NOT NULL, archived boolean DEFAULT false NOT NULL ); @@ -819,8 +833,6 @@ CREATE VIEW template_version_with_user AS FROM (public.template_versions LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); -COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.'; - CREATE TABLE templates ( id uuid NOT NULL, created_at timestamp with time zone NOT NULL, diff --git a/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql index aace2c167fd90..9d64e063ea922 100644 --- a/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql +++ b/coderd/database/migrations/000189_external_auth_providers_jsonb.down.sql @@ -1,43 +1,55 @@ -- We cannot alter the column type while a view depends on it, so we drop it and recreate it. DROP VIEW template_version_with_user; + -- Does the opposite of `migrate_external_auth_providers_to_jsonb` -- eg. `'[{"id": "github"}, {"id": "gitlab"}]'::jsonb` would become `'{github,gitlab}'::text[]` -CREATE OR REPLACE FUNCTION revert_migrate_external_auth_providers_to_jsonb(jsonb) RETURNS text[] -LANGUAGE plpgsql AS $$ +CREATE OR REPLACE FUNCTION revert_migrate_external_auth_providers_to_jsonb(jsonb) + RETURNS text[] + LANGUAGE plpgsql + AS $$ DECLARE - result text[]; + result text[]; BEGIN - SELECT array_agg(id::text) - INTO result - FROM ( - SELECT jsonb_array_elements($1)->>'id' AS id - ) as external_auth_provider_ids; - RETURN result; + SELECT + array_agg(id::text) INTO result + FROM ( + SELECT + jsonb_array_elements($1) ->> 'id' AS id) AS external_auth_provider_ids; + RETURN result; END; $$; +-- Remove the non-null constraint and default +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers DROP NOT NULL; +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers DROP DEFAULT; + + -- Update the column type and migrate the values ALTER TABLE template_versions - ALTER COLUMN external_auth_providers TYPE text[] - USING revert_migrate_external_auth_providers_to_jsonb(external_auth_providers); + ALTER COLUMN external_auth_providers TYPE text[] + USING revert_migrate_external_auth_providers_to_jsonb(external_auth_providers); + -- Recreate `template_version_with_user` as described in dump.sql CREATE VIEW template_version_with_user AS - SELECT template_versions.id, - template_versions.template_id, - template_versions.organization_id, - template_versions.created_at, - template_versions.updated_at, - template_versions.name, - template_versions.readme, - template_versions.job_id, - template_versions.created_by, - template_versions.external_auth_providers, - template_versions.message, - template_versions.archived, - COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, - COALESCE(visible_users.username, ''::text) AS created_by_username - FROM (public.template_versions - LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); +SELECT + template_versions.id, + template_versions.template_id, + template_versions.organization_id, + template_versions.created_at, + template_versions.updated_at, + template_versions.name, + template_versions.readme, + template_versions.job_id, + template_versions.created_by, + template_versions.external_auth_providers, + template_versions.message, + template_versions.archived, + COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, + COALESCE(visible_users.username, ''::text) AS created_by_username +FROM (public.template_versions + LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); diff --git a/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql index 60a53a7b4a962..901396fb178c2 100644 --- a/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql +++ b/coderd/database/migrations/000189_external_auth_providers_jsonb.up.sql @@ -1,40 +1,54 @@ -- We cannot alter the column type while a view depends on it, so we drop it and recreate it. DROP VIEW template_version_with_user; + -- Turns the list of provider names into JSONB with the type `Array<{ id: string; optional?: boolean }>` -- eg. `'{github,gitlab}'::text[]` would become `'[{"id": "github"}, {"id": "gitlab"}]'::jsonb` -CREATE OR REPLACE FUNCTION migrate_external_auth_providers_to_jsonb(text[]) RETURNS jsonb -LANGUAGE plpgsql AS $$ +CREATE OR REPLACE FUNCTION migrate_external_auth_providers_to_jsonb(text[]) + RETURNS jsonb + LANGUAGE plpgsql + AS $$ DECLARE - result jsonb; + result jsonb; BEGIN - SELECT jsonb_agg(jsonb_build_object('id', value::text)) - INTO result - FROM unnest($1) AS value; - RETURN result; + SELECT + jsonb_agg(jsonb_build_object('id', value::text)) INTO result + FROM + unnest($1) AS value; + RETURN result; END; $$; + -- Update the column type and migrate the values ALTER TABLE template_versions - ALTER COLUMN external_auth_providers TYPE jsonb - USING migrate_external_auth_providers_to_jsonb(external_auth_providers); + ALTER COLUMN external_auth_providers TYPE jsonb + USING migrate_external_auth_providers_to_jsonb(external_auth_providers); + + +-- Make the column non-nullable to make the types nicer on the Go side +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers SET NOT NULL; +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers SET DEFAULT '[]'::jsonb; + -- Recreate `template_version_with_user` as described in dump.sql CREATE VIEW template_version_with_user AS - SELECT template_versions.id, - template_versions.template_id, - template_versions.organization_id, - template_versions.created_at, - template_versions.updated_at, - template_versions.name, - template_versions.readme, - template_versions.job_id, - template_versions.created_by, - template_versions.external_auth_providers, - template_versions.message, - template_versions.archived, - COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, - COALESCE(visible_users.username, ''::text) AS created_by_username - FROM (public.template_versions - LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); +SELECT + template_versions.id, + template_versions.template_id, + template_versions.organization_id, + template_versions.created_at, + template_versions.updated_at, + template_versions.name, + template_versions.readme, + template_versions.job_id, + template_versions.created_by, + template_versions.external_auth_providers, + template_versions.message, + template_versions.archived, + COALESCE(visible_users.avatar_url, ''::text) AS created_by_avatar_url, + COALESCE(visible_users.username, ''::text) AS created_by_username +FROM (public.template_versions + LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); diff --git a/coderd/database/models.go b/coderd/database/models.go index 947df11e7a4f8..60d10896ffd95 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -2047,22 +2047,21 @@ type TemplateTable struct { UseMaxTtl bool `db:"use_max_ttl" json:"use_max_ttl"` } -// Joins in the username + avatar url of the created by user. type TemplateVersion struct { - ID uuid.UUID `db:"id" json:"id"` - TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` - OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` - CreatedAt time.Time `db:"created_at" json:"created_at"` - UpdatedAt time.Time `db:"updated_at" json:"updated_at"` - Name string `db:"name" json:"name"` - Readme string `db:"readme" json:"readme"` - JobID uuid.UUID `db:"job_id" json:"job_id"` - CreatedBy uuid.UUID `db:"created_by" json:"created_by"` - ExternalAuthProviders []string `db:"external_auth_providers" json:"external_auth_providers"` - Message string `db:"message" json:"message"` - Archived bool `db:"archived" json:"archived"` - CreatedByAvatarURL string `db:"created_by_avatar_url" json:"created_by_avatar_url"` - CreatedByUsername string `db:"created_by_username" json:"created_by_username"` + ID uuid.UUID `db:"id" json:"id"` + TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` + OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` + CreatedAt time.Time `db:"created_at" json:"created_at"` + UpdatedAt time.Time `db:"updated_at" json:"updated_at"` + Name string `db:"name" json:"name"` + Readme string `db:"readme" json:"readme"` + JobID uuid.UUID `db:"job_id" json:"job_id"` + CreatedBy uuid.UUID `db:"created_by" json:"created_by"` + ExternalAuthProviders json.RawMessage `db:"external_auth_providers" json:"external_auth_providers"` + Message string `db:"message" json:"message"` + Archived bool `db:"archived" json:"archived"` + CreatedByAvatarURL string `db:"created_by_avatar_url" json:"created_by_avatar_url"` + CreatedByUsername string `db:"created_by_username" json:"created_by_username"` } type TemplateVersionParameter struct { @@ -2112,7 +2111,7 @@ type TemplateVersionTable struct { JobID uuid.UUID `db:"job_id" json:"job_id"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` // IDs of External auth providers for a specific template version - ExternalAuthProviders []string `db:"external_auth_providers" json:"external_auth_providers"` + ExternalAuthProviders json.RawMessage `db:"external_auth_providers" json:"external_auth_providers"` // Message describing the changes in this version of the template, similar to a Git commit message. Like a commit message, this should be a short, high-level description of the changes in this version of the template. This message is immutable and should not be updated after the fact. Message string `db:"message" json:"message"` Archived bool `db:"archived" json:"archived"` diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 6eefaea1514eb..0eafdd1c78c3f 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -6532,7 +6532,7 @@ func (q *sqlQuerier) GetPreviousTemplateVersion(ctx context.Context, arg GetPrev &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6563,7 +6563,7 @@ func (q *sqlQuerier) GetTemplateVersionByID(ctx context.Context, id uuid.UUID) ( &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6594,7 +6594,7 @@ func (q *sqlQuerier) GetTemplateVersionByJobID(ctx context.Context, jobID uuid.U &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6631,7 +6631,7 @@ func (q *sqlQuerier) GetTemplateVersionByTemplateIDAndName(ctx context.Context, &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6668,7 +6668,7 @@ func (q *sqlQuerier) GetTemplateVersionsByIDs(ctx context.Context, ids []uuid.UU &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6762,7 +6762,7 @@ func (q *sqlQuerier) GetTemplateVersionsByTemplateID(ctx context.Context, arg Ge &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6804,7 +6804,7 @@ func (q *sqlQuerier) GetTemplateVersionsCreatedAfter(ctx context.Context, create &i.Readme, &i.JobID, &i.CreatedBy, - pq.Array(&i.ExternalAuthProviders), + &i.ExternalAuthProviders, &i.Message, &i.Archived, &i.CreatedByAvatarURL, @@ -6954,13 +6954,13 @@ WHERE ` type UpdateTemplateVersionExternalAuthProvidersByJobIDParams struct { - JobID uuid.UUID `db:"job_id" json:"job_id"` - ExternalAuthProviders []string `db:"external_auth_providers" json:"external_auth_providers"` - UpdatedAt time.Time `db:"updated_at" json:"updated_at"` + JobID uuid.UUID `db:"job_id" json:"job_id"` + ExternalAuthProviders json.RawMessage `db:"external_auth_providers" json:"external_auth_providers"` + UpdatedAt time.Time `db:"updated_at" json:"updated_at"` } func (q *sqlQuerier) UpdateTemplateVersionExternalAuthProvidersByJobID(ctx context.Context, arg UpdateTemplateVersionExternalAuthProvidersByJobIDParams) error { - _, err := q.db.ExecContext(ctx, updateTemplateVersionExternalAuthProvidersByJobID, arg.JobID, pq.Array(arg.ExternalAuthProviders), arg.UpdatedAt) + _, err := q.db.ExecContext(ctx, updateTemplateVersionExternalAuthProvidersByJobID, arg.JobID, arg.ExternalAuthProviders, arg.UpdatedAt) return err } diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 55d6add894a4b..cc89b0d86ea7a 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -501,10 +501,16 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo return nil, failJob(fmt.Sprintf("get workspace build parameters: %s", err)) } + externalAuthProviderResources := []*sdkproto.ExternalAuthProviderResource{} + err = json.Unmarshal(templateVersion.ExternalAuthProviders, &externalAuthProviderResources) + if err != nil { + return nil, xerrors.Errorf("failed to deserialize external_auth_providers value: %w", err) + } + externalAuthProviders := []*sdkproto.ExternalAuthProvider{} - for _, p := range templateVersion.ExternalAuthProviders { + for _, p := range externalAuthProviderResources { link, err := s.Database.GetExternalAuthLink(ctx, database.GetExternalAuthLinkParams{ - ProviderID: p, + ProviderID: p.Id, UserID: owner.ID, }) if errors.Is(err, sql.ErrNoRows) { @@ -515,7 +521,7 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo } var config *externalauth.Config for _, c := range s.ExternalAuthConfigs { - if c.ID != p { + if c.ID != p.Id { continue } config = c @@ -524,7 +530,7 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo // We weren't able to find a matching config for the ID! if config == nil { s.Logger.Warn(ctx, "workspace build job is missing external auth provider", - slog.F("provider_id", p), + slog.F("provider_id", p.Id), slog.F("template_version_id", templateVersion.ID), slog.F("workspace_id", workspaceBuild.WorkspaceID)) continue @@ -532,13 +538,13 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo link, valid, err := config.RefreshToken(ctx, s.Database, link) if err != nil { - return nil, failJob(fmt.Sprintf("refresh external auth link %q: %s", p, err)) + return nil, failJob(fmt.Sprintf("refresh external auth link %q: %s", p.Id, err)) } if !valid { continue } externalAuthProviders = append(externalAuthProviders, &sdkproto.ExternalAuthProvider{ - Id: p, + Id: p.Id, AccessToken: link.OAuthAccessToken, }) } @@ -1147,17 +1153,28 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) } } - externalAuthProviderIds := jobType.TemplateImport.ExternalAuthProvidersNames - if providersLen := len(jobType.TemplateImport.ExternalAuthProviders); providersLen > 0 { - externalAuthProviderIds = make([]string, 0, providersLen) - for _, provider := range jobType.TemplateImport.ExternalAuthProviders { - externalAuthProviderIds = append(externalAuthProviderIds, provider.Id) + externalAuthProviders := jobType.TemplateImport.ExternalAuthProviders + // Fallback to `ExternalAuthProvidersNames` if it was specified and `ExternalAuthProviders` + // was not. Gives us backwards compatibility with custom provisioners that haven't been + // updated to use the new field yet. + namesLen := len(jobType.TemplateImport.ExternalAuthProvidersNames) + if len(externalAuthProviders) == 0 && namesLen > 0 { + externalAuthProviders = make([]*sdkproto.ExternalAuthProviderResource, 0, namesLen) + for _, providerID := range jobType.TemplateImport.ExternalAuthProvidersNames { + externalAuthProviders = append(externalAuthProviders, &sdkproto.ExternalAuthProviderResource{ + Id: providerID, + }) } } + externalAuthProvidersMessage, err := json.Marshal(externalAuthProviders) + if err != nil { + return nil, xerrors.Errorf("failed to serialize external_auth_providers value: %w", err) + } + err = s.Database.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ JobID: jobID, - ExternalAuthProviders: externalAuthProviderIds, + ExternalAuthProviders: json.RawMessage(externalAuthProvidersMessage), UpdatedAt: dbtime.Now(), }) if err != nil { diff --git a/coderd/templateversions.go b/coderd/templateversions.go index 4aa6bf7f63db6..3be7c461165ec 100644 --- a/coderd/templateversions.go +++ b/coderd/templateversions.go @@ -289,12 +289,21 @@ func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Requ templateVersion = httpmw.TemplateVersionParam(r) ) - rawProviders := templateVersion.ExternalAuthProviders + var rawProviders []*sdkproto.ExternalAuthProviderResource + err := json.Unmarshal(templateVersion.ExternalAuthProviders, &rawProviders) + if err != nil { + httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ + Message: "Internal error reading auth config from database", + Detail: err.Error(), + }) + return + } + providers := make([]codersdk.TemplateVersionExternalAuth, 0) for _, rawProvider := range rawProviders { var config *externalauth.Config for _, provider := range api.ExternalAuthConfigs { - if provider.ID == rawProvider { + if provider.ID == rawProvider.Id { config = provider break } @@ -323,6 +332,7 @@ func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Requ AuthenticateURL: redirectURL.String(), DisplayName: config.DisplayName, DisplayIcon: config.DisplayIcon, + Optional: rawProvider.Optional, } authLink, err := api.Database.GetExternalAuthLink(ctx, database.GetExternalAuthLinkParams{ From eaddb5b5d47ac4250ea1f33dfdd8efe292bd0551 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 20:37:38 +0000 Subject: [PATCH 05/27] =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/create_test.go | 2 +- coderd/database/dbauthz/dbauthz_test.go | 3 +-- .../provisionerdserver_test.go | 25 ++++++++++++------- coderd/templateversions_test.go | 2 +- codersdk/templateversions.go | 2 +- enterprise/coderd/provisionerdaemons.go | 2 +- provisioner/terraform/resources.go | 4 +-- provisioner/terraform/resources_test.go | 23 +++++++++++------ site/src/api/typesGenerated.ts | 2 +- .../CreateWorkspacePageView.stories.tsx | 2 -- .../ExternalAuthWall/ExternalAuthItem.tsx | 2 +- 11 files changed, 40 insertions(+), 29 deletions(-) diff --git a/cli/create_test.go b/cli/create_test.go index 903694167fd72..eda62b2b353da 100644 --- a/cli/create_test.go +++ b/cli/create_test.go @@ -757,7 +757,7 @@ func TestCreateWithGitAuth(t *testing.T) { { Type: &proto.Response_Plan{ Plan: &proto.PlanComplete{ - ExternalAuthProviders: []string{"github"}, + ExternalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}}, }, }, }, diff --git a/coderd/database/dbauthz/dbauthz_test.go b/coderd/database/dbauthz/dbauthz_test.go index 2441a453487be..2a851a23f7cc1 100644 --- a/coderd/database/dbauthz/dbauthz_test.go +++ b/coderd/database/dbauthz/dbauthz_test.go @@ -925,8 +925,7 @@ func (s *MethodTestSuite) TestTemplate() { JobID: jobID, }) check.Args(database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ - JobID: jobID, - ExternalAuthProviders: []string{}, + JobID: jobID, }).Asserts(t1, rbac.ActionUpdate).Returns() })) s.Run("GetTemplateInsights", s.Subtest(func(db database.Store, check *expects) { diff --git a/coderd/provisionerdserver/provisionerdserver_test.go b/coderd/provisionerdserver/provisionerdserver_test.go index 51880bf6088c7..444a72e064a28 100644 --- a/coderd/provisionerdserver/provisionerdserver_test.go +++ b/coderd/provisionerdserver/provisionerdserver_test.go @@ -172,11 +172,14 @@ func TestAcquireJob(t *testing.T) { // create an API key with an expiration within the bounds of the // deployment config. dv := &codersdk.DeploymentValues{MaxTokenLifetime: clibase.Duration(time.Hour)} - gitAuthProvider := "github" + gitAuthProvider := &sdkproto.ExternalAuthProviderResource{ + Id: "github", + } + srv, db, ps, _ := setup(t, false, &overrides{ deploymentValues: dv, externalAuthConfigs: []*externalauth.Config{{ - ID: gitAuthProvider, + ID: gitAuthProvider.Id, InstrumentedOAuth2Config: &testutil.OAuth2Config{}, }}, }) @@ -191,7 +194,7 @@ func TestAcquireJob(t *testing.T) { OAuthAccessToken: "access-token", }) dbgen.ExternalAuthLink(t, db, database.ExternalAuthLink{ - ProviderID: gitAuthProvider, + ProviderID: gitAuthProvider.Id, UserID: user.ID, }) template := dbgen.Template(t, db, database.Template{ @@ -207,9 +210,11 @@ func TestAcquireJob(t *testing.T) { }, JobID: uuid.New(), }) - err := db.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ + externalAuthProviders, err := json.Marshal([]*sdkproto.ExternalAuthProviderResource{gitAuthProvider}) + require.NoError(t, err) + err = db.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ JobID: version.JobID, - ExternalAuthProviders: []string{gitAuthProvider}, + ExternalAuthProviders: json.RawMessage(externalAuthProviders), UpdatedAt: dbtime.Now(), }) require.NoError(t, err) @@ -321,7 +326,7 @@ func TestAcquireJob(t *testing.T) { }, }, ExternalAuthProviders: []*sdkproto.ExternalAuthProvider{{ - Id: gitAuthProvider, + Id: gitAuthProvider.Id, AccessToken: "access_token", }}, Metadata: &sdkproto.Metadata{ @@ -949,8 +954,10 @@ func TestCompleteJob(t *testing.T) { Name: "hello", Type: "aws_instance", }}, - StopResources: []*sdkproto.Resource{}, - ExternalAuthProviders: []string{"github"}, + StopResources: []*sdkproto.Resource{}, + ExternalAuthProviders: []*sdkproto.ExternalAuthProviderResource{{ + Id: "github", + }}, }, }, }) @@ -1002,7 +1009,7 @@ func TestCompleteJob(t *testing.T) { Type: "aws_instance", }}, StopResources: []*sdkproto.Resource{}, - ExternalAuthProviders: []string{"github"}, + ExternalAuthProviders: []*sdkproto.ExternalAuthProviderResource{{Id: "github"}}, }, }, }) diff --git a/coderd/templateversions_test.go b/coderd/templateversions_test.go index 4423bbc4e7056..c388eb1413636 100644 --- a/coderd/templateversions_test.go +++ b/coderd/templateversions_test.go @@ -347,7 +347,7 @@ func TestTemplateVersionsExternalAuth(t *testing.T) { ProvisionPlan: []*proto.Response{{ Type: &proto.Response_Plan{ Plan: &proto.PlanComplete{ - ExternalAuthProviders: []string{"github"}, + ExternalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}}, }, }, }}, diff --git a/codersdk/templateversions.go b/codersdk/templateversions.go index f14b673d91af9..a6f9bbe1a2a49 100644 --- a/codersdk/templateversions.go +++ b/codersdk/templateversions.go @@ -41,7 +41,7 @@ type TemplateVersionExternalAuth struct { DisplayIcon string `json:"display_icon"` AuthenticateURL string `json:"authenticate_url"` Authenticated bool `json:"authenticated"` - Optional bool `json:"optional"` + Optional bool `json:"optional,omitempty"` } type ValidationMonotonicOrder string diff --git a/enterprise/coderd/provisionerdaemons.go b/enterprise/coderd/provisionerdaemons.go index 1dfd72bc87ad3..f8d5e314c7c87 100644 --- a/enterprise/coderd/provisionerdaemons.go +++ b/enterprise/coderd/provisionerdaemons.go @@ -241,7 +241,7 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request) if err := proto.CurrentVersion.Validate(apiVersion); err != nil { httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ - Message: "Incompatible or unparseable version", + Message: "Incompatible or unparsable version", Validations: []codersdk.ValidationError{ {Field: "version", Detail: err.Error()}, }, diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index cf2a5777b103e..b4ea3c5b13e43 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -718,8 +718,8 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error } } externalAuthProviders := make([]*proto.ExternalAuthProviderResource, 0, len(externalAuthProvidersMap)) - for _, provider := range externalAuthProvidersMap { - externalAuthProviders = append(externalAuthProviders, provider) + for _, it := range externalAuthProvidersMap { + externalAuthProviders = append(externalAuthProviders, it) } return &State{ diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index 3a21558a8a85c..c1e4274e50ec9 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -7,6 +7,7 @@ import ( "path/filepath" "runtime" "sort" + "strings" "testing" tfjson "github.com/hashicorp/terraform-json" @@ -23,9 +24,9 @@ func TestConvertResources(t *testing.T) { // nolint:dogsled _, filename, _, _ := runtime.Caller(0) type testCase struct { - resources []*proto.Resource - parameters []*proto.RichParameter - gitAuthProviders []string + resources []*proto.Resource + parameters []*proto.RichParameter + externalAuthProviders []*proto.ExternalAuthProviderResource } // If a user doesn't specify 'display_apps' then they default @@ -486,7 +487,7 @@ func TestConvertResources(t *testing.T) { DisplayApps: &displayApps, }}, }}, - gitAuthProviders: []string{"github", "gitlab"}, + externalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}, {Id: "gitlab"}}, }, "display-apps": { resources: []*proto.Resource{{ @@ -547,7 +548,7 @@ func TestConvertResources(t *testing.T) { state, err := terraform.ConvertState(modules, string(tfPlanGraph)) require.NoError(t, err) sortResources(state.Resources) - sort.Strings(state.ExternalAuthProviders) + sortExternalAuthProviders(state.ExternalAuthProviders) expectedNoMetadata := make([]*proto.Resource, 0) for _, resource := range expected.resources { @@ -585,7 +586,7 @@ func TestConvertResources(t *testing.T) { require.Equal(t, string(parametersWant), string(parametersGot)) require.Equal(t, expectedNoMetadataMap, resourcesMap) - require.ElementsMatch(t, expected.gitAuthProviders, state.ExternalAuthProviders) + require.ElementsMatch(t, expected.externalAuthProviders, state.ExternalAuthProviders) }) t.Run("Provision", func(t *testing.T) { @@ -601,7 +602,7 @@ func TestConvertResources(t *testing.T) { state, err := terraform.ConvertState([]*tfjson.StateModule{tfState.Values.RootModule}, string(tfStateGraph)) require.NoError(t, err) sortResources(state.Resources) - sort.Strings(state.ExternalAuthProviders) + sortExternalAuthProviders(state.ExternalAuthProviders) for _, resource := range state.Resources { for _, agent := range resource.Agents { agent.Id = "" @@ -628,7 +629,7 @@ func TestConvertResources(t *testing.T) { require.NoError(t, err) require.Equal(t, expectedMap, resourcesMap) - require.ElementsMatch(t, expected.gitAuthProviders, state.ExternalAuthProviders) + require.ElementsMatch(t, expected.externalAuthProviders, state.ExternalAuthProviders) }) }) } @@ -901,3 +902,9 @@ func sortResources(resources []*proto.Resource) { }) } } + +func sortExternalAuthProviders(providers []*proto.ExternalAuthProviderResource) { + sort.Slice(providers, func(i, j int) bool { + return strings.Compare(providers[i].Id, providers[j].Id) == -1 + }) +} diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 7b31ec38a6cdb..2cc5920211085 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -1172,7 +1172,7 @@ export interface TemplateVersionExternalAuth { readonly display_icon: string; readonly authenticate_url: string; readonly authenticated: boolean; - readonly optional: boolean; + readonly optional?: boolean; } // From codersdk/templateversions.go diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx index 5a0586701c5e6..e3197c96c4f97 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx @@ -141,7 +141,6 @@ export const OptionalExternalAuth: Story = { authenticate_url: "", display_icon: "/icon/github.svg", display_name: "GitHub", - // @ts-expect-error optional: true, }, { @@ -151,7 +150,6 @@ export const OptionalExternalAuth: Story = { authenticate_url: "", display_icon: "/icon/gitlab.svg", display_name: "GitLab", - // @ts-expect-error optional: true, }, ], diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx index da369122c7bc0..3f1116c40aba2 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx @@ -37,7 +37,7 @@ export const ExternalAuthItem: FC = ({ {provider.display_name} - {!provider.authenticated && (provider as any).optional && ( + {!provider.authenticated && provider.optional && ( Optional )} From eba3d1280a4f1525ab72b9f2eefb15ea390df3e5 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 22:42:20 +0000 Subject: [PATCH 06/27] tests! --- provisioner/terraform/resources.go | 8 +- provisioner/terraform/resources_test.go | 15 ++ .../external-auth-providers.tf | 30 +++ .../external-auth-providers.tfplan.dot | 24 ++ .../external-auth-providers.tfplan.json | 230 ++++++++++++++++++ .../external-auth-providers.tfstate.dot | 24 ++ .../external-auth-providers.tfstate.json | 98 ++++++++ 7 files changed, 427 insertions(+), 2 deletions(-) create mode 100644 provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf create mode 100644 provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot create mode 100644 provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json create mode 100644 provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot create mode 100644 provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json diff --git a/provisioner/terraform/resources.go b/provisioner/terraform/resources.go index b4ea3c5b13e43..33eb30db0e6bd 100644 --- a/provisioner/terraform/resources.go +++ b/provisioner/terraform/resources.go @@ -704,17 +704,21 @@ func ConvertState(modules []*tfjson.StateModule, rawGraph string) (*State, error if resource.Type != "coder_external_auth" && resource.Type != "coder_git_auth" { continue } + id, ok := resource.AttributeValues["id"].(string) if !ok { return nil, xerrors.Errorf("external auth id is not a string") } - optional := false optionalAttribute, ok := resource.AttributeValues["optional"].(bool) if ok { optional = optionalAttribute } - externalAuthProvidersMap[id] = &proto.ExternalAuthProviderResource{Optional: optional} + + externalAuthProvidersMap[id] = &proto.ExternalAuthProviderResource{ + Id: id, + Optional: optional, + } } } externalAuthProviders := make([]*proto.ExternalAuthProviderResource, 0, len(externalAuthProvidersMap)) diff --git a/provisioner/terraform/resources_test.go b/provisioner/terraform/resources_test.go index c1e4274e50ec9..adfdc6c5e9ac2 100644 --- a/provisioner/terraform/resources_test.go +++ b/provisioner/terraform/resources_test.go @@ -489,6 +489,21 @@ func TestConvertResources(t *testing.T) { }}, externalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}, {Id: "gitlab"}}, }, + "external-auth-providers": { + resources: []*proto.Resource{{ + Name: "dev", + Type: "null_resource", + Agents: []*proto.Agent{{ + Name: "main", + OperatingSystem: "linux", + Architecture: "amd64", + Auth: &proto.Agent_Token{}, + ConnectionTimeoutSeconds: 120, + DisplayApps: &displayApps, + }}, + }}, + externalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}, {Id: "gitlab", Optional: true}}, + }, "display-apps": { resources: []*proto.Resource{{ Name: "dev", diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf new file mode 100644 index 0000000000000..2c6b61f07cbfb --- /dev/null +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf @@ -0,0 +1,30 @@ +terraform { + required_providers { + coder = { + source = "mckayla.dev/coder/coder" + version = "1.0.0" + # source = "coder/coder" + # version = "0.6.13" + } + } +} + +data "coder_external_auth" "github" { + id = "github" +} + +data "coder_external_auth" "gitlab" { + id = "gitlab" + optional = true +} + +resource "coder_agent" "main" { + os = "linux" + arch = "amd64" +} + +resource "null_resource" "dev" { + depends_on = [ + coder_agent.main + ] +} diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot new file mode 100644 index 0000000000000..7b8912d4d7935 --- /dev/null +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot @@ -0,0 +1,24 @@ +digraph { + compound = "true" + newrank = "true" + subgraph "root" { + "[root] coder_agent.main (expand)" [label = "coder_agent.main", shape = "box"] + "[root] data.coder_external_auth.github (expand)" [label = "data.coder_external_auth.github", shape = "box"] + "[root] data.coder_external_auth.gitlab (expand)" [label = "data.coder_external_auth.gitlab", shape = "box"] + "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] + "[root] provider[\"mckayla.dev/coder/coder\"]" [label = "provider[\"mckayla.dev/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] + "[root] coder_agent.main (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] null_resource.dev (expand)" -> "[root] coder_agent.main (expand)" + "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" + "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" + "[root] root" -> "[root] provider[\"mckayla.dev/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" + } +} + diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json new file mode 100644 index 0000000000000..c92ba4e3a8339 --- /dev/null +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json @@ -0,0 +1,230 @@ +{ + "format_version": "1.2", + "terraform_version": "1.6.6", + "planned_values": { + "root_module": { + "resources": [ + { + "address": "coder_agent.main", + "mode": "managed", + "type": "coder_agent", + "name": "main", + "provider_name": "mckayla.dev/coder/coder", + "schema_version": 0, + "values": { + "arch": "amd64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "env": null, + "login_before_ready": true, + "metadata": [], + "motd_file": null, + "os": "linux", + "shutdown_script": null, + "shutdown_script_timeout": 300, + "startup_script": null, + "startup_script_behavior": null, + "startup_script_timeout": 300, + "troubleshooting_url": null + }, + "sensitive_values": { + "display_apps": [], + "metadata": [] + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "schema_version": 0, + "values": { + "triggers": null + }, + "sensitive_values": {} + } + ] + } + }, + "resource_changes": [ + { + "address": "coder_agent.main", + "mode": "managed", + "type": "coder_agent", + "name": "main", + "provider_name": "mckayla.dev/coder/coder", + "change": { + "actions": [ + "create" + ], + "before": null, + "after": { + "arch": "amd64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "env": null, + "login_before_ready": true, + "metadata": [], + "motd_file": null, + "os": "linux", + "shutdown_script": null, + "shutdown_script_timeout": 300, + "startup_script": null, + "startup_script_behavior": null, + "startup_script_timeout": 300, + "troubleshooting_url": null + }, + "after_unknown": { + "display_apps": true, + "id": true, + "init_script": true, + "metadata": [], + "token": true + }, + "before_sensitive": false, + "after_sensitive": { + "display_apps": [], + "metadata": [], + "token": true + } + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "change": { + "actions": [ + "create" + ], + "before": null, + "after": { + "triggers": null + }, + "after_unknown": { + "id": true + }, + "before_sensitive": false, + "after_sensitive": {} + } + } + ], + "prior_state": { + "format_version": "1.0", + "terraform_version": "1.6.6", + "values": { + "root_module": { + "resources": [ + { + "address": "data.coder_external_auth.github", + "mode": "data", + "type": "coder_external_auth", + "name": "github", + "provider_name": "mckayla.dev/coder/coder", + "schema_version": 0, + "values": { + "access_token": "", + "id": "github", + "optional": null + }, + "sensitive_values": {} + }, + { + "address": "data.coder_external_auth.gitlab", + "mode": "data", + "type": "coder_external_auth", + "name": "gitlab", + "provider_name": "mckayla.dev/coder/coder", + "schema_version": 0, + "values": { + "access_token": "", + "id": "gitlab", + "optional": true + }, + "sensitive_values": {} + } + ] + } + } + }, + "configuration": { + "provider_config": { + "coder": { + "name": "coder", + "full_name": "mckayla.dev/coder/coder", + "version_constraint": "1.0.0" + }, + "null": { + "name": "null", + "full_name": "registry.terraform.io/hashicorp/null" + } + }, + "root_module": { + "resources": [ + { + "address": "coder_agent.main", + "mode": "managed", + "type": "coder_agent", + "name": "main", + "provider_config_key": "coder", + "expressions": { + "arch": { + "constant_value": "amd64" + }, + "os": { + "constant_value": "linux" + } + }, + "schema_version": 0 + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_config_key": "null", + "schema_version": 0, + "depends_on": [ + "coder_agent.main" + ] + }, + { + "address": "data.coder_external_auth.github", + "mode": "data", + "type": "coder_external_auth", + "name": "github", + "provider_config_key": "coder", + "expressions": { + "id": { + "constant_value": "github" + } + }, + "schema_version": 0 + }, + { + "address": "data.coder_external_auth.gitlab", + "mode": "data", + "type": "coder_external_auth", + "name": "gitlab", + "provider_config_key": "coder", + "expressions": { + "id": { + "constant_value": "gitlab" + }, + "optional": { + "constant_value": true + } + }, + "schema_version": 0 + } + ] + } + }, + "timestamp": "2024-02-12T22:31:31Z", + "errored": false +} diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot new file mode 100644 index 0000000000000..7b8912d4d7935 --- /dev/null +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot @@ -0,0 +1,24 @@ +digraph { + compound = "true" + newrank = "true" + subgraph "root" { + "[root] coder_agent.main (expand)" [label = "coder_agent.main", shape = "box"] + "[root] data.coder_external_auth.github (expand)" [label = "data.coder_external_auth.github", shape = "box"] + "[root] data.coder_external_auth.gitlab (expand)" [label = "data.coder_external_auth.gitlab", shape = "box"] + "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] + "[root] provider[\"mckayla.dev/coder/coder\"]" [label = "provider[\"mckayla.dev/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] + "[root] coder_agent.main (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] null_resource.dev (expand)" -> "[root] coder_agent.main (expand)" + "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" + "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" + "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" + "[root] root" -> "[root] provider[\"mckayla.dev/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" + } +} + diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json new file mode 100644 index 0000000000000..b3f7f1055ddc2 --- /dev/null +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json @@ -0,0 +1,98 @@ +{ + "format_version": "1.0", + "terraform_version": "1.6.6", + "values": { + "root_module": { + "resources": [ + { + "address": "data.coder_external_auth.github", + "mode": "data", + "type": "coder_external_auth", + "name": "github", + "provider_name": "coder/coder", + "schema_version": 0, + "values": { + "access_token": "", + "id": "github", + "optional": null + }, + "sensitive_values": {} + }, + { + "address": "data.coder_external_auth.gitlab", + "mode": "data", + "type": "coder_external_auth", + "name": "gitlab", + "provider_name": "coder/coder", + "schema_version": 0, + "values": { + "access_token": "", + "id": "gitlab", + "optional": true + }, + "sensitive_values": {} + }, + { + "address": "coder_agent.main", + "mode": "managed", + "type": "coder_agent", + "name": "main", + "provider_name": "coder/coder", + "schema_version": 0, + "values": { + "arch": "amd64", + "auth": "token", + "connection_timeout": 120, + "dir": null, + "display_apps": [ + { + "port_forwarding_helper": true, + "ssh_helper": true, + "vscode": true, + "vscode_insiders": false, + "web_terminal": true + } + ], + "env": null, + "id": "0828db62-9f9d-4c46-b38c-c33dada8acfb", + "init_script": "", + "login_before_ready": true, + "metadata": [], + "motd_file": null, + "os": "linux", + "shutdown_script": null, + "shutdown_script_timeout": 300, + "startup_script": null, + "startup_script_behavior": null, + "startup_script_timeout": 300, + "token": "bdbedf59-0c71-4f2e-97c2-8b70b5bfb7c8", + "troubleshooting_url": null + }, + "sensitive_values": { + "display_apps": [ + {} + ], + "metadata": [], + "token": true + } + }, + { + "address": "null_resource.dev", + "mode": "managed", + "type": "null_resource", + "name": "dev", + "provider_name": "registry.terraform.io/hashicorp/null", + "schema_version": 0, + "values": { + "id": "3979535131521307934", + "triggers": null + }, + "sensitive_values": {}, + "depends_on": [ + "coder_agent.main" + ] + } + ] + } + } +} From ebb518b1b7870ef7bc8fa023e7808dad5b5e5929 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 22:52:51 +0000 Subject: [PATCH 07/27] =?UTF-8?q?=F0=9F=A7=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coderd/provisionerdserver/provisionerdserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index fd742ee2b5da8..1cb20798b1be9 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -1146,7 +1146,7 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) } if !contains { completedError = sql.NullString{ - String: fmt.Sprintf("external auth provider %q is not configured", externalAuthProvider), + String: fmt.Sprintf("external auth provider %q is not configured", externalAuthProvider.Id), Valid: true, } break From 29be41730ae1af16bd5a9860ead44984806f081d Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 23:12:31 +0000 Subject: [PATCH 08/27] official release --- .../external-auth-providers.tf | 6 ++---- .../external-auth-providers.tfplan.dot | 16 ++++++++-------- .../external-auth-providers.tfplan.json | 14 +++++++------- .../external-auth-providers.tfstate.dot | 16 ++++++++-------- .../external-auth-providers.tfstate.json | 12 ++++++------ 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf index 2c6b61f07cbfb..7afa655792cea 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tf @@ -1,10 +1,8 @@ terraform { required_providers { coder = { - source = "mckayla.dev/coder/coder" - version = "1.0.0" - # source = "coder/coder" - # version = "0.6.13" + source = "coder/coder" + version = "0.16.0" } } } diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot index 7b8912d4d7935..a011d7c85e40e 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.dot @@ -6,18 +6,18 @@ digraph { "[root] data.coder_external_auth.github (expand)" [label = "data.coder_external_auth.github", shape = "box"] "[root] data.coder_external_auth.gitlab (expand)" [label = "data.coder_external_auth.gitlab", shape = "box"] "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] - "[root] provider[\"mckayla.dev/coder/coder\"]" [label = "provider[\"mckayla.dev/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] - "[root] coder_agent.main (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" - "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" - "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] coder_agent.main (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" "[root] null_resource.dev (expand)" -> "[root] coder_agent.main (expand)" "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" - "[root] root" -> "[root] provider[\"mckayla.dev/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" } } diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json index c92ba4e3a8339..afd5d60812138 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfplan.json @@ -9,7 +9,7 @@ "mode": "managed", "type": "coder_agent", "name": "main", - "provider_name": "mckayla.dev/coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "arch": "amd64", @@ -54,7 +54,7 @@ "mode": "managed", "type": "coder_agent", "name": "main", - "provider_name": "mckayla.dev/coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "change": { "actions": [ "create" @@ -125,7 +125,7 @@ "mode": "data", "type": "coder_external_auth", "name": "github", - "provider_name": "mckayla.dev/coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "access_token": "", @@ -139,7 +139,7 @@ "mode": "data", "type": "coder_external_auth", "name": "gitlab", - "provider_name": "mckayla.dev/coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "access_token": "", @@ -156,8 +156,8 @@ "provider_config": { "coder": { "name": "coder", - "full_name": "mckayla.dev/coder/coder", - "version_constraint": "1.0.0" + "full_name": "registry.terraform.io/coder/coder", + "version_constraint": "0.16.0" }, "null": { "name": "null", @@ -225,6 +225,6 @@ ] } }, - "timestamp": "2024-02-12T22:31:31Z", + "timestamp": "2024-02-12T23:11:52Z", "errored": false } diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot index 7b8912d4d7935..a011d7c85e40e 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.dot @@ -6,18 +6,18 @@ digraph { "[root] data.coder_external_auth.github (expand)" [label = "data.coder_external_auth.github", shape = "box"] "[root] data.coder_external_auth.gitlab (expand)" [label = "data.coder_external_auth.gitlab", shape = "box"] "[root] null_resource.dev (expand)" [label = "null_resource.dev", shape = "box"] - "[root] provider[\"mckayla.dev/coder/coder\"]" [label = "provider[\"mckayla.dev/coder/coder\"]", shape = "diamond"] + "[root] provider[\"registry.terraform.io/coder/coder\"]" [label = "provider[\"registry.terraform.io/coder/coder\"]", shape = "diamond"] "[root] provider[\"registry.terraform.io/hashicorp/null\"]" [label = "provider[\"registry.terraform.io/hashicorp/null\"]", shape = "diamond"] - "[root] coder_agent.main (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" - "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" - "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"mckayla.dev/coder/coder\"]" + "[root] coder_agent.main (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_external_auth.github (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" + "[root] data.coder_external_auth.gitlab (expand)" -> "[root] provider[\"registry.terraform.io/coder/coder\"]" "[root] null_resource.dev (expand)" -> "[root] coder_agent.main (expand)" "[root] null_resource.dev (expand)" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"]" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" - "[root] provider[\"mckayla.dev/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] coder_agent.main (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_external_auth.github (expand)" + "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" -> "[root] data.coder_external_auth.gitlab (expand)" "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" -> "[root] null_resource.dev (expand)" - "[root] root" -> "[root] provider[\"mckayla.dev/coder/coder\"] (close)" + "[root] root" -> "[root] provider[\"registry.terraform.io/coder/coder\"] (close)" "[root] root" -> "[root] provider[\"registry.terraform.io/hashicorp/null\"] (close)" } } diff --git a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json index b3f7f1055ddc2..21f66e44b607b 100644 --- a/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json +++ b/provisioner/terraform/testdata/external-auth-providers/external-auth-providers.tfstate.json @@ -9,7 +9,7 @@ "mode": "data", "type": "coder_external_auth", "name": "github", - "provider_name": "coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "access_token": "", @@ -23,7 +23,7 @@ "mode": "data", "type": "coder_external_auth", "name": "gitlab", - "provider_name": "coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "access_token": "", @@ -37,7 +37,7 @@ "mode": "managed", "type": "coder_agent", "name": "main", - "provider_name": "coder/coder", + "provider_name": "registry.terraform.io/coder/coder", "schema_version": 0, "values": { "arch": "amd64", @@ -54,7 +54,7 @@ } ], "env": null, - "id": "0828db62-9f9d-4c46-b38c-c33dada8acfb", + "id": "d1f23602-ef8e-4ecf-aa5a-df8aa476344e", "init_script": "", "login_before_ready": true, "metadata": [], @@ -65,7 +65,7 @@ "startup_script": null, "startup_script_behavior": null, "startup_script_timeout": 300, - "token": "bdbedf59-0c71-4f2e-97c2-8b70b5bfb7c8", + "token": "90440015-11c8-442b-adba-9f2bd279b5c7", "troubleshooting_url": null }, "sensitive_values": { @@ -84,7 +84,7 @@ "provider_name": "registry.terraform.io/hashicorp/null", "schema_version": 0, "values": { - "id": "3979535131521307934", + "id": "8183284779544326910", "triggers": null }, "sensitive_values": {}, From 48267a47cdadd1eaaff35f88f6b60812fb167b6f Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 23:19:44 +0000 Subject: [PATCH 09/27] add default first in up migration --- .../migrations/000190_external_auth_providers_jsonb.down.sql | 4 ++-- .../migrations/000190_external_auth_providers_jsonb.up.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql index 9d64e063ea922..292daed90650c 100644 --- a/coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql +++ b/coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql @@ -22,10 +22,10 @@ $$; -- Remove the non-null constraint and default -ALTER TABLE template_versions - ALTER COLUMN external_auth_providers DROP NOT NULL; ALTER TABLE template_versions ALTER COLUMN external_auth_providers DROP DEFAULT; +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers DROP NOT NULL; -- Update the column type and migrate the values diff --git a/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql index 901396fb178c2..dc4206f19d7c1 100644 --- a/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql +++ b/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql @@ -27,10 +27,10 @@ ALTER TABLE template_versions -- Make the column non-nullable to make the types nicer on the Go side -ALTER TABLE template_versions - ALTER COLUMN external_auth_providers SET NOT NULL; ALTER TABLE template_versions ALTER COLUMN external_auth_providers SET DEFAULT '[]'::jsonb; +ALTER TABLE template_versions + ALTER COLUMN external_auth_providers SET NOT NULL; -- Recreate `template_version_with_user` as described in dump.sql From e87066791e4eea53e41baa4ee1be526f615f865a Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 12 Feb 2024 23:34:32 +0000 Subject: [PATCH 10/27] manually default --- .gitattributes | 1 + .../migrations/000190_external_auth_providers_jsonb.up.sql | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index d19626bd6d743..f0de93c49a5fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,5 +11,6 @@ provisionersdk/proto/*.go linguist-generated=true *.tfstate.json linguist-generated=true *.tfstate.dot linguist-generated=true *.tfplan.dot linguist-generated=true +site/e2e/provisionerGenerated.ts linguist-generated=true site/src/api/typesGenerated.ts linguist-generated=true site/src/pages/SetupPage/countries.tsx linguist-generated=true diff --git a/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql index dc4206f19d7c1..767329a44041c 100644 --- a/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql +++ b/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql @@ -27,6 +27,9 @@ ALTER TABLE template_versions -- Make the column non-nullable to make the types nicer on the Go side +UPDATE template_versions + SET external_auth_providers = '[]'::jsonb + WHERE external_auth_providers IS NULL; ALTER TABLE template_versions ALTER COLUMN external_auth_providers SET DEFAULT '[]'::jsonb; ALTER TABLE template_versions From d58c0889a138a671fbda094140bd6b6357342556 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 13 Feb 2024 18:04:44 +0000 Subject: [PATCH 11/27] connect with correct version --- codersdk/provisionerdaemons.go | 1 + enterprise/coderd/provisionerdaemons.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codersdk/provisionerdaemons.go b/codersdk/provisionerdaemons.go index e8f8ed8eb6c8b..2181eacddf24e 100644 --- a/codersdk/provisionerdaemons.go +++ b/codersdk/provisionerdaemons.go @@ -199,6 +199,7 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione return nil, xerrors.Errorf("parse url: %w", err) } query := serverURL.Query() + query.Add("version", proto.CurrentVersion.String()) query.Add("id", req.ID.String()) query.Add("name", req.Name) for _, provisioner := range req.Provisioners { diff --git a/enterprise/coderd/provisionerdaemons.go b/enterprise/coderd/provisionerdaemons.go index f8d5e314c7c87..709cce3fa698c 100644 --- a/enterprise/coderd/provisionerdaemons.go +++ b/enterprise/coderd/provisionerdaemons.go @@ -209,7 +209,7 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request) return } - provisioners := make([]database.ProvisionerType, 0) + provisioners := make([]database.ProvisionerType, 0, len(provisionersMap)) for p := range provisionersMap { switch p { case codersdk.ProvisionerTypeTerraform: From 79ad9da0de118802e642591da22ea3e396e05606 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 14 Feb 2024 18:20:46 +0000 Subject: [PATCH 12/27] land the backend changes separately --- .../CreateWorkspacePageView.stories.tsx | 25 ------------------- .../CreateWorkspacePageView.tsx | 4 +-- .../ExternalAuthBanner.stories.tsx} | 10 ++++---- .../ExternalAuthBanner.tsx} | 12 ++++----- .../ExternalAuthItem.stories.tsx | 2 +- .../ExternalAuthItem.test.tsx | 0 .../ExternalAuthItem.tsx | 4 --- 7 files changed, 14 insertions(+), 43 deletions(-) rename site/src/pages/CreateWorkspacePage/{ExternalAuthWall/ExternalAuthWall.stories.tsx => ExternalAuthBanner/ExternalAuthBanner.stories.tsx} (70%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthWall/ExternalAuthWall.tsx => ExternalAuthBanner/ExternalAuthBanner.tsx} (84%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthWall => ExternalAuthBanner}/ExternalAuthItem.stories.tsx (93%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthWall => ExternalAuthBanner}/ExternalAuthItem.test.tsx (100%) rename site/src/pages/CreateWorkspacePage/{ExternalAuthWall => ExternalAuthBanner}/ExternalAuthItem.tsx (95%) diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx index e3197c96c4f97..5662f96338ef6 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx @@ -130,28 +130,3 @@ export const RequiresExternalAuth: Story = { ], }, }; - -export const OptionalExternalAuth: Story = { - args: { - externalAuth: [ - { - id: "github", - type: "github", - authenticated: false, - authenticate_url: "", - display_icon: "/icon/github.svg", - display_name: "GitHub", - optional: true, - }, - { - id: "gitlab", - type: "gitlab", - authenticated: true, - authenticate_url: "", - display_icon: "/icon/gitlab.svg", - display_name: "GitLab", - optional: true, - }, - ], - }, -}; diff --git a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx index a1e3b25fea54c..1d2cdcf660a4f 100644 --- a/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx +++ b/site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx @@ -42,7 +42,7 @@ import { CreateWorkspaceMode, ExternalAuthPollingState, } from "./CreateWorkspacePage"; -import { ExternalAuthWall } from "./ExternalAuthWall/ExternalAuthWall"; +import { ExternalAuthBanner } from "./ExternalAuthBanner/ExternalAuthBanner"; import { CreateWSPermissions } from "./permissions"; export const Language = { @@ -172,7 +172,7 @@ export const CreateWorkspacePageView: FC = ({ {requiresExternalAuth ? ( - = { - title: "pages/CreateWorkspacePage/ExternalAuthWall", - component: ExternalAuthWall, +const meta: Meta = { + title: "pages/CreateWorkspacePage/ExternalAuthBanner", + component: ExternalAuthBanner, }; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const Default: Story = { args: { diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx similarity index 84% rename from site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx index 9152afbeac50f..ee8e4b47f546d 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthWall.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner.tsx @@ -1,16 +1,16 @@ -import { type Interpolation, type Theme } from "@emotion/react"; -import { type FC } from "react"; -import { type TemplateVersionExternalAuth } from "api/typesGenerated"; -import { type ExternalAuthPollingState } from "../CreateWorkspacePage"; +import { Interpolation, Theme } from "@emotion/react"; +import { TemplateVersionExternalAuth } from "api/typesGenerated"; +import { ExternalAuthPollingState } from "../CreateWorkspacePage"; import { ExternalAuthItem } from "./ExternalAuthItem"; +import { FC } from "react"; -type ExternalAuthWallProps = { +type ExternalAuthBannerProps = { providers: TemplateVersionExternalAuth[]; pollingState: ExternalAuthPollingState; onStartPolling: () => void; }; -export const ExternalAuthWall: FC = ({ +export const ExternalAuthBanner: FC = ({ providers, pollingState, onStartPolling, diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.stories.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.stories.tsx similarity index 93% rename from site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.stories.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.stories.tsx index 505f7ef8cab35..a60b3e317c19e 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.stories.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.stories.tsx @@ -12,7 +12,7 @@ const MockExternalAuth: TemplateVersionExternalAuth = { }; const meta: Meta = { - title: "pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem", + title: "pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem", component: ExternalAuthItem, decorators: [ (Story) => ( diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.test.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.test.tsx similarity index 100% rename from site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.test.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.test.tsx diff --git a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx similarity index 95% rename from site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx rename to site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx index 3f1116c40aba2..45d5e6057875e 100644 --- a/site/src/pages/CreateWorkspacePage/ExternalAuthWall/ExternalAuthItem.tsx +++ b/site/src/pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthItem.tsx @@ -6,7 +6,6 @@ import { ExternalImage } from "components/ExternalImage/ExternalImage"; import { FC, useEffect, useState } from "react"; // eslint-disable-next-line no-restricted-imports -- used to allow extension with "component" import Box, { BoxProps } from "@mui/material/Box"; -import { Pill } from "components/Pill/Pill"; type Status = "idle" | "connecting"; @@ -37,9 +36,6 @@ export const ExternalAuthItem: FC = ({ {provider.display_name} - {!provider.authenticated && provider.optional && ( - Optional - )} {provider.authenticated ? ( From 6746f8808033a082144d50b2d9b12e744fad6175 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 14 Feb 2024 18:22:02 +0000 Subject: [PATCH 13/27] fix migration order --- ...onb.down.sql => 000192_external_auth_providers_jsonb.down.sql} | 0 ...s_jsonb.up.sql => 000192_external_auth_providers_jsonb.up.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename coderd/database/migrations/{000190_external_auth_providers_jsonb.down.sql => 000192_external_auth_providers_jsonb.down.sql} (100%) rename coderd/database/migrations/{000190_external_auth_providers_jsonb.up.sql => 000192_external_auth_providers_jsonb.up.sql} (100%) diff --git a/coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000192_external_auth_providers_jsonb.down.sql similarity index 100% rename from coderd/database/migrations/000190_external_auth_providers_jsonb.down.sql rename to coderd/database/migrations/000192_external_auth_providers_jsonb.down.sql diff --git a/coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000192_external_auth_providers_jsonb.up.sql similarity index 100% rename from coderd/database/migrations/000190_external_auth_providers_jsonb.up.sql rename to coderd/database/migrations/000192_external_auth_providers_jsonb.up.sql From cb7ab9acb79cb4d2ead31c035f0b6060f28360d5 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 14 Feb 2024 19:16:00 +0000 Subject: [PATCH 14/27] version.go is not generated --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index f0de93c49a5fa..9ab121cf76312 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,7 +6,9 @@ coderd/apidoc/swagger.json linguist-generated=true coderd/database/dump.sql linguist-generated=true peerbroker/proto/*.go linguist-generated=true provisionerd/proto/*.go linguist-generated=true +provisionerd/proto/version.go linguist-generated=false provisionersdk/proto/*.go linguist-generated=true +provisionersdk/proto/version.go linguist-generated=false *.tfplan.json linguist-generated=true *.tfstate.json linguist-generated=true *.tfstate.dot linguist-generated=true From 3bacc70e80ca1ef8b148b17190d4e7a8adef1e63 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 15 Feb 2024 00:08:19 +0000 Subject: [PATCH 15/27] it could just all go away --- codersdk/provisionerdaemons.go | 1 - 1 file changed, 1 deletion(-) diff --git a/codersdk/provisionerdaemons.go b/codersdk/provisionerdaemons.go index 2181eacddf24e..e8f8ed8eb6c8b 100644 --- a/codersdk/provisionerdaemons.go +++ b/codersdk/provisionerdaemons.go @@ -199,7 +199,6 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione return nil, xerrors.Errorf("parse url: %w", err) } query := serverURL.Query() - query.Add("version", proto.CurrentVersion.String()) query.Add("id", req.ID.String()) query.Add("name", req.Name) for _, provisioner := range req.Provisioners { From 28a878df2a217c72c6ff775173c971a97f844f08 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 15 Feb 2024 16:50:43 +0000 Subject: [PATCH 16/27] Revert "it could just all go away" This reverts commit 3bacc70e80ca1ef8b148b17190d4e7a8adef1e63. --- codersdk/provisionerdaemons.go | 1 + 1 file changed, 1 insertion(+) diff --git a/codersdk/provisionerdaemons.go b/codersdk/provisionerdaemons.go index e8f8ed8eb6c8b..2181eacddf24e 100644 --- a/codersdk/provisionerdaemons.go +++ b/codersdk/provisionerdaemons.go @@ -199,6 +199,7 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione return nil, xerrors.Errorf("parse url: %w", err) } query := serverURL.Query() + query.Add("version", proto.CurrentVersion.String()) query.Add("id", req.ID.String()) query.Add("name", req.Name) for _, provisioner := range req.Provisioners { From 892a79b56a5b59e1ddfa1deacd862b8f246ed7c4 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 15 Feb 2024 18:03:55 +0000 Subject: [PATCH 17/27] change tested version --- enterprise/cli/provisionerdaemons_test.go | 9 +++--- enterprise/coderd/provisionerdaemons_test.go | 32 ++++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/enterprise/cli/provisionerdaemons_test.go b/enterprise/cli/provisionerdaemons_test.go index 3651971e8f9c5..98526d1014a01 100644 --- a/enterprise/cli/provisionerdaemons_test.go +++ b/enterprise/cli/provisionerdaemons_test.go @@ -14,6 +14,7 @@ import ( "github.com/coder/coder/v2/codersdk" "github.com/coder/coder/v2/enterprise/coderd/coderdenttest" "github.com/coder/coder/v2/enterprise/coderd/license" + "github.com/coder/coder/v2/provisionerd/proto" "github.com/coder/coder/v2/provisionersdk" "github.com/coder/coder/v2/pty/ptytest" "github.com/coder/coder/v2/testutil" @@ -51,7 +52,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) { require.Equal(t, "matt-daemon", daemons[0].Name) require.Equal(t, provisionersdk.ScopeOrganization, daemons[0].Tags[provisionersdk.TagScope]) require.Equal(t, buildinfo.Version(), daemons[0].Version) - require.Equal(t, provisionersdk.VersionCurrent.String(), daemons[0].APIVersion) + require.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion) } func TestProvisionerDaemon_SessionToken(t *testing.T) { @@ -88,7 +89,7 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) { assert.Equal(t, provisionersdk.ScopeUser, daemons[0].Tags[provisionersdk.TagScope]) assert.Equal(t, anotherUser.ID.String(), daemons[0].Tags[provisionersdk.TagOwner]) assert.Equal(t, buildinfo.Version(), daemons[0].Version) - assert.Equal(t, provisionersdk.VersionCurrent.String(), daemons[0].APIVersion) + assert.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion) }) t.Run("ScopeAnotherUser", func(t *testing.T) { @@ -124,7 +125,7 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) { // This should get clobbered to the user who started the daemon. assert.Equal(t, anotherUser.ID.String(), daemons[0].Tags[provisionersdk.TagOwner]) assert.Equal(t, buildinfo.Version(), daemons[0].Version) - assert.Equal(t, provisionersdk.VersionCurrent.String(), daemons[0].APIVersion) + assert.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion) }) t.Run("ScopeOrg", func(t *testing.T) { @@ -158,6 +159,6 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) { assert.Equal(t, "org-daemon", daemons[0].Name) assert.Equal(t, provisionersdk.ScopeOrganization, daemons[0].Tags[provisionersdk.TagScope]) assert.Equal(t, buildinfo.Version(), daemons[0].Version) - assert.Equal(t, provisionersdk.VersionCurrent.String(), daemons[0].APIVersion) + assert.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion) }) } diff --git a/enterprise/coderd/provisionerdaemons_test.go b/enterprise/coderd/provisionerdaemons_test.go index ac48e21cdd14f..0d237b1ea09ad 100644 --- a/enterprise/coderd/provisionerdaemons_test.go +++ b/enterprise/coderd/provisionerdaemons_test.go @@ -23,9 +23,9 @@ import ( "github.com/coder/coder/v2/enterprise/coderd/license" "github.com/coder/coder/v2/provisioner/echo" "github.com/coder/coder/v2/provisionerd" - provisionerdproto "github.com/coder/coder/v2/provisionerd/proto" + "github.com/coder/coder/v2/provisionerd/proto" "github.com/coder/coder/v2/provisionersdk" - "github.com/coder/coder/v2/provisionersdk/proto" + sdkproto "github.com/coder/coder/v2/provisionersdk/proto" "github.com/coder/coder/v2/testutil" ) @@ -59,7 +59,7 @@ func TestProvisionerDaemonServe(t *testing.T) { if assert.Len(t, daemons, 1) { assert.Equal(t, daemonName, daemons[0].Name) assert.Equal(t, buildinfo.Version(), daemons[0].Version) - assert.Equal(t, provisionersdk.VersionCurrent.String(), daemons[0].APIVersion) + assert.Equal(t, proto.CurrentVersion.String(), daemons[0].APIVersion) } }) @@ -154,13 +154,13 @@ func TestProvisionerDaemonServe(t *testing.T) { authToken := uuid.NewString() data, err := echo.Tar(&echo.Responses{ Parse: echo.ParseComplete, - ProvisionPlan: []*proto.Response{{ - Type: &proto.Response_Plan{ - Plan: &proto.PlanComplete{ - Resources: []*proto.Resource{{ + ProvisionPlan: []*sdkproto.Response{{ + Type: &sdkproto.Response_Plan{ + Plan: &sdkproto.PlanComplete{ + Resources: []*sdkproto.Resource{{ Name: "example", Type: "aws_instance", - Agents: []*proto.Agent{{ + Agents: []*sdkproto.Agent{{ Id: uuid.NewString(), Name: "example", }}, @@ -278,10 +278,10 @@ func TestProvisionerDaemonServe(t *testing.T) { }() connector := provisionerd.LocalProvisioners{ - string(database.ProvisionerTypeEcho): proto.NewDRPCProvisionerClient(terraformClient), + string(database.ProvisionerTypeEcho): sdkproto.NewDRPCProvisionerClient(terraformClient), } another := codersdk.New(client.URL) - pd := provisionerd.New(func(ctx context.Context) (provisionerdproto.DRPCProvisionerDaemonClient, error) { + pd := provisionerd.New(func(ctx context.Context) (proto.DRPCProvisionerDaemonClient, error) { return another.ServeProvisionerDaemon(ctx, codersdk.ServeProvisionerDaemonRequest{ ID: uuid.New(), Name: testutil.MustRandString(t, 63), @@ -310,17 +310,17 @@ func TestProvisionerDaemonServe(t *testing.T) { authToken := uuid.NewString() version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{ Parse: echo.ParseComplete, - ProvisionApply: []*proto.Response{{ - Type: &proto.Response_Apply{ - Apply: &proto.ApplyComplete{ - Resources: []*proto.Resource{{ + ProvisionApply: []*sdkproto.Response{{ + Type: &sdkproto.Response_Apply{ + Apply: &sdkproto.ApplyComplete{ + Resources: []*sdkproto.Resource{{ Name: "example", Type: "aws_instance", DailyCost: 1, - Agents: []*proto.Agent{{ + Agents: []*sdkproto.Agent{{ Id: uuid.NewString(), Name: "example", - Auth: &proto.Agent_Token{ + Auth: &sdkproto.Agent_Token{ Token: authToken, }, }}, From c5e63eb5648c83ec671ded3868bf2a65864c6516 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 15 Feb 2024 19:15:32 +0000 Subject: [PATCH 18/27] add `database.ExternalAuthProviders` type --- coderd/database/types.go | 5 +++ .../provisionerdserver/provisionerdserver.go | 37 +++++++++++-------- .../provisionerdserver_test.go | 5 ++- coderd/templateversions.go | 6 +-- coderd/templateversions_test.go | 3 +- provisionerd/runner/runner.go | 15 ++++++-- 6 files changed, 47 insertions(+), 24 deletions(-) diff --git a/coderd/database/types.go b/coderd/database/types.go index d49a06d7c3786..f21a3d46f50b7 100644 --- a/coderd/database/types.go +++ b/coderd/database/types.go @@ -64,6 +64,11 @@ func (t TemplateACL) Value() (driver.Value, error) { return json.Marshal(t) } +type ExternalAuthProvider struct { + ID string `json:"id"` + Optional bool `json:"optional,omitempty"` +} + type StringMap map[string]string func (m *StringMap) Scan(src interface{}) error { diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 49fe5ad4daa48..8fd034b44659d 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -501,16 +501,16 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo return nil, failJob(fmt.Sprintf("get workspace build parameters: %s", err)) } - externalAuthProviderResources := []*sdkproto.ExternalAuthProviderResource{} - err = json.Unmarshal(templateVersion.ExternalAuthProviders, &externalAuthProviderResources) + dbExternalAuthProviders := []database.ExternalAuthProvider{} + err = json.Unmarshal(templateVersion.ExternalAuthProviders, &dbExternalAuthProviders) if err != nil { return nil, xerrors.Errorf("failed to deserialize external_auth_providers value: %w", err) } - externalAuthProviders := []*sdkproto.ExternalAuthProvider{} - for _, p := range externalAuthProviderResources { + externalAuthProviders := make([]*sdkproto.ExternalAuthProvider, 0, len(dbExternalAuthProviders)) + for _, p := range dbExternalAuthProviders { link, err := s.Database.GetExternalAuthLink(ctx, database.GetExternalAuthLinkParams{ - ProviderID: p.Id, + ProviderID: p.ID, UserID: owner.ID, }) if errors.Is(err, sql.ErrNoRows) { @@ -521,7 +521,7 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo } var config *externalauth.Config for _, c := range s.ExternalAuthConfigs { - if c.ID != p.Id { + if c.ID != p.ID { continue } config = c @@ -530,7 +530,7 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo // We weren't able to find a matching config for the ID! if config == nil { s.Logger.Warn(ctx, "workspace build job is missing external auth provider", - slog.F("provider_id", p.Id), + slog.F("provider_id", p.ID), slog.F("template_version_id", templateVersion.ID), slog.F("workspace_id", workspaceBuild.WorkspaceID)) continue @@ -538,13 +538,13 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo link, valid, err := config.RefreshToken(ctx, s.Database, link) if err != nil { - return nil, failJob(fmt.Sprintf("refresh external auth link %q: %s", p.Id, err)) + return nil, failJob(fmt.Sprintf("refresh external auth link %q: %s", p.ID, err)) } if !valid { continue } externalAuthProviders = append(externalAuthProviders, &sdkproto.ExternalAuthProvider{ - Id: p.Id, + Id: p.ID, AccessToken: link.OAuthAccessToken, }) } @@ -1153,16 +1153,23 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) } } - externalAuthProviders := jobType.TemplateImport.ExternalAuthProviders // Fallback to `ExternalAuthProvidersNames` if it was specified and `ExternalAuthProviders` // was not. Gives us backwards compatibility with custom provisioners that haven't been // updated to use the new field yet. - namesLen := len(jobType.TemplateImport.ExternalAuthProvidersNames) - if len(externalAuthProviders) == 0 && namesLen > 0 { - externalAuthProviders = make([]*sdkproto.ExternalAuthProviderResource, 0, namesLen) + var externalAuthProviders []database.ExternalAuthProvider + if providersLen := len(jobType.TemplateImport.ExternalAuthProviders); providersLen > 0 { + externalAuthProviders = make([]database.ExternalAuthProvider, 0, providersLen) + for _, provider := range jobType.TemplateImport.ExternalAuthProviders { + externalAuthProviders = append(externalAuthProviders, database.ExternalAuthProvider{ + ID: provider.Id, + Optional: provider.Optional, + }) + } + } else if namesLen := len(jobType.TemplateImport.ExternalAuthProvidersNames); namesLen > 0 { + externalAuthProviders = make([]database.ExternalAuthProvider, 0, namesLen) for _, providerID := range jobType.TemplateImport.ExternalAuthProvidersNames { - externalAuthProviders = append(externalAuthProviders, &sdkproto.ExternalAuthProviderResource{ - Id: providerID, + externalAuthProviders = append(externalAuthProviders, database.ExternalAuthProvider{ + ID: providerID, }) } } diff --git a/coderd/provisionerdserver/provisionerdserver_test.go b/coderd/provisionerdserver/provisionerdserver_test.go index 444a72e064a28..4e39aa691afc3 100644 --- a/coderd/provisionerdserver/provisionerdserver_test.go +++ b/coderd/provisionerdserver/provisionerdserver_test.go @@ -210,7 +210,10 @@ func TestAcquireJob(t *testing.T) { }, JobID: uuid.New(), }) - externalAuthProviders, err := json.Marshal([]*sdkproto.ExternalAuthProviderResource{gitAuthProvider}) + externalAuthProviders, err := json.Marshal([]database.ExternalAuthProvider{{ + ID: gitAuthProvider.Id, + Optional: gitAuthProvider.Optional, + }}) require.NoError(t, err) err = db.UpdateTemplateVersionExternalAuthProvidersByJobID(ctx, database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ JobID: version.JobID, diff --git a/coderd/templateversions.go b/coderd/templateversions.go index 3be7c461165ec..627e72f023f7b 100644 --- a/coderd/templateversions.go +++ b/coderd/templateversions.go @@ -289,7 +289,7 @@ func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Requ templateVersion = httpmw.TemplateVersionParam(r) ) - var rawProviders []*sdkproto.ExternalAuthProviderResource + var rawProviders []database.ExternalAuthProvider err := json.Unmarshal(templateVersion.ExternalAuthProviders, &rawProviders) if err != nil { httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ @@ -303,14 +303,14 @@ func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Requ for _, rawProvider := range rawProviders { var config *externalauth.Config for _, provider := range api.ExternalAuthConfigs { - if provider.ID == rawProvider.Id { + if provider.ID == rawProvider.ID { config = provider break } } if config == nil { httpapi.Write(ctx, rw, http.StatusNotFound, codersdk.Response{ - Message: fmt.Sprintf("The template version references a Git auth provider %q that no longer exists.", rawProvider), + Message: fmt.Sprintf("The template version references a Git auth provider %q that no longer exists.", rawProvider.ID), Detail: "You'll need to update the template version to use a different provider.", }) return diff --git a/coderd/templateversions_test.go b/coderd/templateversions_test.go index c388eb1413636..3089b4eecf3e1 100644 --- a/coderd/templateversions_test.go +++ b/coderd/templateversions_test.go @@ -347,7 +347,7 @@ func TestTemplateVersionsExternalAuth(t *testing.T) { ProvisionPlan: []*proto.Response{{ Type: &proto.Response_Plan{ Plan: &proto.PlanComplete{ - ExternalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github"}}, + ExternalAuthProviders: []*proto.ExternalAuthProviderResource{{Id: "github", Optional: true}}, }, }, }}, @@ -373,6 +373,7 @@ func TestTemplateVersionsExternalAuth(t *testing.T) { require.NoError(t, err) require.Len(t, providers, 1) require.True(t, providers[0].Authenticated) + require.True(t, providers[0].Optional) }) } diff --git a/provisionerd/runner/runner.go b/provisionerd/runner/runner.go index 3159df9055a21..d68759f48102e 100644 --- a/provisionerd/runner/runner.go +++ b/provisionerd/runner/runner.go @@ -564,14 +564,21 @@ func (r *Runner) runTemplateImport(ctx context.Context) (*proto.CompletedJob, *p return nil, r.failedJobf("template import provision for stop: %s", err) } + // For backwards compatibility with older versions of coderd + externalAuthProviderNames := make([]string, 0, len(startProvision.ExternalAuthProviders)) + for _, it := range startProvision.ExternalAuthProviders { + externalAuthProviderNames = append(externalAuthProviderNames, it.Id) + } + return &proto.CompletedJob{ JobId: r.job.JobId, Type: &proto.CompletedJob_TemplateImport_{ TemplateImport: &proto.CompletedJob_TemplateImport{ - StartResources: startProvision.Resources, - StopResources: stopProvision.Resources, - RichParameters: startProvision.Parameters, - ExternalAuthProviders: startProvision.ExternalAuthProviders, + StartResources: startProvision.Resources, + StopResources: stopProvision.Resources, + RichParameters: startProvision.Parameters, + ExternalAuthProvidersNames: externalAuthProviderNames, + ExternalAuthProviders: startProvision.ExternalAuthProviders, }, }, }, nil From ea81a1f733dfab21802a79801b397cba8d4a5402 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 16 Feb 2024 18:01:38 +0000 Subject: [PATCH 19/27] `drop` migration functions --- .../migrations/000194_external_auth_providers_jsonb.down.sql | 4 ++++ .../migrations/000194_external_auth_providers_jsonb.up.sql | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql index 292daed90650c..aad5910d3240e 100644 --- a/coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql +++ b/coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql @@ -53,3 +53,7 @@ SELECT COALESCE(visible_users.username, ''::text) AS created_by_username FROM (public.template_versions LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); + + +-- Cleanup +DROP FUNCTION revert_migrate_external_auth_providers_to_jsonb; diff --git a/coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql index 767329a44041c..b45b49b5a6ba4 100644 --- a/coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql +++ b/coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql @@ -55,3 +55,7 @@ SELECT COALESCE(visible_users.username, ''::text) AS created_by_username FROM (public.template_versions LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); + + +-- Cleanup +DROP FUNCTION migrate_external_auth_providers_to_jsonb; From 2376357cf9f1f8b3470b77de6e8e677a5d593e11 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 16 Feb 2024 22:10:29 +0000 Subject: [PATCH 20/27] `make gen` --- coderd/database/dump.sql | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index fc2f76f18dfe1..15080331d9de2 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -215,20 +215,6 @@ BEGIN END; $$; -CREATE FUNCTION migrate_external_auth_providers_to_jsonb(text[]) RETURNS jsonb - LANGUAGE plpgsql - AS $_$ -DECLARE - result jsonb; -BEGIN - SELECT - jsonb_agg(jsonb_build_object('id', value::text)) INTO result - FROM - unnest($1) AS value; - RETURN result; -END; -$_$; - CREATE FUNCTION tailnet_notify_agent_change() RETURNS trigger LANGUAGE plpgsql AS $$ From b2b9e95357cb571a16ce9828ba50dbfa9f3a6163 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Fri, 16 Feb 2024 22:22:00 +0000 Subject: [PATCH 21/27] =?UTF-8?q?=F0=9F=86=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- provisionerd/proto/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisionerd/proto/version.go b/provisionerd/proto/version.go index 62d0274071312..dbb34dd4c3798 100644 --- a/provisionerd/proto/version.go +++ b/provisionerd/proto/version.go @@ -1,7 +1,7 @@ package proto import ( - "github.com/coder/coder/v2/coderd/util/apiversion" + "github.com/coder/coder/v2/apiversion" ) const ( From 04579dee40537655e8e44c5698f463f10be8db86 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 20 Feb 2024 20:02:48 +0000 Subject: [PATCH 22/27] no such file --- .gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 9ab121cf76312..8ce104016a6b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,7 +8,6 @@ peerbroker/proto/*.go linguist-generated=true provisionerd/proto/*.go linguist-generated=true provisionerd/proto/version.go linguist-generated=false provisionersdk/proto/*.go linguist-generated=true -provisionersdk/proto/version.go linguist-generated=false *.tfplan.json linguist-generated=true *.tfstate.json linguist-generated=true *.tfstate.dot linguist-generated=true From 7ff56b1ba1c26149062e699283810133fed001d1 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 20 Feb 2024 20:42:36 +0000 Subject: [PATCH 23/27] bump version again --- provisionerd/proto/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisionerd/proto/version.go b/provisionerd/proto/version.go index 5a2311914f217..bb1d4b9988600 100644 --- a/provisionerd/proto/version.go +++ b/provisionerd/proto/version.go @@ -4,7 +4,7 @@ import "github.com/coder/coder/v2/apiversion" const ( CurrentMajor = 1 - CurrentMinor = 0 + CurrentMinor = 1 ) // CurrentVersion is the current provisionerd API version. From 16ba268e482e6e044ea5dcf6449a0529444c76bd Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 20 Feb 2024 20:45:02 +0000 Subject: [PATCH 24/27] update test --- enterprise/coderd/provisionerdaemons_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprise/coderd/provisionerdaemons_test.go b/enterprise/coderd/provisionerdaemons_test.go index 5974332894f00..362aaee427be2 100644 --- a/enterprise/coderd/provisionerdaemons_test.go +++ b/enterprise/coderd/provisionerdaemons_test.go @@ -165,7 +165,7 @@ func TestProvisionerDaemonServe(t *testing.T) { b, err := io.ReadAll(resp.Body) require.NoError(t, err) // The below means that provisionerd tried to serve us, checked our api version, and said nope. - require.Contains(t, string(b), "server is at version 1.0, behind requested major version 2.1") + require.Contains(t, string(b), fmt.Sprintf("server is at version %s, behind requested major version %s", proto.CurrentVersion.String(), v.String())) }) t.Run("NoLicense", func(t *testing.T) { From 328202a224789ed33fac711216dc3bb8655bff5a Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 21 Feb 2024 00:46:38 +0000 Subject: [PATCH 25/27] fix migration numbers --- ...onb.down.sql => 000196_external_auth_providers_jsonb.down.sql} | 0 ...s_jsonb.up.sql => 000196_external_auth_providers_jsonb.up.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename coderd/database/migrations/{000194_external_auth_providers_jsonb.down.sql => 000196_external_auth_providers_jsonb.down.sql} (100%) rename coderd/database/migrations/{000194_external_auth_providers_jsonb.up.sql => 000196_external_auth_providers_jsonb.up.sql} (100%) diff --git a/coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql similarity index 100% rename from coderd/database/migrations/000194_external_auth_providers_jsonb.down.sql rename to coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql diff --git a/coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql similarity index 100% rename from coderd/database/migrations/000194_external_auth_providers_jsonb.up.sql rename to coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql From 353e6a3ba351a859d876c77a92352603592c6351 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 21 Feb 2024 17:51:00 +0000 Subject: [PATCH 26/27] `COMMENT ON VIEW` --- .../migrations/000196_external_auth_providers_jsonb.down.sql | 2 ++ .../migrations/000196_external_auth_providers_jsonb.up.sql | 2 ++ 2 files changed, 4 insertions(+) diff --git a/coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql b/coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql index aad5910d3240e..cbaa600a8033c 100644 --- a/coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql +++ b/coderd/database/migrations/000196_external_auth_providers_jsonb.down.sql @@ -54,6 +54,8 @@ SELECT FROM (public.template_versions LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); +COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.'; + -- Cleanup DROP FUNCTION revert_migrate_external_auth_providers_to_jsonb; diff --git a/coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql b/coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql index b45b49b5a6ba4..c757c835d5a8c 100644 --- a/coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql +++ b/coderd/database/migrations/000196_external_auth_providers_jsonb.up.sql @@ -56,6 +56,8 @@ SELECT FROM (public.template_versions LEFT JOIN visible_users ON (template_versions.created_by = visible_users.id)); +COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.'; + -- Cleanup DROP FUNCTION migrate_external_auth_providers_to_jsonb; From 1021bc42a3103ef33db14064eec053a777b5680d Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 21 Feb 2024 18:08:50 +0000 Subject: [PATCH 27/27] `make gen` --- coderd/database/dump.sql | 2 ++ coderd/database/models.go | 1 + 2 files changed, 3 insertions(+) diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index 7a64016d8f940..07b4da8ae5bc6 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -880,6 +880,8 @@ CREATE VIEW template_version_with_user AS FROM (public.template_versions LEFT JOIN visible_users ON ((template_versions.created_by = visible_users.id))); +COMMENT ON VIEW template_version_with_user IS 'Joins in the username + avatar url of the created by user.'; + CREATE TABLE templates ( id uuid NOT NULL, created_at timestamp with time zone NOT NULL, diff --git a/coderd/database/models.go b/coderd/database/models.go index faaa0273a7cbb..7336dea1f3328 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -2078,6 +2078,7 @@ type TemplateTable struct { MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"` } +// Joins in the username + avatar url of the created by user. type TemplateVersion struct { ID uuid.UUID `db:"id" json:"id"` TemplateID uuid.NullUUID `db:"template_id" json:"template_id"`