diff --git a/app/cli/cmd/config.go b/app/cli/cmd/config.go index a8809ba70..cd7d1d02d 100644 --- a/app/cli/cmd/config.go +++ b/app/cli/cmd/config.go @@ -49,6 +49,6 @@ func newConfigCmd() *cobra.Command { Short: "Configure this client", } - cmd.AddCommand(newOCIRepositoryCreateCmd(), newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd()) + cmd.AddCommand(newConfigSaveCmd(), newConfigViewCmd(), newConfigResetCmd()) return cmd } diff --git a/app/cli/cmd/config_ocirepository_set.go b/app/cli/cmd/config_ocirepository_set.go deleted file mode 100644 index b2da9fb10..000000000 --- a/app/cli/cmd/config_ocirepository_set.go +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package cmd - -import ( - "github.com/chainloop-dev/chainloop/app/cli/internal/action" - "github.com/spf13/cobra" -) - -func newOCIRepositoryCreateCmd() *cobra.Command { - var repo, username, password string - - cmd := &cobra.Command{ - Use: "set-oci-repo", - Deprecated: "use 'chainloop cas-backend' instead", - Short: "Set the OCI repository associated with your current org", - RunE: func(cmd *cobra.Command, args []string) error { - opts := &action.NewOCIRepositorySaveOpts{ - Repo: repo, Username: username, Password: password, - } - - err := action.NewOCIRepositorySave(actionOpts).Run(opts) - if err != nil { - return err - } - - logger.Info().Msg("repository saved") - return nil - }, - } - - cmd.Flags().StringVar(&repo, "repo", "", "FQDN repository name, including path") - err := cmd.MarkFlagRequired("repo") - cobra.CheckErr(err) - - cmd.Flags().StringVarP(&username, "username", "u", "", "registry username") - err = cmd.MarkFlagRequired("username") - cobra.CheckErr(err) - - cmd.Flags().StringVarP(&password, "password", "p", "", "registry password") - err = cmd.MarkFlagRequired("password") - cobra.CheckErr(err) - - return cmd -} diff --git a/app/cli/cmd/organization_describe.go b/app/cli/cmd/organization_describe.go index fe43dc4af..cdf9e31a9 100644 --- a/app/cli/cmd/organization_describe.go +++ b/app/cli/cmd/organization_describe.go @@ -47,10 +47,10 @@ func contextTableOutput(config *action.ConfigContextItem) error { gt.AppendRow(table.Row{"Logged in as", config.CurrentUser.Email}) gt.AppendSeparator() gt.AppendRow(table.Row{"Organization", config.CurrentOrg.Name}) - repo := config.CurrentOCIRepo - if repo != nil { + backend := config.CurrentCASBackend + if backend != nil { gt.AppendSeparator() - gt.AppendRow(table.Row{"OCI repository", fmt.Sprintf("%s (status=%q)", repo.Repo, repo.ValidationStatus)}) + gt.AppendRow(table.Row{"Default CAS Backend", fmt.Sprintf("%s (provider=%s, status=%q)", backend.Location, backend.Provider, backend.ValidationStatus)}) } gt.Render() diff --git a/app/cli/internal/action/config_current_context.go b/app/cli/internal/action/config_current_context.go index 8ab9dea53..b07e51d4f 100644 --- a/app/cli/internal/action/config_current_context.go +++ b/app/cli/internal/action/config_current_context.go @@ -31,9 +31,9 @@ func NewConfigCurrentContext(cfg *ActionsOpts) *ConfigCurrentContext { } type ConfigContextItem struct { - CurrentUser *ConfigContextItemUser - CurrentOrg *OrgItem - CurrentOCIRepo *ConfigContextItemOCIRepo + CurrentUser *ConfigContextItemUser + CurrentOrg *OrgItem + CurrentCASBackend *CASBackendItem } type ConfigContextItemUser struct { @@ -41,12 +41,6 @@ type ConfigContextItemUser struct { CreatedAt *time.Time } -type ConfigContextItemOCIRepo struct { - ID, Repo string - CreatedAt *time.Time - ValidationStatus ValidationStatus -} - func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) { client := pb.NewContextServiceClient(action.cfg.CPConnection) resp, err := client.Current(context.Background(), &pb.ContextServiceCurrentRequest{}) @@ -56,29 +50,13 @@ func (action *ConfigCurrentContext) Run() (*ConfigContextItem, error) { res := resp.GetResult() - item := &ConfigContextItem{ + return &ConfigContextItem{ CurrentUser: &ConfigContextItemUser{ ID: res.GetCurrentUser().Id, Email: res.GetCurrentUser().Email, CreatedAt: toTimePtr(res.GetCurrentUser().CreatedAt.AsTime()), }, - CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()), - } - - repo := res.GetCurrentOciRepo() - if repo != nil { - r := &ConfigContextItemOCIRepo{ - ID: repo.GetId(), Repo: repo.GetRepo(), CreatedAt: toTimePtr(repo.GetCreatedAt().AsTime()), - } - - switch repo.GetValidationStatus() { - case pb.OCIRepositoryItem_VALIDATION_STATUS_OK: - r.ValidationStatus = Valid - case pb.OCIRepositoryItem_VALIDATION_STATUS_INVALID: - r.ValidationStatus = Invalid - } - - item.CurrentOCIRepo = r - } - return item, nil + CurrentOrg: pbOrgItemToAction(res.GetCurrentOrg()), + CurrentCASBackend: pbCASBackendItemToAction(res.GetCurrentCasBackend()), + }, nil } diff --git a/app/cli/internal/action/ocirepository_save.go b/app/cli/internal/action/ocirepository_save.go deleted file mode 100644 index 3ac5c6c6b..000000000 --- a/app/cli/internal/action/ocirepository_save.go +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package action - -import ( - "context" - - pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1" -) - -type OCIRepositorySave struct { - cfg *ActionsOpts -} - -func NewOCIRepositorySave(cfg *ActionsOpts) *OCIRepositorySave { - return &OCIRepositorySave{cfg} -} - -type NewOCIRepositorySaveOpts struct { - Repo, Username, Password string -} - -func (action *OCIRepositorySave) Run(opts *NewOCIRepositorySaveOpts) error { - client := pb.NewOCIRepositoryServiceClient(action.cfg.CPConnection) - - // Disable SA1019: client.Save is deprecated: Do not use. Save the OCI repository overriding the existing one (for now) (staticcheck) - //nolint:staticcheck - _, err := client.Save(context.Background(), &pb.OCIRepositoryServiceSaveRequest{ - Repository: opts.Repo, - // We currently only support raw keypairs, which does not include AWS keyparis - Credentials: &pb.OCIRepositoryServiceSaveRequest_KeyPair{ - KeyPair: &pb.OCIRepositoryServiceSaveRequest_Keypair{Username: opts.Username, Password: opts.Password}, - }, - }) - if err != nil { - return err - } - - return nil -} diff --git a/app/cli/main.go b/app/cli/main.go index b8ac6cca2..254c10a8d 100644 --- a/app/cli/main.go +++ b/app/cli/main.go @@ -54,9 +54,9 @@ func errorInfo(err error, logger zerolog.Logger) (string, int) { // Make overrides switch { - case v1.IsOciRepositoryErrorReasonRequired(err): + case v1.IsCasBackendErrorReasonRequired(err): msg = "you need to enable a CAS backend first. Refer to `chainloop cas-backend` command or contact your administrator." - case v1.IsOciRepositoryErrorReasonInvalid(err): + case v1.IsCasBackendErrorReasonInvalid(err): msg = "the CAS backend you provided is invalid. Refer to `chainloop cas-backend update` command or contact your administrator." case v1.IsAllowListErrorNotInList(err): msg = "your user is not part of the private beta yet. You can request access at https://docs.chainloop.dev/getting-started/private-beta" diff --git a/app/controlplane/api/buf.lock b/app/controlplane/api/buf.lock index 3ea04d703..57fefd478 100644 --- a/app/controlplane/api/buf.lock +++ b/app/controlplane/api/buf.lock @@ -8,4 +8,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: d1263fe26f8e430a967dc22a4d0cad18 + commit: cc916c31859748a68fd229a3c8d7a2e8 + - remote: buf.build + owner: kratos-go + repository: kratos + commit: e1d52e944e3845c6862a566db322432d diff --git a/app/controlplane/api/buf.yaml b/app/controlplane/api/buf.yaml index 02c51dc2c..68889ba7c 100644 --- a/app/controlplane/api/buf.yaml +++ b/app/controlplane/api/buf.yaml @@ -5,6 +5,7 @@ breaking: deps: - buf.build/googleapis/googleapis - buf.build/envoyproxy/protoc-gen-validate:45685e052c7e406b9fbd441fc7a568a5 + - buf.build/kratos-go/kratos lint: use: - DEFAULT diff --git a/app/controlplane/api/controlplane/v1/cas_backends.pb.go b/app/controlplane/api/controlplane/v1/cas_backends.pb.go index 8f628d569..5045750a7 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends.pb.go +++ b/app/controlplane/api/controlplane/v1/cas_backends.pb.go @@ -23,6 +23,7 @@ package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" + _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" structpb "google.golang.org/protobuf/types/known/structpb" @@ -37,6 +38,57 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type CASBackendErrorReason int32 + +const ( + CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_UNSPECIFIED CASBackendErrorReason = 0 + CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_REQUIRED CASBackendErrorReason = 1 + // The repository does not seem to be operational + // a previous validation has failed + CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_INVALID CASBackendErrorReason = 2 +) + +// Enum value maps for CASBackendErrorReason. +var ( + CASBackendErrorReason_name = map[int32]string{ + 0: "CAS_BACKEND_ERROR_REASON_UNSPECIFIED", + 1: "CAS_BACKEND_ERROR_REASON_REQUIRED", + 2: "CAS_BACKEND_ERROR_REASON_INVALID", + } + CASBackendErrorReason_value = map[string]int32{ + "CAS_BACKEND_ERROR_REASON_UNSPECIFIED": 0, + "CAS_BACKEND_ERROR_REASON_REQUIRED": 1, + "CAS_BACKEND_ERROR_REASON_INVALID": 2, + } +) + +func (x CASBackendErrorReason) Enum() *CASBackendErrorReason { + p := new(CASBackendErrorReason) + *p = x + return p +} + +func (x CASBackendErrorReason) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CASBackendErrorReason) Descriptor() protoreflect.EnumDescriptor { + return file_controlplane_v1_cas_backends_proto_enumTypes[0].Descriptor() +} + +func (CASBackendErrorReason) Type() protoreflect.EnumType { + return &file_controlplane_v1_cas_backends_proto_enumTypes[0] +} + +func (x CASBackendErrorReason) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CASBackendErrorReason.Descriptor instead. +func (CASBackendErrorReason) EnumDescriptor() ([]byte, []int) { + return file_controlplane_v1_cas_backends_proto_rawDescGZIP(), []int{0} +} + type CASBackendServiceListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -476,92 +528,103 @@ var file_controlplane_v1_cas_backends_proto_rawDesc = []byte{ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x58, 0x0a, 0x1d, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, - 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0xeb, 0x01, 0x0a, 0x1e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, - 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0x5a, 0x0a, - 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xb1, 0x01, 0x0a, 0x1e, 0x43, 0x41, - 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xb0, - 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x39, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, - 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0x5a, 0x0a, - 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, 0x0a, 0x1e, 0x43, 0x41, 0x53, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xb0, 0x01, - 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc1, 0x03, 0x0a, 0x11, 0x43, 0x41, 0x53, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, - 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, - 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x41, + 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x58, 0x0a, 0x1d, 0x43, 0x41, + 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, + 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0xeb, 0x01, 0x0a, 0x1e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, + 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x22, 0x5a, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xb1, + 0x01, 0x0a, 0x1e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x18, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, + 0x42, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x39, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x22, 0x5a, 0x0a, 0x1f, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, - 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, + 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x3a, + 0x0a, 0x1e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x41, + 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xa0, 0x01, + 0x0a, 0x15, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x41, 0x53, 0x5f, 0x42, + 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, + 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x2b, 0x0a, 0x21, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x12, 0x2a, + 0x0a, 0x20, 0x43, 0x41, 0x53, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, + 0x32, 0xc1, 0x03, 0x0a, 0x11, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x6b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, + 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, + 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, + 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, + 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -576,38 +639,40 @@ func file_controlplane_v1_cas_backends_proto_rawDescGZIP() []byte { return file_controlplane_v1_cas_backends_proto_rawDescData } +var file_controlplane_v1_cas_backends_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_controlplane_v1_cas_backends_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_controlplane_v1_cas_backends_proto_goTypes = []interface{}{ - (*CASBackendServiceListRequest)(nil), // 0: controlplane.v1.CASBackendServiceListRequest - (*CASBackendServiceListResponse)(nil), // 1: controlplane.v1.CASBackendServiceListResponse - (*CASBackendServiceCreateRequest)(nil), // 2: controlplane.v1.CASBackendServiceCreateRequest - (*CASBackendServiceCreateResponse)(nil), // 3: controlplane.v1.CASBackendServiceCreateResponse - (*CASBackendServiceUpdateRequest)(nil), // 4: controlplane.v1.CASBackendServiceUpdateRequest - (*CASBackendServiceUpdateResponse)(nil), // 5: controlplane.v1.CASBackendServiceUpdateResponse - (*CASBackendServiceDeleteRequest)(nil), // 6: controlplane.v1.CASBackendServiceDeleteRequest - (*CASBackendServiceDeleteResponse)(nil), // 7: controlplane.v1.CASBackendServiceDeleteResponse - (*CASBackendItem)(nil), // 8: controlplane.v1.CASBackendItem - (*structpb.Struct)(nil), // 9: google.protobuf.Struct + (CASBackendErrorReason)(0), // 0: controlplane.v1.CASBackendErrorReason + (*CASBackendServiceListRequest)(nil), // 1: controlplane.v1.CASBackendServiceListRequest + (*CASBackendServiceListResponse)(nil), // 2: controlplane.v1.CASBackendServiceListResponse + (*CASBackendServiceCreateRequest)(nil), // 3: controlplane.v1.CASBackendServiceCreateRequest + (*CASBackendServiceCreateResponse)(nil), // 4: controlplane.v1.CASBackendServiceCreateResponse + (*CASBackendServiceUpdateRequest)(nil), // 5: controlplane.v1.CASBackendServiceUpdateRequest + (*CASBackendServiceUpdateResponse)(nil), // 6: controlplane.v1.CASBackendServiceUpdateResponse + (*CASBackendServiceDeleteRequest)(nil), // 7: controlplane.v1.CASBackendServiceDeleteRequest + (*CASBackendServiceDeleteResponse)(nil), // 8: controlplane.v1.CASBackendServiceDeleteResponse + (*CASBackendItem)(nil), // 9: controlplane.v1.CASBackendItem + (*structpb.Struct)(nil), // 10: google.protobuf.Struct } var file_controlplane_v1_cas_backends_proto_depIdxs = []int32{ - 8, // 0: controlplane.v1.CASBackendServiceListResponse.result:type_name -> controlplane.v1.CASBackendItem - 9, // 1: controlplane.v1.CASBackendServiceCreateRequest.credentials:type_name -> google.protobuf.Struct - 8, // 2: controlplane.v1.CASBackendServiceCreateResponse.result:type_name -> controlplane.v1.CASBackendItem - 9, // 3: controlplane.v1.CASBackendServiceUpdateRequest.credentials:type_name -> google.protobuf.Struct - 8, // 4: controlplane.v1.CASBackendServiceUpdateResponse.result:type_name -> controlplane.v1.CASBackendItem - 0, // 5: controlplane.v1.CASBackendService.List:input_type -> controlplane.v1.CASBackendServiceListRequest - 2, // 6: controlplane.v1.CASBackendService.Create:input_type -> controlplane.v1.CASBackendServiceCreateRequest - 4, // 7: controlplane.v1.CASBackendService.Update:input_type -> controlplane.v1.CASBackendServiceUpdateRequest - 6, // 8: controlplane.v1.CASBackendService.Delete:input_type -> controlplane.v1.CASBackendServiceDeleteRequest - 1, // 9: controlplane.v1.CASBackendService.List:output_type -> controlplane.v1.CASBackendServiceListResponse - 3, // 10: controlplane.v1.CASBackendService.Create:output_type -> controlplane.v1.CASBackendServiceCreateResponse - 5, // 11: controlplane.v1.CASBackendService.Update:output_type -> controlplane.v1.CASBackendServiceUpdateResponse - 7, // 12: controlplane.v1.CASBackendService.Delete:output_type -> controlplane.v1.CASBackendServiceDeleteResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 9, // 0: controlplane.v1.CASBackendServiceListResponse.result:type_name -> controlplane.v1.CASBackendItem + 10, // 1: controlplane.v1.CASBackendServiceCreateRequest.credentials:type_name -> google.protobuf.Struct + 9, // 2: controlplane.v1.CASBackendServiceCreateResponse.result:type_name -> controlplane.v1.CASBackendItem + 10, // 3: controlplane.v1.CASBackendServiceUpdateRequest.credentials:type_name -> google.protobuf.Struct + 9, // 4: controlplane.v1.CASBackendServiceUpdateResponse.result:type_name -> controlplane.v1.CASBackendItem + 1, // 5: controlplane.v1.CASBackendService.List:input_type -> controlplane.v1.CASBackendServiceListRequest + 3, // 6: controlplane.v1.CASBackendService.Create:input_type -> controlplane.v1.CASBackendServiceCreateRequest + 5, // 7: controlplane.v1.CASBackendService.Update:input_type -> controlplane.v1.CASBackendServiceUpdateRequest + 7, // 8: controlplane.v1.CASBackendService.Delete:input_type -> controlplane.v1.CASBackendServiceDeleteRequest + 2, // 9: controlplane.v1.CASBackendService.List:output_type -> controlplane.v1.CASBackendServiceListResponse + 4, // 10: controlplane.v1.CASBackendService.Create:output_type -> controlplane.v1.CASBackendServiceCreateResponse + 6, // 11: controlplane.v1.CASBackendService.Update:output_type -> controlplane.v1.CASBackendServiceUpdateResponse + 8, // 12: controlplane.v1.CASBackendService.Delete:output_type -> controlplane.v1.CASBackendServiceDeleteResponse + 9, // [9:13] is the sub-list for method output_type + 5, // [5:9] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_controlplane_v1_cas_backends_proto_init() } @@ -719,13 +784,14 @@ func file_controlplane_v1_cas_backends_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_controlplane_v1_cas_backends_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 8, NumExtensions: 0, NumServices: 1, }, GoTypes: file_controlplane_v1_cas_backends_proto_goTypes, DependencyIndexes: file_controlplane_v1_cas_backends_proto_depIdxs, + EnumInfos: file_controlplane_v1_cas_backends_proto_enumTypes, MessageInfos: file_controlplane_v1_cas_backends_proto_msgTypes, }.Build() File_controlplane_v1_cas_backends_proto = out.File diff --git a/app/controlplane/api/controlplane/v1/cas_backends.proto b/app/controlplane/api/controlplane/v1/cas_backends.proto index d8240593b..3aa935d6b 100644 --- a/app/controlplane/api/controlplane/v1/cas_backends.proto +++ b/app/controlplane/api/controlplane/v1/cas_backends.proto @@ -22,6 +22,7 @@ option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/con import "controlplane/v1/response_messages.proto"; import "validate/validate.proto"; import "google/protobuf/struct.proto"; +import "errors/errors.proto"; service CASBackendService { rpc List (CASBackendServiceListRequest) returns (CASBackendServiceListResponse); @@ -76,4 +77,13 @@ message CASBackendServiceDeleteRequest { string id = 1 [(validate.rules).string.uuid = true]; } -message CASBackendServiceDeleteResponse {} \ No newline at end of file +message CASBackendServiceDeleteResponse {} + +enum CASBackendErrorReason { + option (errors.default_code) = 500; + CAS_BACKEND_ERROR_REASON_UNSPECIFIED = 0; + CAS_BACKEND_ERROR_REASON_REQUIRED = 1 [(errors.code) = 403]; + // The repository does not seem to be operational + // a previous validation has failed + CAS_BACKEND_ERROR_REASON_INVALID = 2 [(errors.code) = 403]; +} \ No newline at end of file diff --git a/app/controlplane/api/controlplane/v1/cas_backends_errors.pb.go b/app/controlplane/api/controlplane/v1/cas_backends_errors.pb.go new file mode 100644 index 000000000..79d069420 --- /dev/null +++ b/app/controlplane/api/controlplane/v1/cas_backends_errors.pb.go @@ -0,0 +1,52 @@ +// Code generated by protoc-gen-go-errors. DO NOT EDIT. + +package v1 + +import ( + fmt "fmt" + errors "github.com/go-kratos/kratos/v2/errors" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the kratos package it is being compiled against. +const _ = errors.SupportPackageIsVersion1 + +func IsCasBackendErrorReasonUnspecified(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_UNSPECIFIED.String() && e.Code == 500 +} + +func ErrorCasBackendErrorReasonUnspecified(format string, args ...interface{}) *errors.Error { + return errors.New(500, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_UNSPECIFIED.String(), fmt.Sprintf(format, args...)) +} + +func IsCasBackendErrorReasonRequired(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_REQUIRED.String() && e.Code == 403 +} + +func ErrorCasBackendErrorReasonRequired(format string, args ...interface{}) *errors.Error { + return errors.New(403, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_REQUIRED.String(), fmt.Sprintf(format, args...)) +} + +// The repository does not seem to be operational +// a previous validation has failed +func IsCasBackendErrorReasonInvalid(err error) bool { + if err == nil { + return false + } + e := errors.FromError(err) + return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_INVALID.String() && e.Code == 403 +} + +// The repository does not seem to be operational +// a previous validation has failed +func ErrorCasBackendErrorReasonInvalid(format string, args ...interface{}) *errors.Error { + return errors.New(403, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_INVALID.String(), fmt.Sprintf(format, args...)) +} diff --git a/app/controlplane/api/controlplane/v1/context.pb.go b/app/controlplane/api/controlplane/v1/context.pb.go index 2dbe18cf7..729f448c4 100644 --- a/app/controlplane/api/controlplane/v1/context.pb.go +++ b/app/controlplane/api/controlplane/v1/context.pb.go @@ -125,9 +125,9 @@ type ContextServiceCurrentResponse_Result struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CurrentUser *User `protobuf:"bytes,1,opt,name=current_user,json=currentUser,proto3" json:"current_user,omitempty"` - CurrentOrg *Org `protobuf:"bytes,2,opt,name=current_org,json=currentOrg,proto3" json:"current_org,omitempty"` - CurrentOciRepo *OCIRepositoryItem `protobuf:"bytes,3,opt,name=current_oci_repo,json=currentOciRepo,proto3" json:"current_oci_repo,omitempty"` + CurrentUser *User `protobuf:"bytes,1,opt,name=current_user,json=currentUser,proto3" json:"current_user,omitempty"` + CurrentOrg *Org `protobuf:"bytes,2,opt,name=current_org,json=currentOrg,proto3" json:"current_org,omitempty"` + CurrentCasBackend *CASBackendItem `protobuf:"bytes,3,opt,name=current_cas_backend,json=currentCasBackend,proto3" json:"current_cas_backend,omitempty"` } func (x *ContextServiceCurrentResponse_Result) Reset() { @@ -176,9 +176,9 @@ func (x *ContextServiceCurrentResponse_Result) GetCurrentOrg() *Org { return nil } -func (x *ContextServiceCurrentResponse_Result) GetCurrentOciRepo() *OCIRepositoryItem { +func (x *ContextServiceCurrentResponse_Result) GetCurrentCasBackend() *CASBackendItem { if x != nil { - return x.CurrentOciRepo + return x.CurrentCasBackend } return nil } @@ -193,14 +193,14 @@ var file_controlplane_v1_context_proto_rawDesc = []byte{ 0x31, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb8, 0x02, 0x0a, 0x1d, 0x43, 0x6f, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbb, 0x02, 0x0a, 0x1d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0xc7, 0x01, 0x0a, 0x06, 0x52, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0xca, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x38, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, @@ -208,25 +208,25 @@ var file_controlplane_v1_context_proto_rawDesc = []byte{ 0x35, 0x0a, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x72, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x67, 0x12, 0x4c, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x6f, 0x63, 0x69, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4f, 0x63, 0x69, - 0x52, 0x65, 0x70, 0x6f, 0x32, 0x7a, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x07, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6e, 0x74, 0x4f, 0x72, 0x67, 0x12, 0x4f, 0x0a, 0x13, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x61, 0x73, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x73, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x32, 0x7a, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x07, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, + 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -246,15 +246,15 @@ var file_controlplane_v1_context_proto_goTypes = []interface{}{ (*ContextServiceCurrentRequest)(nil), // 0: controlplane.v1.ContextServiceCurrentRequest (*ContextServiceCurrentResponse)(nil), // 1: controlplane.v1.ContextServiceCurrentResponse (*ContextServiceCurrentResponse_Result)(nil), // 2: controlplane.v1.ContextServiceCurrentResponse.Result - (*User)(nil), // 3: controlplane.v1.User - (*Org)(nil), // 4: controlplane.v1.Org - (*OCIRepositoryItem)(nil), // 5: controlplane.v1.OCIRepositoryItem + (*User)(nil), // 3: controlplane.v1.User + (*Org)(nil), // 4: controlplane.v1.Org + (*CASBackendItem)(nil), // 5: controlplane.v1.CASBackendItem } var file_controlplane_v1_context_proto_depIdxs = []int32{ 2, // 0: controlplane.v1.ContextServiceCurrentResponse.result:type_name -> controlplane.v1.ContextServiceCurrentResponse.Result 3, // 1: controlplane.v1.ContextServiceCurrentResponse.Result.current_user:type_name -> controlplane.v1.User 4, // 2: controlplane.v1.ContextServiceCurrentResponse.Result.current_org:type_name -> controlplane.v1.Org - 5, // 3: controlplane.v1.ContextServiceCurrentResponse.Result.current_oci_repo:type_name -> controlplane.v1.OCIRepositoryItem + 5, // 3: controlplane.v1.ContextServiceCurrentResponse.Result.current_cas_backend:type_name -> controlplane.v1.CASBackendItem 0, // 4: controlplane.v1.ContextService.Current:input_type -> controlplane.v1.ContextServiceCurrentRequest 1, // 5: controlplane.v1.ContextService.Current:output_type -> controlplane.v1.ContextServiceCurrentResponse 5, // [5:6] is the sub-list for method output_type diff --git a/app/controlplane/api/controlplane/v1/context.pb.validate.go b/app/controlplane/api/controlplane/v1/context.pb.validate.go index d56fa6a9b..cc1006e64 100644 --- a/app/controlplane/api/controlplane/v1/context.pb.validate.go +++ b/app/controlplane/api/controlplane/v1/context.pb.validate.go @@ -352,11 +352,11 @@ func (m *ContextServiceCurrentResponse_Result) validate(all bool) error { } if all { - switch v := interface{}(m.GetCurrentOciRepo()).(type) { + switch v := interface{}(m.GetCurrentCasBackend()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ContextServiceCurrentResponse_ResultValidationError{ - field: "CurrentOciRepo", + field: "CurrentCasBackend", reason: "embedded message failed validation", cause: err, }) @@ -364,16 +364,16 @@ func (m *ContextServiceCurrentResponse_Result) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ContextServiceCurrentResponse_ResultValidationError{ - field: "CurrentOciRepo", + field: "CurrentCasBackend", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetCurrentOciRepo()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCurrentCasBackend()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ContextServiceCurrentResponse_ResultValidationError{ - field: "CurrentOciRepo", + field: "CurrentCasBackend", reason: "embedded message failed validation", cause: err, } diff --git a/app/controlplane/api/controlplane/v1/context.proto b/app/controlplane/api/controlplane/v1/context.proto index 34baa75b1..62f56839a 100644 --- a/app/controlplane/api/controlplane/v1/context.proto +++ b/app/controlplane/api/controlplane/v1/context.proto @@ -33,6 +33,6 @@ message ContextServiceCurrentResponse { message Result { User current_user = 1; Org current_org = 2; - OCIRepositoryItem current_oci_repo = 3; + CASBackendItem current_cas_backend = 3; } } diff --git a/app/controlplane/api/controlplane/v1/oci_repository.pb.go b/app/controlplane/api/controlplane/v1/oci_repository.pb.go deleted file mode 100644 index be434f6d5..000000000 --- a/app/controlplane/api/controlplane/v1/oci_repository.pb.go +++ /dev/null @@ -1,413 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: controlplane/v1/oci_repository.proto - -package v1 - -import ( - _ "github.com/chainloop-dev/chainloop/app/controlplane/api/errors/v1" - _ "github.com/envoyproxy/protoc-gen-validate/validate" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type OCIRepositoryErrorReason int32 - -const ( - // TODO: add support for PRECONDITION_FAILED - OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED OCIRepositoryErrorReason = 0 - OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_REQUIRED OCIRepositoryErrorReason = 1 - // The repository does not seem to be operational - // a previous validation has failed - OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_INVALID OCIRepositoryErrorReason = 2 -) - -// Enum value maps for OCIRepositoryErrorReason. -var ( - OCIRepositoryErrorReason_name = map[int32]string{ - 0: "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED", - 1: "OCI_REPOSITORY_ERROR_REASON_REQUIRED", - 2: "OCI_REPOSITORY_ERROR_REASON_INVALID", - } - OCIRepositoryErrorReason_value = map[string]int32{ - "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED": 0, - "OCI_REPOSITORY_ERROR_REASON_REQUIRED": 1, - "OCI_REPOSITORY_ERROR_REASON_INVALID": 2, - } -) - -func (x OCIRepositoryErrorReason) Enum() *OCIRepositoryErrorReason { - p := new(OCIRepositoryErrorReason) - *p = x - return p -} - -func (x OCIRepositoryErrorReason) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OCIRepositoryErrorReason) Descriptor() protoreflect.EnumDescriptor { - return file_controlplane_v1_oci_repository_proto_enumTypes[0].Descriptor() -} - -func (OCIRepositoryErrorReason) Type() protoreflect.EnumType { - return &file_controlplane_v1_oci_repository_proto_enumTypes[0] -} - -func (x OCIRepositoryErrorReason) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OCIRepositoryErrorReason.Descriptor instead. -func (OCIRepositoryErrorReason) EnumDescriptor() ([]byte, []int) { - return file_controlplane_v1_oci_repository_proto_rawDescGZIP(), []int{0} -} - -type OCIRepositoryServiceSaveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // FQDN of the OCI repository, including paths - Repository string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - // Types that are assignable to Credentials: - // - // *OCIRepositoryServiceSaveRequest_KeyPair - Credentials isOCIRepositoryServiceSaveRequest_Credentials `protobuf_oneof:"credentials"` -} - -func (x *OCIRepositoryServiceSaveRequest) Reset() { - *x = OCIRepositoryServiceSaveRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OCIRepositoryServiceSaveRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OCIRepositoryServiceSaveRequest) ProtoMessage() {} - -func (x *OCIRepositoryServiceSaveRequest) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OCIRepositoryServiceSaveRequest.ProtoReflect.Descriptor instead. -func (*OCIRepositoryServiceSaveRequest) Descriptor() ([]byte, []int) { - return file_controlplane_v1_oci_repository_proto_rawDescGZIP(), []int{0} -} - -func (x *OCIRepositoryServiceSaveRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (m *OCIRepositoryServiceSaveRequest) GetCredentials() isOCIRepositoryServiceSaveRequest_Credentials { - if m != nil { - return m.Credentials - } - return nil -} - -func (x *OCIRepositoryServiceSaveRequest) GetKeyPair() *OCIRepositoryServiceSaveRequest_Keypair { - if x, ok := x.GetCredentials().(*OCIRepositoryServiceSaveRequest_KeyPair); ok { - return x.KeyPair - } - return nil -} - -type isOCIRepositoryServiceSaveRequest_Credentials interface { - isOCIRepositoryServiceSaveRequest_Credentials() -} - -type OCIRepositoryServiceSaveRequest_KeyPair struct { - KeyPair *OCIRepositoryServiceSaveRequest_Keypair `protobuf:"bytes,2,opt,name=key_pair,json=keyPair,proto3,oneof"` -} - -func (*OCIRepositoryServiceSaveRequest_KeyPair) isOCIRepositoryServiceSaveRequest_Credentials() {} - -type OCIRepositoryServiceSaveResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *OCIRepositoryServiceSaveResponse) Reset() { - *x = OCIRepositoryServiceSaveResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OCIRepositoryServiceSaveResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OCIRepositoryServiceSaveResponse) ProtoMessage() {} - -func (x *OCIRepositoryServiceSaveResponse) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OCIRepositoryServiceSaveResponse.ProtoReflect.Descriptor instead. -func (*OCIRepositoryServiceSaveResponse) Descriptor() ([]byte, []int) { - return file_controlplane_v1_oci_repository_proto_rawDescGZIP(), []int{1} -} - -type OCIRepositoryServiceSaveRequest_Keypair struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *OCIRepositoryServiceSaveRequest_Keypair) Reset() { - *x = OCIRepositoryServiceSaveRequest_Keypair{} - if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OCIRepositoryServiceSaveRequest_Keypair) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OCIRepositoryServiceSaveRequest_Keypair) ProtoMessage() {} - -func (x *OCIRepositoryServiceSaveRequest_Keypair) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_oci_repository_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OCIRepositoryServiceSaveRequest_Keypair.ProtoReflect.Descriptor instead. -func (*OCIRepositoryServiceSaveRequest_Keypair) Descriptor() ([]byte, []int) { - return file_controlplane_v1_oci_repository_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *OCIRepositoryServiceSaveRequest_Keypair) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *OCIRepositoryServiceSaveRequest_Keypair) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -var File_controlplane_v1_oci_repository_proto protoreflect.FileDescriptor - -var file_controlplane_v1_oci_repository_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, - 0x31, 0x2f, 0x6f, 0x63, 0x69, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x16, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x02, 0x0a, 0x1f, 0x4f, 0x43, 0x49, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x55, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x69, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x61, - 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, - 0x72, 0x48, 0x00, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x1a, 0x53, 0x0a, 0x07, - 0x4b, 0x65, 0x79, 0x70, 0x61, 0x69, 0x72, 0x12, 0x23, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x08, - 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x42, 0x12, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, - 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x22, 0x0a, 0x20, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x61, 0x76, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0xac, 0x01, 0x0a, 0x18, 0x4f, 0x43, - 0x49, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x27, 0x4f, 0x43, 0x49, 0x5f, 0x52, 0x45, - 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x2e, 0x0a, 0x24, 0x4f, 0x43, 0x49, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, - 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, - 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x04, 0xb0, - 0x45, 0x93, 0x03, 0x12, 0x2d, 0x0a, 0x23, 0x4f, 0x43, 0x49, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, - 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, - 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x1a, 0x04, 0xb0, 0x45, - 0x93, 0x03, 0x1a, 0x04, 0xa8, 0x45, 0xf4, 0x03, 0x32, 0x88, 0x01, 0x0a, 0x14, 0x4f, 0x43, 0x49, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x70, 0x0a, 0x04, 0x53, 0x61, 0x76, 0x65, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x49, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, - 0x49, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x88, 0x02, 0x01, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_controlplane_v1_oci_repository_proto_rawDescOnce sync.Once - file_controlplane_v1_oci_repository_proto_rawDescData = file_controlplane_v1_oci_repository_proto_rawDesc -) - -func file_controlplane_v1_oci_repository_proto_rawDescGZIP() []byte { - file_controlplane_v1_oci_repository_proto_rawDescOnce.Do(func() { - file_controlplane_v1_oci_repository_proto_rawDescData = protoimpl.X.CompressGZIP(file_controlplane_v1_oci_repository_proto_rawDescData) - }) - return file_controlplane_v1_oci_repository_proto_rawDescData -} - -var file_controlplane_v1_oci_repository_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_controlplane_v1_oci_repository_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_controlplane_v1_oci_repository_proto_goTypes = []interface{}{ - (OCIRepositoryErrorReason)(0), // 0: controlplane.v1.OCIRepositoryErrorReason - (*OCIRepositoryServiceSaveRequest)(nil), // 1: controlplane.v1.OCIRepositoryServiceSaveRequest - (*OCIRepositoryServiceSaveResponse)(nil), // 2: controlplane.v1.OCIRepositoryServiceSaveResponse - (*OCIRepositoryServiceSaveRequest_Keypair)(nil), // 3: controlplane.v1.OCIRepositoryServiceSaveRequest.Keypair -} -var file_controlplane_v1_oci_repository_proto_depIdxs = []int32{ - 3, // 0: controlplane.v1.OCIRepositoryServiceSaveRequest.key_pair:type_name -> controlplane.v1.OCIRepositoryServiceSaveRequest.Keypair - 1, // 1: controlplane.v1.OCIRepositoryService.Save:input_type -> controlplane.v1.OCIRepositoryServiceSaveRequest - 2, // 2: controlplane.v1.OCIRepositoryService.Save:output_type -> controlplane.v1.OCIRepositoryServiceSaveResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_controlplane_v1_oci_repository_proto_init() } -func file_controlplane_v1_oci_repository_proto_init() { - if File_controlplane_v1_oci_repository_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_controlplane_v1_oci_repository_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OCIRepositoryServiceSaveRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_controlplane_v1_oci_repository_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OCIRepositoryServiceSaveResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_controlplane_v1_oci_repository_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OCIRepositoryServiceSaveRequest_Keypair); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_controlplane_v1_oci_repository_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*OCIRepositoryServiceSaveRequest_KeyPair)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_controlplane_v1_oci_repository_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_controlplane_v1_oci_repository_proto_goTypes, - DependencyIndexes: file_controlplane_v1_oci_repository_proto_depIdxs, - EnumInfos: file_controlplane_v1_oci_repository_proto_enumTypes, - MessageInfos: file_controlplane_v1_oci_repository_proto_msgTypes, - }.Build() - File_controlplane_v1_oci_repository_proto = out.File - file_controlplane_v1_oci_repository_proto_rawDesc = nil - file_controlplane_v1_oci_repository_proto_goTypes = nil - file_controlplane_v1_oci_repository_proto_depIdxs = nil -} diff --git a/app/controlplane/api/controlplane/v1/oci_repository.pb.validate.go b/app/controlplane/api/controlplane/v1/oci_repository.pb.validate.go deleted file mode 100644 index 5b8fb6d93..000000000 --- a/app/controlplane/api/controlplane/v1/oci_repository.pb.validate.go +++ /dev/null @@ -1,441 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: controlplane/v1/oci_repository.proto - -package v1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on OCIRepositoryServiceSaveRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *OCIRepositoryServiceSaveRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OCIRepositoryServiceSaveRequest with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// OCIRepositoryServiceSaveRequestMultiError, or nil if none found. -func (m *OCIRepositoryServiceSaveRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *OCIRepositoryServiceSaveRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetRepository()) < 1 { - err := OCIRepositoryServiceSaveRequestValidationError{ - field: "Repository", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - oneofCredentialsPresent := false - switch v := m.Credentials.(type) { - case *OCIRepositoryServiceSaveRequest_KeyPair: - if v == nil { - err := OCIRepositoryServiceSaveRequestValidationError{ - field: "Credentials", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - oneofCredentialsPresent = true - - if all { - switch v := interface{}(m.GetKeyPair()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OCIRepositoryServiceSaveRequestValidationError{ - field: "KeyPair", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OCIRepositoryServiceSaveRequestValidationError{ - field: "KeyPair", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetKeyPair()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OCIRepositoryServiceSaveRequestValidationError{ - field: "KeyPair", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - if !oneofCredentialsPresent { - err := OCIRepositoryServiceSaveRequestValidationError{ - field: "Credentials", - reason: "value is required", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return OCIRepositoryServiceSaveRequestMultiError(errors) - } - - return nil -} - -// OCIRepositoryServiceSaveRequestMultiError is an error wrapping multiple -// validation errors returned by OCIRepositoryServiceSaveRequest.ValidateAll() -// if the designated constraints aren't met. -type OCIRepositoryServiceSaveRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OCIRepositoryServiceSaveRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OCIRepositoryServiceSaveRequestMultiError) AllErrors() []error { return m } - -// OCIRepositoryServiceSaveRequestValidationError is the validation error -// returned by OCIRepositoryServiceSaveRequest.Validate if the designated -// constraints aren't met. -type OCIRepositoryServiceSaveRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OCIRepositoryServiceSaveRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OCIRepositoryServiceSaveRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OCIRepositoryServiceSaveRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OCIRepositoryServiceSaveRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OCIRepositoryServiceSaveRequestValidationError) ErrorName() string { - return "OCIRepositoryServiceSaveRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e OCIRepositoryServiceSaveRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOCIRepositoryServiceSaveRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OCIRepositoryServiceSaveRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OCIRepositoryServiceSaveRequestValidationError{} - -// Validate checks the field values on OCIRepositoryServiceSaveResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the first error encountered is returned, or nil if there are -// no violations. -func (m *OCIRepositoryServiceSaveResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OCIRepositoryServiceSaveResponse with -// the rules defined in the proto definition for this message. If any rules -// are violated, the result is a list of violation errors wrapped in -// OCIRepositoryServiceSaveResponseMultiError, or nil if none found. -func (m *OCIRepositoryServiceSaveResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *OCIRepositoryServiceSaveResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return OCIRepositoryServiceSaveResponseMultiError(errors) - } - - return nil -} - -// OCIRepositoryServiceSaveResponseMultiError is an error wrapping multiple -// validation errors returned by -// OCIRepositoryServiceSaveResponse.ValidateAll() if the designated -// constraints aren't met. -type OCIRepositoryServiceSaveResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OCIRepositoryServiceSaveResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OCIRepositoryServiceSaveResponseMultiError) AllErrors() []error { return m } - -// OCIRepositoryServiceSaveResponseValidationError is the validation error -// returned by OCIRepositoryServiceSaveResponse.Validate if the designated -// constraints aren't met. -type OCIRepositoryServiceSaveResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OCIRepositoryServiceSaveResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OCIRepositoryServiceSaveResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OCIRepositoryServiceSaveResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OCIRepositoryServiceSaveResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OCIRepositoryServiceSaveResponseValidationError) ErrorName() string { - return "OCIRepositoryServiceSaveResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e OCIRepositoryServiceSaveResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOCIRepositoryServiceSaveResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OCIRepositoryServiceSaveResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OCIRepositoryServiceSaveResponseValidationError{} - -// Validate checks the field values on OCIRepositoryServiceSaveRequest_Keypair -// with the rules defined in the proto definition for this message. If any -// rules are violated, the first error encountered is returned, or nil if -// there are no violations. -func (m *OCIRepositoryServiceSaveRequest_Keypair) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on -// OCIRepositoryServiceSaveRequest_Keypair with the rules defined in the proto -// definition for this message. If any rules are violated, the result is a -// list of violation errors wrapped in -// OCIRepositoryServiceSaveRequest_KeypairMultiError, or nil if none found. -func (m *OCIRepositoryServiceSaveRequest_Keypair) ValidateAll() error { - return m.validate(true) -} - -func (m *OCIRepositoryServiceSaveRequest_Keypair) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if utf8.RuneCountInString(m.GetUsername()) < 1 { - err := OCIRepositoryServiceSaveRequest_KeypairValidationError{ - field: "Username", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetPassword()) < 1 { - err := OCIRepositoryServiceSaveRequest_KeypairValidationError{ - field: "Password", - reason: "value length must be at least 1 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return OCIRepositoryServiceSaveRequest_KeypairMultiError(errors) - } - - return nil -} - -// OCIRepositoryServiceSaveRequest_KeypairMultiError is an error wrapping -// multiple validation errors returned by -// OCIRepositoryServiceSaveRequest_Keypair.ValidateAll() if the designated -// constraints aren't met. -type OCIRepositoryServiceSaveRequest_KeypairMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OCIRepositoryServiceSaveRequest_KeypairMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OCIRepositoryServiceSaveRequest_KeypairMultiError) AllErrors() []error { return m } - -// OCIRepositoryServiceSaveRequest_KeypairValidationError is the validation -// error returned by OCIRepositoryServiceSaveRequest_Keypair.Validate if the -// designated constraints aren't met. -type OCIRepositoryServiceSaveRequest_KeypairValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) ErrorName() string { - return "OCIRepositoryServiceSaveRequest_KeypairValidationError" -} - -// Error satisfies the builtin error interface -func (e OCIRepositoryServiceSaveRequest_KeypairValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOCIRepositoryServiceSaveRequest_Keypair.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OCIRepositoryServiceSaveRequest_KeypairValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OCIRepositoryServiceSaveRequest_KeypairValidationError{} diff --git a/app/controlplane/api/controlplane/v1/oci_repository.proto b/app/controlplane/api/controlplane/v1/oci_repository.proto deleted file mode 100644 index b65963101..000000000 --- a/app/controlplane/api/controlplane/v1/oci_repository.proto +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package controlplane.v1; - -option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1;v1"; -import "validate/validate.proto"; -import "errors/v1/errors.proto"; - -service OCIRepositoryService { - // Save the OCI repository overriding the existing one (for now) - rpc Save (OCIRepositoryServiceSaveRequest) returns (OCIRepositoryServiceSaveResponse) { - // Will get replaced by CASBackends API endpoint - // We are maintaining this for compatibility reasons with old CLIs - option deprecated = true; - } -} - -message OCIRepositoryServiceSaveRequest { - // FQDN of the OCI repository, including paths - string repository = 1 [(validate.rules).string.min_len = 1]; - - oneof credentials { - option (validate.required) = true; - Keypair key_pair = 2; - } - - message Keypair { - string username = 1 [(validate.rules).string.min_len = 1]; - string password = 2 [(validate.rules).string.min_len = 1]; - } - -} - -message OCIRepositoryServiceSaveResponse {} - -enum OCIRepositoryErrorReason { - option (errors.v1.default_code) = 500; - // TODO: add support for PRECONDITION_FAILED - OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED = 0; - OCI_REPOSITORY_ERROR_REASON_REQUIRED = 1 [(errors.v1.code) = 403]; - // The repository does not seem to be operational - // a previous validation has failed - OCI_REPOSITORY_ERROR_REASON_INVALID = 2 [(errors.v1.code) = 403]; -} \ No newline at end of file diff --git a/app/controlplane/api/controlplane/v1/oci_repository_errors.pb.go b/app/controlplane/api/controlplane/v1/oci_repository_errors.pb.go deleted file mode 100644 index fe3b78b26..000000000 --- a/app/controlplane/api/controlplane/v1/oci_repository_errors.pb.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by protoc-gen-go-errors. DO NOT EDIT. - -package v1 - -import ( - fmt "fmt" - errors "github.com/go-kratos/kratos/v2/errors" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the kratos package it is being compiled against. -const _ = errors.SupportPackageIsVersion1 - -// TODO: add support for PRECONDITION_FAILED -func IsOciRepositoryErrorReasonUnspecified(err error) bool { - if err == nil { - return false - } - e := errors.FromError(err) - return e.Reason == OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED.String() && e.Code == 500 -} - -// TODO: add support for PRECONDITION_FAILED -func ErrorOciRepositoryErrorReasonUnspecified(format string, args ...interface{}) *errors.Error { - return errors.New(500, OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED.String(), fmt.Sprintf(format, args...)) -} - -func IsOciRepositoryErrorReasonRequired(err error) bool { - if err == nil { - return false - } - e := errors.FromError(err) - return e.Reason == OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_REQUIRED.String() && e.Code == 403 -} - -func ErrorOciRepositoryErrorReasonRequired(format string, args ...interface{}) *errors.Error { - return errors.New(403, OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_REQUIRED.String(), fmt.Sprintf(format, args...)) -} - -// The repository does not seem to be operational -// a previous validation has failed -func IsOciRepositoryErrorReasonInvalid(err error) bool { - if err == nil { - return false - } - e := errors.FromError(err) - return e.Reason == OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_INVALID.String() && e.Code == 403 -} - -// The repository does not seem to be operational -// a previous validation has failed -func ErrorOciRepositoryErrorReasonInvalid(format string, args ...interface{}) *errors.Error { - return errors.New(403, OCIRepositoryErrorReason_OCI_REPOSITORY_ERROR_REASON_INVALID.String(), fmt.Sprintf(format, args...)) -} diff --git a/app/controlplane/api/controlplane/v1/oci_repository_grpc.pb.go b/app/controlplane/api/controlplane/v1/oci_repository_grpc.pb.go deleted file mode 100644 index ca314d73a..000000000 --- a/app/controlplane/api/controlplane/v1/oci_repository_grpc.pb.go +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: controlplane/v1/oci_repository.proto - -package v1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - OCIRepositoryService_Save_FullMethodName = "/controlplane.v1.OCIRepositoryService/Save" -) - -// OCIRepositoryServiceClient is the client API for OCIRepositoryService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type OCIRepositoryServiceClient interface { - // Deprecated: Do not use. - // Save the OCI repository overriding the existing one (for now) - Save(ctx context.Context, in *OCIRepositoryServiceSaveRequest, opts ...grpc.CallOption) (*OCIRepositoryServiceSaveResponse, error) -} - -type oCIRepositoryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewOCIRepositoryServiceClient(cc grpc.ClientConnInterface) OCIRepositoryServiceClient { - return &oCIRepositoryServiceClient{cc} -} - -// Deprecated: Do not use. -func (c *oCIRepositoryServiceClient) Save(ctx context.Context, in *OCIRepositoryServiceSaveRequest, opts ...grpc.CallOption) (*OCIRepositoryServiceSaveResponse, error) { - out := new(OCIRepositoryServiceSaveResponse) - err := c.cc.Invoke(ctx, OCIRepositoryService_Save_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OCIRepositoryServiceServer is the server API for OCIRepositoryService service. -// All implementations must embed UnimplementedOCIRepositoryServiceServer -// for forward compatibility -type OCIRepositoryServiceServer interface { - // Deprecated: Do not use. - // Save the OCI repository overriding the existing one (for now) - Save(context.Context, *OCIRepositoryServiceSaveRequest) (*OCIRepositoryServiceSaveResponse, error) - mustEmbedUnimplementedOCIRepositoryServiceServer() -} - -// UnimplementedOCIRepositoryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedOCIRepositoryServiceServer struct { -} - -func (UnimplementedOCIRepositoryServiceServer) Save(context.Context, *OCIRepositoryServiceSaveRequest) (*OCIRepositoryServiceSaveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Save not implemented") -} -func (UnimplementedOCIRepositoryServiceServer) mustEmbedUnimplementedOCIRepositoryServiceServer() {} - -// UnsafeOCIRepositoryServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to OCIRepositoryServiceServer will -// result in compilation errors. -type UnsafeOCIRepositoryServiceServer interface { - mustEmbedUnimplementedOCIRepositoryServiceServer() -} - -func RegisterOCIRepositoryServiceServer(s grpc.ServiceRegistrar, srv OCIRepositoryServiceServer) { - s.RegisterService(&OCIRepositoryService_ServiceDesc, srv) -} - -func _OCIRepositoryService_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OCIRepositoryServiceSaveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OCIRepositoryServiceServer).Save(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OCIRepositoryService_Save_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OCIRepositoryServiceServer).Save(ctx, req.(*OCIRepositoryServiceSaveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// OCIRepositoryService_ServiceDesc is the grpc.ServiceDesc for OCIRepositoryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var OCIRepositoryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "controlplane.v1.OCIRepositoryService", - HandlerType: (*OCIRepositoryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Save", - Handler: _OCIRepositoryService_Save_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "controlplane/v1/oci_repository.proto", -} diff --git a/app/controlplane/api/controlplane/v1/response_messages.pb.go b/app/controlplane/api/controlplane/v1/response_messages.pb.go index 003947652..ca0bcaa13 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.pb.go +++ b/app/controlplane/api/controlplane/v1/response_messages.pb.go @@ -22,8 +22,8 @@ package v1 import ( - _ "github.com/chainloop-dev/chainloop/app/controlplane/api/errors/v1" v1 "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1" + _ "github.com/go-kratos/kratos/v2/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -84,55 +84,6 @@ func (AllowListError) EnumDescriptor() ([]byte, []int) { return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{0} } -type OCIRepositoryItem_ValidationStatus int32 - -const ( - OCIRepositoryItem_VALIDATION_STATUS_UNSPECIFIED OCIRepositoryItem_ValidationStatus = 0 - OCIRepositoryItem_VALIDATION_STATUS_OK OCIRepositoryItem_ValidationStatus = 1 - OCIRepositoryItem_VALIDATION_STATUS_INVALID OCIRepositoryItem_ValidationStatus = 2 -) - -// Enum value maps for OCIRepositoryItem_ValidationStatus. -var ( - OCIRepositoryItem_ValidationStatus_name = map[int32]string{ - 0: "VALIDATION_STATUS_UNSPECIFIED", - 1: "VALIDATION_STATUS_OK", - 2: "VALIDATION_STATUS_INVALID", - } - OCIRepositoryItem_ValidationStatus_value = map[string]int32{ - "VALIDATION_STATUS_UNSPECIFIED": 0, - "VALIDATION_STATUS_OK": 1, - "VALIDATION_STATUS_INVALID": 2, - } -) - -func (x OCIRepositoryItem_ValidationStatus) Enum() *OCIRepositoryItem_ValidationStatus { - p := new(OCIRepositoryItem_ValidationStatus) - *p = x - return p -} - -func (x OCIRepositoryItem_ValidationStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OCIRepositoryItem_ValidationStatus) Descriptor() protoreflect.EnumDescriptor { - return file_controlplane_v1_response_messages_proto_enumTypes[1].Descriptor() -} - -func (OCIRepositoryItem_ValidationStatus) Type() protoreflect.EnumType { - return &file_controlplane_v1_response_messages_proto_enumTypes[1] -} - -func (x OCIRepositoryItem_ValidationStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OCIRepositoryItem_ValidationStatus.Descriptor instead. -func (OCIRepositoryItem_ValidationStatus) EnumDescriptor() ([]byte, []int) { - return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{8, 0} -} - type CASBackendItem_ValidationStatus int32 const ( @@ -166,11 +117,11 @@ func (x CASBackendItem_ValidationStatus) String() string { } func (CASBackendItem_ValidationStatus) Descriptor() protoreflect.EnumDescriptor { - return file_controlplane_v1_response_messages_proto_enumTypes[2].Descriptor() + return file_controlplane_v1_response_messages_proto_enumTypes[1].Descriptor() } func (CASBackendItem_ValidationStatus) Type() protoreflect.EnumType { - return &file_controlplane_v1_response_messages_proto_enumTypes[2] + return &file_controlplane_v1_response_messages_proto_enumTypes[1] } func (x CASBackendItem_ValidationStatus) Number() protoreflect.EnumNumber { @@ -179,7 +130,7 @@ func (x CASBackendItem_ValidationStatus) Number() protoreflect.EnumNumber { // Deprecated: Use CASBackendItem_ValidationStatus.Descriptor instead. func (CASBackendItem_ValidationStatus) EnumDescriptor() ([]byte, []int) { - return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{9, 0} + return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{8, 0} } type WorkflowItem struct { @@ -854,78 +805,6 @@ func (x *Org) GetCreatedAt() *timestamppb.Timestamp { return nil } -// Deprecated: Marked as deprecated in controlplane/v1/response_messages.proto. -type OCIRepositoryItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - ValidationStatus OCIRepositoryItem_ValidationStatus `protobuf:"varint,4,opt,name=validation_status,json=validationStatus,proto3,enum=controlplane.v1.OCIRepositoryItem_ValidationStatus" json:"validation_status,omitempty"` -} - -func (x *OCIRepositoryItem) Reset() { - *x = OCIRepositoryItem{} - if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OCIRepositoryItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OCIRepositoryItem) ProtoMessage() {} - -func (x *OCIRepositoryItem) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_response_messages_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 OCIRepositoryItem.ProtoReflect.Descriptor instead. -func (*OCIRepositoryItem) Descriptor() ([]byte, []int) { - return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{8} -} - -func (x *OCIRepositoryItem) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *OCIRepositoryItem) GetRepo() string { - if x != nil { - return x.Repo - } - return "" -} - -func (x *OCIRepositoryItem) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *OCIRepositoryItem) GetValidationStatus() OCIRepositoryItem_ValidationStatus { - if x != nil { - return x.ValidationStatus - } - return OCIRepositoryItem_VALIDATION_STATUS_UNSPECIFIED -} - type CASBackendItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -952,7 +831,7 @@ type CASBackendItem struct { func (x *CASBackendItem) Reset() { *x = CASBackendItem{} if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[9] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -965,7 +844,7 @@ func (x *CASBackendItem) String() string { func (*CASBackendItem) ProtoMessage() {} func (x *CASBackendItem) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[9] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -978,7 +857,7 @@ func (x *CASBackendItem) ProtoReflect() protoreflect.Message { // Deprecated: Use CASBackendItem.ProtoReflect.Descriptor instead. func (*CASBackendItem) Descriptor() ([]byte, []int) { - return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{9} + return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{8} } func (x *CASBackendItem) GetId() string { @@ -1063,7 +942,7 @@ type AttestationItem_EnvVariable struct { func (x *AttestationItem_EnvVariable) Reset() { *x = AttestationItem_EnvVariable{} if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[10] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +955,7 @@ func (x *AttestationItem_EnvVariable) String() string { func (*AttestationItem_EnvVariable) ProtoMessage() {} func (x *AttestationItem_EnvVariable) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[10] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1120,7 +999,7 @@ type AttestationItem_Material struct { func (x *AttestationItem_Material) Reset() { *x = AttestationItem_Material{} if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[11] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1133,7 +1012,7 @@ func (x *AttestationItem_Material) String() string { func (*AttestationItem_Material) ProtoMessage() {} func (x *AttestationItem_Material) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[11] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1182,7 +1061,7 @@ type CASBackendItem_Limits struct { func (x *CASBackendItem_Limits) Reset() { *x = CASBackendItem_Limits{} if protoimpl.UnsafeEnabled { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[12] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1195,7 +1074,7 @@ func (x *CASBackendItem_Limits) String() string { func (*CASBackendItem_Limits) ProtoMessage() {} func (x *CASBackendItem_Limits) ProtoReflect() protoreflect.Message { - mi := &file_controlplane_v1_response_messages_proto_msgTypes[12] + mi := &file_controlplane_v1_response_messages_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1208,7 +1087,7 @@ func (x *CASBackendItem_Limits) ProtoReflect() protoreflect.Message { // Deprecated: Use CASBackendItem_Limits.ProtoReflect.Descriptor instead. func (*CASBackendItem_Limits) Descriptor() ([]byte, []int) { - return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{9, 0} + return file_controlplane_v1_response_messages_proto_rawDescGZIP(), []int{8, 0} } func (x *CASBackendItem_Limits) GetMaxBytes() int64 { @@ -1229,202 +1108,181 @@ var file_controlplane_v1_response_messages_proto_rawDesc = []byte{ 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x76, - 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, - 0x02, 0x0a, 0x0c, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x74, 0x65, 0x6d, 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, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x61, - 0x6d, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, - 0x72, 0x75, 0x6e, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x09, 0x72, 0x75, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x08, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x75, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x07, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x75, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x22, 0xcc, 0x03, 0x0a, 0x0f, 0x57, 0x6f, - 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x75, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x02, 0x0a, 0x0c, + 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x74, 0x65, 0x6d, 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, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, + 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x39, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x75, 0x6e, + 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, + 0x75, 0x6e, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, + 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x52, 0x75, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x6c, 0x61, + 0x73, 0x74, 0x52, 0x75, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x22, 0xcc, 0x03, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x66, + 0x6c, 0x6f, 0x77, 0x52, 0x75, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x12, 0x39, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x17, 0x0a, 0x07, 0x6a, + 0x6f, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x6f, + 0x62, 0x55, 0x72, 0x6c, 0x12, 0x56, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x77, 0x6f, 0x72, 0x6b, + 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x52, + 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x57, 0x0a, 0x10, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, + 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x03, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x17, - 0x0a, 0x07, 0x6a, 0x6f, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6a, 0x6f, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x56, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x6e, 0x65, - 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x77, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x47, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x5f, 0x76, 0x61, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, + 0x52, 0x07, 0x65, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x09, 0x6d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x4d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x73, 0x1a, 0x37, 0x0a, 0x0b, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 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, 0x1a, 0x48, 0x0a, 0x08, 0x4d, + 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 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, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x14, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x74, 0x65, 0x6d, 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, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x27, 0x0a, + 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, + 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x73, 0x22, 0xc7, 0x01, 0x0a, 0x1b, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x35, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x57, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, - 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x03, 0x0a, 0x0f, 0x41, 0x74, 0x74, - 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x5f, 0x76, 0x61, 0x72, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, - 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x73, 0x12, 0x47, 0x0a, 0x09, - 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, - 0x6d, 0x2e, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x52, 0x09, 0x6d, 0x61, 0x74, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x73, 0x1a, 0x37, 0x0a, 0x0b, 0x45, 0x6e, 0x76, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x62, 0x6c, 0x65, 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, 0x1a, 0x48, - 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 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, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x14, 0x57, 0x6f, 0x72, - 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x61, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x0a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x22, 0x67, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xdb, 0x01, 0x0a, + 0x11, 0x4f, 0x72, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x74, + 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x26, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x64, 0x0a, 0x03, 0x4f, 0x72, + 0x67, 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, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, - 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x49, 0x64, 0x73, 0x22, 0xc7, 0x01, 0x0a, - 0x1b, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x02, 0x76, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x61, 0x66, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x02, 0x76, 0x31, 0x42, 0x0a, 0x0a, 0x08, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x67, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, - 0xdb, 0x01, 0x0a, 0x11, 0x4f, 0x72, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, - 0x70, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x03, 0x6f, 0x72, 0x67, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, - 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x52, 0x03, 0x6f, 0x72, 0x67, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x64, 0x0a, - 0x03, 0x4f, 0x72, 0x67, 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, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x22, 0xc8, 0x02, 0x0a, 0x11, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x70, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x65, 0x70, 0x6f, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x60, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x22, 0xe1, 0x04, 0x0a, 0x0e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, + 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3d, 0x0a, 0x0c, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x5d, 0x0a, 0x11, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, - 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x56, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, + 0x6d, 0x2e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x25, 0x0a, + 0x06, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, + 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xe1, - 0x04, 0x0a, 0x0e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3d, 0x0a, 0x0c, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x5d, 0x0a, 0x11, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, - 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, - 0x64, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x3e, - 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x41, 0x53, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x2e, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x69, 0x73, 0x49, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x25, 0x0a, 0x06, 0x4c, - 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x22, 0x6e, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, - 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, - 0x10, 0x02, 0x2a, 0x60, 0x0a, 0x0e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4c, 0x49, - 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x26, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, - 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x49, - 0x4e, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x01, 0x1a, 0x04, 0xb0, 0x45, 0x93, 0x03, 0x1a, 0x04, - 0xa8, 0x45, 0xf4, 0x03, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, - 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x10, 0x02, 0x2a, 0x60, 0x0a, 0x0e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, + 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, + 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x26, 0x0a, 0x1c, 0x41, 0x4c, 0x4c, 0x4f, + 0x57, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x49, 0x4e, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x01, 0x1a, 0x04, 0xa8, 0x45, 0x93, 0x03, + 0x1a, 0x04, 0xa0, 0x45, 0xf4, 0x03, 0x42, 0x4c, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, + 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x76, + 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1439,59 +1297,55 @@ func file_controlplane_v1_response_messages_proto_rawDescGZIP() []byte { return file_controlplane_v1_response_messages_proto_rawDescData } -var file_controlplane_v1_response_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_controlplane_v1_response_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_controlplane_v1_response_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_controlplane_v1_response_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_controlplane_v1_response_messages_proto_goTypes = []interface{}{ (AllowListError)(0), // 0: controlplane.v1.AllowListError - (OCIRepositoryItem_ValidationStatus)(0), // 1: controlplane.v1.OCIRepositoryItem.ValidationStatus - (CASBackendItem_ValidationStatus)(0), // 2: controlplane.v1.CASBackendItem.ValidationStatus - (*WorkflowItem)(nil), // 3: controlplane.v1.WorkflowItem - (*WorkflowRunItem)(nil), // 4: controlplane.v1.WorkflowRunItem - (*AttestationItem)(nil), // 5: controlplane.v1.AttestationItem - (*WorkflowContractItem)(nil), // 6: controlplane.v1.WorkflowContractItem - (*WorkflowContractVersionItem)(nil), // 7: controlplane.v1.WorkflowContractVersionItem - (*User)(nil), // 8: controlplane.v1.User - (*OrgMembershipItem)(nil), // 9: controlplane.v1.OrgMembershipItem - (*Org)(nil), // 10: controlplane.v1.Org - (*OCIRepositoryItem)(nil), // 11: controlplane.v1.OCIRepositoryItem - (*CASBackendItem)(nil), // 12: controlplane.v1.CASBackendItem - (*AttestationItem_EnvVariable)(nil), // 13: controlplane.v1.AttestationItem.EnvVariable - (*AttestationItem_Material)(nil), // 14: controlplane.v1.AttestationItem.Material - (*CASBackendItem_Limits)(nil), // 15: controlplane.v1.CASBackendItem.Limits - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp - (v1.CraftingSchema_Runner_RunnerType)(0), // 17: workflowcontract.v1.CraftingSchema.Runner.RunnerType - (*v1.CraftingSchema)(nil), // 18: workflowcontract.v1.CraftingSchema + (CASBackendItem_ValidationStatus)(0), // 1: controlplane.v1.CASBackendItem.ValidationStatus + (*WorkflowItem)(nil), // 2: controlplane.v1.WorkflowItem + (*WorkflowRunItem)(nil), // 3: controlplane.v1.WorkflowRunItem + (*AttestationItem)(nil), // 4: controlplane.v1.AttestationItem + (*WorkflowContractItem)(nil), // 5: controlplane.v1.WorkflowContractItem + (*WorkflowContractVersionItem)(nil), // 6: controlplane.v1.WorkflowContractVersionItem + (*User)(nil), // 7: controlplane.v1.User + (*OrgMembershipItem)(nil), // 8: controlplane.v1.OrgMembershipItem + (*Org)(nil), // 9: controlplane.v1.Org + (*CASBackendItem)(nil), // 10: controlplane.v1.CASBackendItem + (*AttestationItem_EnvVariable)(nil), // 11: controlplane.v1.AttestationItem.EnvVariable + (*AttestationItem_Material)(nil), // 12: controlplane.v1.AttestationItem.Material + (*CASBackendItem_Limits)(nil), // 13: controlplane.v1.CASBackendItem.Limits + (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp + (v1.CraftingSchema_Runner_RunnerType)(0), // 15: workflowcontract.v1.CraftingSchema.Runner.RunnerType + (*v1.CraftingSchema)(nil), // 16: workflowcontract.v1.CraftingSchema } var file_controlplane_v1_response_messages_proto_depIdxs = []int32{ - 16, // 0: controlplane.v1.WorkflowItem.created_at:type_name -> google.protobuf.Timestamp - 4, // 1: controlplane.v1.WorkflowItem.last_run:type_name -> controlplane.v1.WorkflowRunItem - 16, // 2: controlplane.v1.WorkflowRunItem.created_at:type_name -> google.protobuf.Timestamp - 16, // 3: controlplane.v1.WorkflowRunItem.finished_at:type_name -> google.protobuf.Timestamp - 3, // 4: controlplane.v1.WorkflowRunItem.workflow:type_name -> controlplane.v1.WorkflowItem - 17, // 5: controlplane.v1.WorkflowRunItem.runner_type:type_name -> workflowcontract.v1.CraftingSchema.Runner.RunnerType - 7, // 6: controlplane.v1.WorkflowRunItem.contract_version:type_name -> controlplane.v1.WorkflowContractVersionItem - 16, // 7: controlplane.v1.AttestationItem.created_at:type_name -> google.protobuf.Timestamp - 13, // 8: controlplane.v1.AttestationItem.env_vars:type_name -> controlplane.v1.AttestationItem.EnvVariable - 14, // 9: controlplane.v1.AttestationItem.materials:type_name -> controlplane.v1.AttestationItem.Material - 16, // 10: controlplane.v1.WorkflowContractItem.created_at:type_name -> google.protobuf.Timestamp - 16, // 11: controlplane.v1.WorkflowContractVersionItem.created_at:type_name -> google.protobuf.Timestamp - 18, // 12: controlplane.v1.WorkflowContractVersionItem.v1:type_name -> workflowcontract.v1.CraftingSchema - 16, // 13: controlplane.v1.User.created_at:type_name -> google.protobuf.Timestamp - 10, // 14: controlplane.v1.OrgMembershipItem.org:type_name -> controlplane.v1.Org - 16, // 15: controlplane.v1.OrgMembershipItem.created_at:type_name -> google.protobuf.Timestamp - 16, // 16: controlplane.v1.OrgMembershipItem.updated_at:type_name -> google.protobuf.Timestamp - 16, // 17: controlplane.v1.Org.created_at:type_name -> google.protobuf.Timestamp - 16, // 18: controlplane.v1.OCIRepositoryItem.created_at:type_name -> google.protobuf.Timestamp - 1, // 19: controlplane.v1.OCIRepositoryItem.validation_status:type_name -> controlplane.v1.OCIRepositoryItem.ValidationStatus - 16, // 20: controlplane.v1.CASBackendItem.created_at:type_name -> google.protobuf.Timestamp - 16, // 21: controlplane.v1.CASBackendItem.validated_at:type_name -> google.protobuf.Timestamp - 2, // 22: controlplane.v1.CASBackendItem.validation_status:type_name -> controlplane.v1.CASBackendItem.ValidationStatus - 15, // 23: controlplane.v1.CASBackendItem.limits:type_name -> controlplane.v1.CASBackendItem.Limits - 24, // [24:24] is the sub-list for method output_type - 24, // [24:24] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 14, // 0: controlplane.v1.WorkflowItem.created_at:type_name -> google.protobuf.Timestamp + 3, // 1: controlplane.v1.WorkflowItem.last_run:type_name -> controlplane.v1.WorkflowRunItem + 14, // 2: controlplane.v1.WorkflowRunItem.created_at:type_name -> google.protobuf.Timestamp + 14, // 3: controlplane.v1.WorkflowRunItem.finished_at:type_name -> google.protobuf.Timestamp + 2, // 4: controlplane.v1.WorkflowRunItem.workflow:type_name -> controlplane.v1.WorkflowItem + 15, // 5: controlplane.v1.WorkflowRunItem.runner_type:type_name -> workflowcontract.v1.CraftingSchema.Runner.RunnerType + 6, // 6: controlplane.v1.WorkflowRunItem.contract_version:type_name -> controlplane.v1.WorkflowContractVersionItem + 14, // 7: controlplane.v1.AttestationItem.created_at:type_name -> google.protobuf.Timestamp + 11, // 8: controlplane.v1.AttestationItem.env_vars:type_name -> controlplane.v1.AttestationItem.EnvVariable + 12, // 9: controlplane.v1.AttestationItem.materials:type_name -> controlplane.v1.AttestationItem.Material + 14, // 10: controlplane.v1.WorkflowContractItem.created_at:type_name -> google.protobuf.Timestamp + 14, // 11: controlplane.v1.WorkflowContractVersionItem.created_at:type_name -> google.protobuf.Timestamp + 16, // 12: controlplane.v1.WorkflowContractVersionItem.v1:type_name -> workflowcontract.v1.CraftingSchema + 14, // 13: controlplane.v1.User.created_at:type_name -> google.protobuf.Timestamp + 9, // 14: controlplane.v1.OrgMembershipItem.org:type_name -> controlplane.v1.Org + 14, // 15: controlplane.v1.OrgMembershipItem.created_at:type_name -> google.protobuf.Timestamp + 14, // 16: controlplane.v1.OrgMembershipItem.updated_at:type_name -> google.protobuf.Timestamp + 14, // 17: controlplane.v1.Org.created_at:type_name -> google.protobuf.Timestamp + 14, // 18: controlplane.v1.CASBackendItem.created_at:type_name -> google.protobuf.Timestamp + 14, // 19: controlplane.v1.CASBackendItem.validated_at:type_name -> google.protobuf.Timestamp + 1, // 20: controlplane.v1.CASBackendItem.validation_status:type_name -> controlplane.v1.CASBackendItem.ValidationStatus + 13, // 21: controlplane.v1.CASBackendItem.limits:type_name -> controlplane.v1.CASBackendItem.Limits + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_controlplane_v1_response_messages_proto_init() } @@ -1597,18 +1451,6 @@ func file_controlplane_v1_response_messages_proto_init() { } } file_controlplane_v1_response_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OCIRepositoryItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_controlplane_v1_response_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CASBackendItem); i { case 0: return &v.state @@ -1620,7 +1462,7 @@ func file_controlplane_v1_response_messages_proto_init() { return nil } } - file_controlplane_v1_response_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_controlplane_v1_response_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttestationItem_EnvVariable); i { case 0: return &v.state @@ -1632,7 +1474,7 @@ func file_controlplane_v1_response_messages_proto_init() { return nil } } - file_controlplane_v1_response_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_controlplane_v1_response_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttestationItem_Material); i { case 0: return &v.state @@ -1644,7 +1486,7 @@ func file_controlplane_v1_response_messages_proto_init() { return nil } } - file_controlplane_v1_response_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_controlplane_v1_response_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CASBackendItem_Limits); i { case 0: return &v.state @@ -1665,8 +1507,8 @@ func file_controlplane_v1_response_messages_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_controlplane_v1_response_messages_proto_rawDesc, - NumEnums: 3, - NumMessages: 13, + NumEnums: 2, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/app/controlplane/api/controlplane/v1/response_messages.pb.validate.go b/app/controlplane/api/controlplane/v1/response_messages.pb.validate.go index acae0a503..7c151d766 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.pb.validate.go +++ b/app/controlplane/api/controlplane/v1/response_messages.pb.validate.go @@ -1409,143 +1409,6 @@ var _ interface { ErrorName() string } = OrgValidationError{} -// Validate checks the field values on OCIRepositoryItem with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *OCIRepositoryItem) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on OCIRepositoryItem with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// OCIRepositoryItemMultiError, or nil if none found. -func (m *OCIRepositoryItem) ValidateAll() error { - return m.validate(true) -} - -func (m *OCIRepositoryItem) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - // no validation rules for Repo - - if all { - switch v := interface{}(m.GetCreatedAt()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, OCIRepositoryItemValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, OCIRepositoryItemValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return OCIRepositoryItemValidationError{ - field: "CreatedAt", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for ValidationStatus - - if len(errors) > 0 { - return OCIRepositoryItemMultiError(errors) - } - - return nil -} - -// OCIRepositoryItemMultiError is an error wrapping multiple validation errors -// returned by OCIRepositoryItem.ValidateAll() if the designated constraints -// aren't met. -type OCIRepositoryItemMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m OCIRepositoryItemMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m OCIRepositoryItemMultiError) AllErrors() []error { return m } - -// OCIRepositoryItemValidationError is the validation error returned by -// OCIRepositoryItem.Validate if the designated constraints aren't met. -type OCIRepositoryItemValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e OCIRepositoryItemValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e OCIRepositoryItemValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e OCIRepositoryItemValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e OCIRepositoryItemValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e OCIRepositoryItemValidationError) ErrorName() string { - return "OCIRepositoryItemValidationError" -} - -// Error satisfies the builtin error interface -func (e OCIRepositoryItemValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sOCIRepositoryItem.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = OCIRepositoryItemValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = OCIRepositoryItemValidationError{} - // Validate checks the field values on CASBackendItem with the rules defined in // the proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. diff --git a/app/controlplane/api/controlplane/v1/response_messages.proto b/app/controlplane/api/controlplane/v1/response_messages.proto index c6b2a5b56..e953a20ed 100644 --- a/app/controlplane/api/controlplane/v1/response_messages.proto +++ b/app/controlplane/api/controlplane/v1/response_messages.proto @@ -21,7 +21,7 @@ option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/con import "google/protobuf/timestamp.proto"; import "workflowcontract/v1/crafting_schema.proto"; -import "errors/v1/errors.proto"; +import "errors/errors.proto"; message WorkflowItem { string id = 1; @@ -109,21 +109,6 @@ message Org { google.protobuf.Timestamp created_at = 3; } -message OCIRepositoryItem { - option deprecated = true; // in favor of CASBackendItem - - string id = 1; - string repo = 2; - google.protobuf.Timestamp created_at = 3; - ValidationStatus validation_status = 4; - - enum ValidationStatus { - VALIDATION_STATUS_UNSPECIFIED = 0; - VALIDATION_STATUS_OK = 1; - VALIDATION_STATUS_INVALID = 2; - } -} - message CASBackendItem { string id = 1; // e.g. myregistry.io/myrepo s3 bucket and so on @@ -155,7 +140,7 @@ message CASBackendItem { } enum AllowListError { - option (errors.v1.default_code) = 500; + option (errors.default_code) = 500; ALLOW_LIST_ERROR_UNSPECIFIED = 0; - ALLOW_LIST_ERROR_NOT_IN_LIST = 1 [(errors.v1.code) = 403]; + ALLOW_LIST_ERROR_NOT_IN_LIST = 1 [(errors.code) = 403]; } diff --git a/app/controlplane/api/errors/v1/errors.pb.go b/app/controlplane/api/errors/v1/errors.pb.go deleted file mode 100644 index 13c224f49..000000000 --- a/app/controlplane/api/errors/v1/errors.pb.go +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc (unknown) -// source: errors/v1/errors.proto - -package errors - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_errors_v1_errors_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*int32)(nil), - Field: 1109, - Name: "errors.v1.default_code", - Tag: "varint,1109,opt,name=default_code", - Filename: "errors/v1/errors.proto", - }, - { - ExtendedType: (*descriptorpb.EnumValueOptions)(nil), - ExtensionType: (*int32)(nil), - Field: 1110, - Name: "errors.v1.code", - Tag: "varint,1110,opt,name=code", - Filename: "errors/v1/errors.proto", - }, -} - -// Extension fields to descriptorpb.EnumOptions. -var ( - // optional int32 default_code = 1109; - E_DefaultCode = &file_errors_v1_errors_proto_extTypes[0] -) - -// Extension fields to descriptorpb.EnumValueOptions. -var ( - // optional int32 code = 1110; - E_Code = &file_errors_v1_errors_proto_extTypes[1] -) - -var File_errors_v1_errors_proto protoreflect.FileDescriptor - -var file_errors_v1_errors_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, - 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x40, 0x0a, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xd5, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x3a, 0x36, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0xd6, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x42, - 0x4a, 0x5a, 0x48, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2d, 0x64, 0x65, 0x76, 0x2f, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var file_errors_v1_errors_proto_goTypes = []interface{}{ - (*descriptorpb.EnumOptions)(nil), // 0: google.protobuf.EnumOptions - (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions -} -var file_errors_v1_errors_proto_depIdxs = []int32{ - 0, // 0: errors.v1.default_code:extendee -> google.protobuf.EnumOptions - 1, // 1: errors.v1.code:extendee -> google.protobuf.EnumValueOptions - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 0, // [0:2] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_errors_v1_errors_proto_init() } -func file_errors_v1_errors_proto_init() { - if File_errors_v1_errors_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_errors_v1_errors_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 2, - NumServices: 0, - }, - GoTypes: file_errors_v1_errors_proto_goTypes, - DependencyIndexes: file_errors_v1_errors_proto_depIdxs, - ExtensionInfos: file_errors_v1_errors_proto_extTypes, - }.Build() - File_errors_v1_errors_proto = out.File - file_errors_v1_errors_proto_rawDesc = nil - file_errors_v1_errors_proto_goTypes = nil - file_errors_v1_errors_proto_depIdxs = nil -} diff --git a/app/controlplane/api/errors/v1/errors.pb.validate.go b/app/controlplane/api/errors/v1/errors.pb.validate.go deleted file mode 100644 index ff45e0e12..000000000 --- a/app/controlplane/api/errors/v1/errors.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: errors/v1/errors.proto - -package errors - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/app/controlplane/api/errors/v1/errors.proto b/app/controlplane/api/errors/v1/errors.proto deleted file mode 100644 index 5f9e0d0af..000000000 --- a/app/controlplane/api/errors/v1/errors.proto +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package errors.v1; - -option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/errors/v1;errors"; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.EnumOptions { - int32 default_code = 1109; -} - -extend google.protobuf.EnumValueOptions { - int32 code = 1110; -} \ No newline at end of file diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts b/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts index 12cf0751d..d903d09d4 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/cas_backends.ts @@ -7,6 +7,49 @@ import { CASBackendItem } from "./response_messages"; export const protobufPackage = "controlplane.v1"; +export enum CASBackendErrorReason { + CAS_BACKEND_ERROR_REASON_UNSPECIFIED = 0, + CAS_BACKEND_ERROR_REASON_REQUIRED = 1, + /** + * CAS_BACKEND_ERROR_REASON_INVALID - The repository does not seem to be operational + * a previous validation has failed + */ + CAS_BACKEND_ERROR_REASON_INVALID = 2, + UNRECOGNIZED = -1, +} + +export function cASBackendErrorReasonFromJSON(object: any): CASBackendErrorReason { + switch (object) { + case 0: + case "CAS_BACKEND_ERROR_REASON_UNSPECIFIED": + return CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_UNSPECIFIED; + case 1: + case "CAS_BACKEND_ERROR_REASON_REQUIRED": + return CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_REQUIRED; + case 2: + case "CAS_BACKEND_ERROR_REASON_INVALID": + return CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_INVALID; + case -1: + case "UNRECOGNIZED": + default: + return CASBackendErrorReason.UNRECOGNIZED; + } +} + +export function cASBackendErrorReasonToJSON(object: CASBackendErrorReason): string { + switch (object) { + case CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_UNSPECIFIED: + return "CAS_BACKEND_ERROR_REASON_UNSPECIFIED"; + case CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_REQUIRED: + return "CAS_BACKEND_ERROR_REASON_REQUIRED"; + case CASBackendErrorReason.CAS_BACKEND_ERROR_REASON_INVALID: + return "CAS_BACKEND_ERROR_REASON_INVALID"; + case CASBackendErrorReason.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + export interface CASBackendServiceListRequest { } diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/context.ts b/app/controlplane/api/gen/frontend/controlplane/v1/context.ts index 2757bb89b..c9054d98c 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/context.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/context.ts @@ -2,7 +2,7 @@ import { grpc } from "@improbable-eng/grpc-web"; import { BrowserHeaders } from "browser-headers"; import _m0 from "protobufjs/minimal"; -import { OCIRepositoryItem, Org, User } from "./response_messages"; +import { CASBackendItem, Org, User } from "./response_messages"; export const protobufPackage = "controlplane.v1"; @@ -16,7 +16,7 @@ export interface ContextServiceCurrentResponse { export interface ContextServiceCurrentResponse_Result { currentUser?: User; currentOrg?: Org; - currentOciRepo?: OCIRepositoryItem; + currentCasBackend?: CASBackendItem; } function createBaseContextServiceCurrentRequest(): ContextServiceCurrentRequest { @@ -125,7 +125,7 @@ export const ContextServiceCurrentResponse = { }; function createBaseContextServiceCurrentResponse_Result(): ContextServiceCurrentResponse_Result { - return { currentUser: undefined, currentOrg: undefined, currentOciRepo: undefined }; + return { currentUser: undefined, currentOrg: undefined, currentCasBackend: undefined }; } export const ContextServiceCurrentResponse_Result = { @@ -136,8 +136,8 @@ export const ContextServiceCurrentResponse_Result = { if (message.currentOrg !== undefined) { Org.encode(message.currentOrg, writer.uint32(18).fork()).ldelim(); } - if (message.currentOciRepo !== undefined) { - OCIRepositoryItem.encode(message.currentOciRepo, writer.uint32(26).fork()).ldelim(); + if (message.currentCasBackend !== undefined) { + CASBackendItem.encode(message.currentCasBackend, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -168,7 +168,7 @@ export const ContextServiceCurrentResponse_Result = { break; } - message.currentOciRepo = OCIRepositoryItem.decode(reader, reader.uint32()); + message.currentCasBackend = CASBackendItem.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -183,7 +183,9 @@ export const ContextServiceCurrentResponse_Result = { return { currentUser: isSet(object.currentUser) ? User.fromJSON(object.currentUser) : undefined, currentOrg: isSet(object.currentOrg) ? Org.fromJSON(object.currentOrg) : undefined, - currentOciRepo: isSet(object.currentOciRepo) ? OCIRepositoryItem.fromJSON(object.currentOciRepo) : undefined, + currentCasBackend: isSet(object.currentCasBackend) + ? CASBackendItem.fromJSON(object.currentCasBackend) + : undefined, }; }, @@ -193,8 +195,10 @@ export const ContextServiceCurrentResponse_Result = { (obj.currentUser = message.currentUser ? User.toJSON(message.currentUser) : undefined); message.currentOrg !== undefined && (obj.currentOrg = message.currentOrg ? Org.toJSON(message.currentOrg) : undefined); - message.currentOciRepo !== undefined && - (obj.currentOciRepo = message.currentOciRepo ? OCIRepositoryItem.toJSON(message.currentOciRepo) : undefined); + message.currentCasBackend !== undefined && + (obj.currentCasBackend = message.currentCasBackend + ? CASBackendItem.toJSON(message.currentCasBackend) + : undefined); return obj; }, @@ -214,8 +218,8 @@ export const ContextServiceCurrentResponse_Result = { message.currentOrg = (object.currentOrg !== undefined && object.currentOrg !== null) ? Org.fromPartial(object.currentOrg) : undefined; - message.currentOciRepo = (object.currentOciRepo !== undefined && object.currentOciRepo !== null) - ? OCIRepositoryItem.fromPartial(object.currentOciRepo) + message.currentCasBackend = (object.currentCasBackend !== undefined && object.currentCasBackend !== null) + ? CASBackendItem.fromPartial(object.currentCasBackend) : undefined; return message; }, diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/oci_repository.ts b/app/controlplane/api/gen/frontend/controlplane/v1/oci_repository.ts deleted file mode 100644 index 2da421255..000000000 --- a/app/controlplane/api/gen/frontend/controlplane/v1/oci_repository.ts +++ /dev/null @@ -1,424 +0,0 @@ -/* eslint-disable */ -import { grpc } from "@improbable-eng/grpc-web"; -import { BrowserHeaders } from "browser-headers"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "controlplane.v1"; - -export enum OCIRepositoryErrorReason { - /** OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED - TODO: add support for PRECONDITION_FAILED */ - OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED = 0, - OCI_REPOSITORY_ERROR_REASON_REQUIRED = 1, - /** - * OCI_REPOSITORY_ERROR_REASON_INVALID - The repository does not seem to be operational - * a previous validation has failed - */ - OCI_REPOSITORY_ERROR_REASON_INVALID = 2, - UNRECOGNIZED = -1, -} - -export function oCIRepositoryErrorReasonFromJSON(object: any): OCIRepositoryErrorReason { - switch (object) { - case 0: - case "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED": - return OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED; - case 1: - case "OCI_REPOSITORY_ERROR_REASON_REQUIRED": - return OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_REQUIRED; - case 2: - case "OCI_REPOSITORY_ERROR_REASON_INVALID": - return OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_INVALID; - case -1: - case "UNRECOGNIZED": - default: - return OCIRepositoryErrorReason.UNRECOGNIZED; - } -} - -export function oCIRepositoryErrorReasonToJSON(object: OCIRepositoryErrorReason): string { - switch (object) { - case OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED: - return "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED"; - case OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_REQUIRED: - return "OCI_REPOSITORY_ERROR_REASON_REQUIRED"; - case OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_INVALID: - return "OCI_REPOSITORY_ERROR_REASON_INVALID"; - case OCIRepositoryErrorReason.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface OCIRepositoryServiceSaveRequest { - /** FQDN of the OCI repository, including paths */ - repository: string; - keyPair?: OCIRepositoryServiceSaveRequest_Keypair | undefined; -} - -export interface OCIRepositoryServiceSaveRequest_Keypair { - username: string; - password: string; -} - -export interface OCIRepositoryServiceSaveResponse { -} - -function createBaseOCIRepositoryServiceSaveRequest(): OCIRepositoryServiceSaveRequest { - return { repository: "", keyPair: undefined }; -} - -export const OCIRepositoryServiceSaveRequest = { - encode(message: OCIRepositoryServiceSaveRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.repository !== "") { - writer.uint32(10).string(message.repository); - } - if (message.keyPair !== undefined) { - OCIRepositoryServiceSaveRequest_Keypair.encode(message.keyPair, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.repository = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.keyPair = OCIRepositoryServiceSaveRequest_Keypair.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(object: any): OCIRepositoryServiceSaveRequest { - return { - repository: isSet(object.repository) ? String(object.repository) : "", - keyPair: isSet(object.keyPair) ? OCIRepositoryServiceSaveRequest_Keypair.fromJSON(object.keyPair) : undefined, - }; - }, - - toJSON(message: OCIRepositoryServiceSaveRequest): unknown { - const obj: any = {}; - message.repository !== undefined && (obj.repository = message.repository); - message.keyPair !== undefined && - (obj.keyPair = message.keyPair ? OCIRepositoryServiceSaveRequest_Keypair.toJSON(message.keyPair) : undefined); - return obj; - }, - - create, I>>(base?: I): OCIRepositoryServiceSaveRequest { - return OCIRepositoryServiceSaveRequest.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - object: I, - ): OCIRepositoryServiceSaveRequest { - const message = createBaseOCIRepositoryServiceSaveRequest(); - message.repository = object.repository ?? ""; - message.keyPair = (object.keyPair !== undefined && object.keyPair !== null) - ? OCIRepositoryServiceSaveRequest_Keypair.fromPartial(object.keyPair) - : undefined; - return message; - }, -}; - -function createBaseOCIRepositoryServiceSaveRequest_Keypair(): OCIRepositoryServiceSaveRequest_Keypair { - return { username: "", password: "" }; -} - -export const OCIRepositoryServiceSaveRequest_Keypair = { - encode(message: OCIRepositoryServiceSaveRequest_Keypair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.username !== "") { - writer.uint32(10).string(message.username); - } - if (message.password !== "") { - writer.uint32(18).string(message.password); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveRequest_Keypair { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveRequest_Keypair(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.username = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.password = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(object: any): OCIRepositoryServiceSaveRequest_Keypair { - return { - username: isSet(object.username) ? String(object.username) : "", - password: isSet(object.password) ? String(object.password) : "", - }; - }, - - toJSON(message: OCIRepositoryServiceSaveRequest_Keypair): unknown { - const obj: any = {}; - message.username !== undefined && (obj.username = message.username); - message.password !== undefined && (obj.password = message.password); - return obj; - }, - - create, I>>( - base?: I, - ): OCIRepositoryServiceSaveRequest_Keypair { - return OCIRepositoryServiceSaveRequest_Keypair.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - object: I, - ): OCIRepositoryServiceSaveRequest_Keypair { - const message = createBaseOCIRepositoryServiceSaveRequest_Keypair(); - message.username = object.username ?? ""; - message.password = object.password ?? ""; - return message; - }, -}; - -function createBaseOCIRepositoryServiceSaveResponse(): OCIRepositoryServiceSaveResponse { - return {}; -} - -export const OCIRepositoryServiceSaveResponse = { - encode(_: OCIRepositoryServiceSaveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(_: any): OCIRepositoryServiceSaveResponse { - return {}; - }, - - toJSON(_: OCIRepositoryServiceSaveResponse): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>( - base?: I, - ): OCIRepositoryServiceSaveResponse { - return OCIRepositoryServiceSaveResponse.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - _: I, - ): OCIRepositoryServiceSaveResponse { - const message = createBaseOCIRepositoryServiceSaveResponse(); - return message; - }, -}; - -export interface OCIRepositoryService { - /** - * Save the OCI repository overriding the existing one (for now) - * - * @deprecated - */ - Save( - request: DeepPartial, - metadata?: grpc.Metadata, - ): Promise; -} - -export class OCIRepositoryServiceClientImpl implements OCIRepositoryService { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Save = this.Save.bind(this); - } - - Save( - request: DeepPartial, - metadata?: grpc.Metadata, - ): Promise { - return this.rpc.unary(OCIRepositoryServiceSaveDesc, OCIRepositoryServiceSaveRequest.fromPartial(request), metadata); - } -} - -export const OCIRepositoryServiceDesc = { serviceName: "controlplane.v1.OCIRepositoryService" }; - -export const OCIRepositoryServiceSaveDesc: UnaryMethodDefinitionish = { - methodName: "Save", - service: OCIRepositoryServiceDesc, - requestStream: false, - responseStream: false, - requestType: { - serializeBinary() { - return OCIRepositoryServiceSaveRequest.encode(this).finish(); - }, - } as any, - responseType: { - deserializeBinary(data: Uint8Array) { - const value = OCIRepositoryServiceSaveResponse.decode(data); - return { - ...value, - toObject() { - return value; - }, - }; - }, - } as any, -}; - -interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { - requestStream: any; - responseStream: any; -} - -type UnaryMethodDefinitionish = UnaryMethodDefinitionishR; - -interface Rpc { - unary( - methodDesc: T, - request: any, - metadata: grpc.Metadata | undefined, - ): Promise; -} - -export class GrpcWebImpl { - private host: string; - private options: { - transport?: grpc.TransportFactory; - - debug?: boolean; - metadata?: grpc.Metadata; - upStreamRetryCodes?: number[]; - }; - - constructor( - host: string, - options: { - transport?: grpc.TransportFactory; - - debug?: boolean; - metadata?: grpc.Metadata; - upStreamRetryCodes?: number[]; - }, - ) { - this.host = host; - this.options = options; - } - - unary( - methodDesc: T, - _request: any, - metadata: grpc.Metadata | undefined, - ): Promise { - const request = { ..._request, ...methodDesc.requestType }; - const maybeCombinedMetadata = metadata && this.options.metadata - ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) - : metadata || this.options.metadata; - return new Promise((resolve, reject) => { - grpc.unary(methodDesc, { - request, - host: this.host, - metadata: maybeCombinedMetadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (response.status === grpc.Code.OK) { - resolve(response.message!.toObject()); - } else { - const err = new GrpcWebError(response.statusMessage, response.status, response.trailers); - reject(err); - } - }, - }); - }); - } -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export class GrpcWebError extends tsProtoGlobalThis.Error { - constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) { - super(message); - } -} diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/ocirepository.ts b/app/controlplane/api/gen/frontend/controlplane/v1/ocirepository.ts deleted file mode 100644 index b6de0e26a..000000000 --- a/app/controlplane/api/gen/frontend/controlplane/v1/ocirepository.ts +++ /dev/null @@ -1,397 +0,0 @@ -/* eslint-disable */ -import { grpc } from "@improbable-eng/grpc-web"; -import { BrowserHeaders } from "browser-headers"; -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; - -export const protobufPackage = "controlplane.v1"; - -export enum OCIRepositoryErrorReason { - /** OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED - TODO: add support for PRECONDITION_FAILED */ - OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED = 0, - OCI_REPOSITORY_ERROR_REASON_REQUIRED = 1, - UNRECOGNIZED = -1, -} - -export function oCIRepositoryErrorReasonFromJSON(object: any): OCIRepositoryErrorReason { - switch (object) { - case 0: - case "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED": - return OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED; - case 1: - case "OCI_REPOSITORY_ERROR_REASON_REQUIRED": - return OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_REQUIRED; - case -1: - case "UNRECOGNIZED": - default: - return OCIRepositoryErrorReason.UNRECOGNIZED; - } -} - -export function oCIRepositoryErrorReasonToJSON(object: OCIRepositoryErrorReason): string { - switch (object) { - case OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED: - return "OCI_REPOSITORY_ERROR_REASON_UNSPECIFIED"; - case OCIRepositoryErrorReason.OCI_REPOSITORY_ERROR_REASON_REQUIRED: - return "OCI_REPOSITORY_ERROR_REASON_REQUIRED"; - case OCIRepositoryErrorReason.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface OCIRepositoryServiceSaveRequest { - /** FQDN of the OCI repository, including paths */ - repository: string; - keyPair?: OCIRepositoryServiceSaveRequest_Keypair | undefined; -} - -export interface OCIRepositoryServiceSaveRequest_Keypair { - username: string; - password: string; -} - -export interface OCIRepositoryServiceSaveResponse { -} - -function createBaseOCIRepositoryServiceSaveRequest(): OCIRepositoryServiceSaveRequest { - return { repository: "", keyPair: undefined }; -} - -export const OCIRepositoryServiceSaveRequest = { - encode(message: OCIRepositoryServiceSaveRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.repository !== "") { - writer.uint32(10).string(message.repository); - } - if (message.keyPair !== undefined) { - OCIRepositoryServiceSaveRequest_Keypair.encode(message.keyPair, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.repository = reader.string(); - break; - case 2: - message.keyPair = OCIRepositoryServiceSaveRequest_Keypair.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OCIRepositoryServiceSaveRequest { - return { - repository: isSet(object.repository) ? String(object.repository) : "", - keyPair: isSet(object.keyPair) ? OCIRepositoryServiceSaveRequest_Keypair.fromJSON(object.keyPair) : undefined, - }; - }, - - toJSON(message: OCIRepositoryServiceSaveRequest): unknown { - const obj: any = {}; - message.repository !== undefined && (obj.repository = message.repository); - message.keyPair !== undefined && - (obj.keyPair = message.keyPair ? OCIRepositoryServiceSaveRequest_Keypair.toJSON(message.keyPair) : undefined); - return obj; - }, - - create, I>>(base?: I): OCIRepositoryServiceSaveRequest { - return OCIRepositoryServiceSaveRequest.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - object: I, - ): OCIRepositoryServiceSaveRequest { - const message = createBaseOCIRepositoryServiceSaveRequest(); - message.repository = object.repository ?? ""; - message.keyPair = (object.keyPair !== undefined && object.keyPair !== null) - ? OCIRepositoryServiceSaveRequest_Keypair.fromPartial(object.keyPair) - : undefined; - return message; - }, -}; - -function createBaseOCIRepositoryServiceSaveRequest_Keypair(): OCIRepositoryServiceSaveRequest_Keypair { - return { username: "", password: "" }; -} - -export const OCIRepositoryServiceSaveRequest_Keypair = { - encode(message: OCIRepositoryServiceSaveRequest_Keypair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.username !== "") { - writer.uint32(10).string(message.username); - } - if (message.password !== "") { - writer.uint32(18).string(message.password); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveRequest_Keypair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveRequest_Keypair(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.username = reader.string(); - break; - case 2: - message.password = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OCIRepositoryServiceSaveRequest_Keypair { - return { - username: isSet(object.username) ? String(object.username) : "", - password: isSet(object.password) ? String(object.password) : "", - }; - }, - - toJSON(message: OCIRepositoryServiceSaveRequest_Keypair): unknown { - const obj: any = {}; - message.username !== undefined && (obj.username = message.username); - message.password !== undefined && (obj.password = message.password); - return obj; - }, - - create, I>>( - base?: I, - ): OCIRepositoryServiceSaveRequest_Keypair { - return OCIRepositoryServiceSaveRequest_Keypair.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - object: I, - ): OCIRepositoryServiceSaveRequest_Keypair { - const message = createBaseOCIRepositoryServiceSaveRequest_Keypair(); - message.username = object.username ?? ""; - message.password = object.password ?? ""; - return message; - }, -}; - -function createBaseOCIRepositoryServiceSaveResponse(): OCIRepositoryServiceSaveResponse { - return {}; -} - -export const OCIRepositoryServiceSaveResponse = { - encode(_: OCIRepositoryServiceSaveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryServiceSaveResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryServiceSaveResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(_: any): OCIRepositoryServiceSaveResponse { - return {}; - }, - - toJSON(_: OCIRepositoryServiceSaveResponse): unknown { - const obj: any = {}; - return obj; - }, - - create, I>>( - base?: I, - ): OCIRepositoryServiceSaveResponse { - return OCIRepositoryServiceSaveResponse.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - _: I, - ): OCIRepositoryServiceSaveResponse { - const message = createBaseOCIRepositoryServiceSaveResponse(); - return message; - }, -}; - -export interface OCIRepositoryService { - Save( - request: DeepPartial, - metadata?: grpc.Metadata, - ): Promise; -} - -export class OCIRepositoryServiceClientImpl implements OCIRepositoryService { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Save = this.Save.bind(this); - } - - Save( - request: DeepPartial, - metadata?: grpc.Metadata, - ): Promise { - return this.rpc.unary(OCIRepositoryServiceSaveDesc, OCIRepositoryServiceSaveRequest.fromPartial(request), metadata); - } -} - -export const OCIRepositoryServiceDesc = { serviceName: "controlplane.v1.OCIRepositoryService" }; - -export const OCIRepositoryServiceSaveDesc: UnaryMethodDefinitionish = { - methodName: "Save", - service: OCIRepositoryServiceDesc, - requestStream: false, - responseStream: false, - requestType: { - serializeBinary() { - return OCIRepositoryServiceSaveRequest.encode(this).finish(); - }, - } as any, - responseType: { - deserializeBinary(data: Uint8Array) { - const value = OCIRepositoryServiceSaveResponse.decode(data); - return { - ...value, - toObject() { - return value; - }, - }; - }, - } as any, -}; - -interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { - requestStream: any; - responseStream: any; -} - -type UnaryMethodDefinitionish = UnaryMethodDefinitionishR; - -interface Rpc { - unary( - methodDesc: T, - request: any, - metadata: grpc.Metadata | undefined, - ): Promise; -} - -export class GrpcWebImpl { - private host: string; - private options: { - transport?: grpc.TransportFactory; - - debug?: boolean; - metadata?: grpc.Metadata; - upStreamRetryCodes?: number[]; - }; - - constructor( - host: string, - options: { - transport?: grpc.TransportFactory; - - debug?: boolean; - metadata?: grpc.Metadata; - upStreamRetryCodes?: number[]; - }, - ) { - this.host = host; - this.options = options; - } - - unary( - methodDesc: T, - _request: any, - metadata: grpc.Metadata | undefined, - ): Promise { - const request = { ..._request, ...methodDesc.requestType }; - const maybeCombinedMetadata = metadata && this.options.metadata - ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) - : metadata || this.options.metadata; - return new Promise((resolve, reject) => { - grpc.unary(methodDesc, { - request, - host: this.host, - metadata: maybeCombinedMetadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (response.status === grpc.Code.OK) { - resolve(response.message!.toObject()); - } else { - const err = new GrpcWebError(response.statusMessage, response.status, response.trailers); - reject(err); - } - }, - }); - }); - } -} - -declare var self: any | undefined; -declare var window: any | undefined; -declare var global: any | undefined; -var tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; - -function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds * 1_000; - millis += t.nanos / 1_000_000; - return new Date(millis); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} - -export class GrpcWebError extends tsProtoGlobalThis.Error { - constructor(message: string, public code: grpc.Code, public metadata: grpc.Metadata) { - super(message); - } -} diff --git a/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts b/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts index ff31a7df5..eab257e34 100644 --- a/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts +++ b/app/controlplane/api/gen/frontend/controlplane/v1/response_messages.ts @@ -126,53 +126,6 @@ export interface Org { createdAt?: Date; } -/** @deprecated */ -export interface OCIRepositoryItem { - id: string; - repo: string; - createdAt?: Date; - validationStatus: OCIRepositoryItem_ValidationStatus; -} - -export enum OCIRepositoryItem_ValidationStatus { - VALIDATION_STATUS_UNSPECIFIED = 0, - VALIDATION_STATUS_OK = 1, - VALIDATION_STATUS_INVALID = 2, - UNRECOGNIZED = -1, -} - -export function oCIRepositoryItem_ValidationStatusFromJSON(object: any): OCIRepositoryItem_ValidationStatus { - switch (object) { - case 0: - case "VALIDATION_STATUS_UNSPECIFIED": - return OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_UNSPECIFIED; - case 1: - case "VALIDATION_STATUS_OK": - return OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_OK; - case 2: - case "VALIDATION_STATUS_INVALID": - return OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_INVALID; - case -1: - case "UNRECOGNIZED": - default: - return OCIRepositoryItem_ValidationStatus.UNRECOGNIZED; - } -} - -export function oCIRepositoryItem_ValidationStatusToJSON(object: OCIRepositoryItem_ValidationStatus): string { - switch (object) { - case OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_UNSPECIFIED: - return "VALIDATION_STATUS_UNSPECIFIED"; - case OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_OK: - return "VALIDATION_STATUS_OK"; - case OCIRepositoryItem_ValidationStatus.VALIDATION_STATUS_INVALID: - return "VALIDATION_STATUS_INVALID"; - case OCIRepositoryItem_ValidationStatus.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface CASBackendItem { id: string; /** e.g. myregistry.io/myrepo s3 bucket and so on */ @@ -1347,106 +1300,6 @@ export const Org = { }, }; -function createBaseOCIRepositoryItem(): OCIRepositoryItem { - return { id: "", repo: "", createdAt: undefined, validationStatus: 0 }; -} - -export const OCIRepositoryItem = { - encode(message: OCIRepositoryItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== "") { - writer.uint32(10).string(message.id); - } - if (message.repo !== "") { - writer.uint32(18).string(message.repo); - } - if (message.createdAt !== undefined) { - Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).ldelim(); - } - if (message.validationStatus !== 0) { - writer.uint32(32).int32(message.validationStatus); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OCIRepositoryItem { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOCIRepositoryItem(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.id = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.repo = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.validationStatus = reader.int32() as any; - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - fromJSON(object: any): OCIRepositoryItem { - return { - id: isSet(object.id) ? String(object.id) : "", - repo: isSet(object.repo) ? String(object.repo) : "", - createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined, - validationStatus: isSet(object.validationStatus) - ? oCIRepositoryItem_ValidationStatusFromJSON(object.validationStatus) - : 0, - }; - }, - - toJSON(message: OCIRepositoryItem): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = message.id); - message.repo !== undefined && (obj.repo = message.repo); - message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString()); - message.validationStatus !== undefined && - (obj.validationStatus = oCIRepositoryItem_ValidationStatusToJSON(message.validationStatus)); - return obj; - }, - - create, I>>(base?: I): OCIRepositoryItem { - return OCIRepositoryItem.fromPartial(base ?? {}); - }, - - fromPartial, I>>(object: I): OCIRepositoryItem { - const message = createBaseOCIRepositoryItem(); - message.id = object.id ?? ""; - message.repo = object.repo ?? ""; - message.createdAt = object.createdAt ?? undefined; - message.validationStatus = object.validationStatus ?? 0; - return message; - }, -}; - function createBaseCASBackendItem(): CASBackendItem { return { id: "", diff --git a/app/controlplane/api/gen/frontend/errors/errors.ts b/app/controlplane/api/gen/frontend/errors/errors.ts new file mode 100644 index 000000000..76b7980d5 --- /dev/null +++ b/app/controlplane/api/gen/frontend/errors/errors.ts @@ -0,0 +1,218 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "errors"; + +export interface Status { + code: number; + reason: string; + message: string; + metadata: { [key: string]: string }; +} + +export interface Status_MetadataEntry { + key: string; + value: string; +} + +function createBaseStatus(): Status { + return { code: 0, reason: "", message: "", metadata: {} }; +} + +export const Status = { + encode(message: Status, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).int32(message.code); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + if (message.message !== "") { + writer.uint32(26).string(message.message); + } + Object.entries(message.metadata).forEach(([key, value]) => { + Status_MetadataEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Status { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatus(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.code = reader.int32(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.reason = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + const entry4 = Status_MetadataEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.metadata[entry4.key] = entry4.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Status { + return { + code: isSet(object.code) ? Number(object.code) : 0, + reason: isSet(object.reason) ? String(object.reason) : "", + message: isSet(object.message) ? String(object.message) : "", + metadata: isObject(object.metadata) + ? Object.entries(object.metadata).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Status): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = Math.round(message.code)); + message.reason !== undefined && (obj.reason = message.reason); + message.message !== undefined && (obj.message = message.message); + obj.metadata = {}; + if (message.metadata) { + Object.entries(message.metadata).forEach(([k, v]) => { + obj.metadata[k] = v; + }); + } + return obj; + }, + + create, I>>(base?: I): Status { + return Status.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Status { + const message = createBaseStatus(); + message.code = object.code ?? 0; + message.reason = object.reason ?? ""; + message.message = object.message ?? ""; + message.metadata = Object.entries(object.metadata ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseStatus_MetadataEntry(): Status_MetadataEntry { + return { key: "", value: "" }; +} + +export const Status_MetadataEntry = { + encode(message: Status_MetadataEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Status_MetadataEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatus_MetadataEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Status_MetadataEntry { + return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; + }, + + toJSON(message: Status_MetadataEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>(base?: I): Status_MetadataEntry { + return Status_MetadataEntry.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Status_MetadataEntry { + const message = createBaseStatus_MetadataEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/app/controlplane/api/gen/frontend/google/api/http.ts b/app/controlplane/api/gen/frontend/google/api/http.ts index afd536d74..edfdf2b63 100644 --- a/app/controlplane/api/gen/frontend/google/api/http.ts +++ b/app/controlplane/api/gen/frontend/google/api/http.ts @@ -195,15 +195,18 @@ export interface Http { * 1. Leaf request fields (recursive expansion nested messages in the request * message) are classified into three categories: * - Fields referred by the path template. They are passed via the URL path. - * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP * request body. * - All other fields are passed via the URL query parameters, and the * parameter name is the field path in the request message. A repeated * field can be represented as multiple query parameters under the same * name. - * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields * are passed via URL path and HTTP request body. - * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all * fields are passed via URL path and URL query parameters. * * ### Path template syntax @@ -300,7 +303,8 @@ export interface HttpRule { /** * Selects a method to which this rule applies. * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. */ selector: string; /** diff --git a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts index 71df319e6..b961385bd 100644 --- a/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts +++ b/app/controlplane/api/gen/frontend/google/protobuf/descriptor.ts @@ -42,13 +42,9 @@ export interface FileDescriptorProto { sourceCodeInfo?: SourceCodeInfo; /** * The syntax of the proto file. - * The supported values are "proto2", "proto3", and "editions". - * - * If `edition` is present, this value must be "editions". + * The supported values are "proto2" and "proto3". */ syntax: string; - /** The edition of the proto file, which is an opaque string. */ - edition: string; } /** Describes a message type. */ @@ -623,10 +619,6 @@ export interface MessageOptions { */ deprecated: boolean; /** - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - * * Whether the message is an automatically generated map entry type for the * maps field. * @@ -644,23 +636,12 @@ export interface MessageOptions { * use a native map in the target language to hold the keys and values. * The reflection APIs in such implementations still need to work as * if the field is a repeated message field. - */ - mapEntry: boolean; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * - * This should only be used as a temporary measure against broken builds due - * to the change in behavior for JSON field name conflicts. * - * TODO(b/261750190) This is legacy behavior we plan to remove once downstream - * teams have had time to migrate. - * - * @deprecated + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. */ - deprecatedLegacyJsonFieldConflicts: boolean; + mapEntry: boolean; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -724,8 +705,11 @@ export interface FieldOptions { * check its required fields, regardless of whether or not the message has * been parsed. * - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. + * As of 2021, lazy does no correctness checks on the byte stream during + * parsing. This may lead to crashes if and when an invalid byte stream is + * finally parsed upon access. + * + * TODO(b/211906113): Enable validation on lazy fields. */ lazy: boolean; /** @@ -743,13 +727,6 @@ export interface FieldOptions { deprecated: boolean; /** For Google-internal migration only. Do not use. */ weak: boolean; - /** - * Indicate that the field value should not be printed out when using debug - * formats, e.g. when the field contains sensitive credentials. - */ - debugRedact: boolean; - retention: FieldOptions_OptionRetention; - target: FieldOptions_OptionTargetType; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -836,137 +813,6 @@ export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { } } -/** - * If set to RETENTION_SOURCE, the option will be omitted from the binary. - * Note: as of January 2023, support for this is in progress and does not yet - * have an effect (b/264593489). - */ -export enum FieldOptions_OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { - switch (object) { - case 0: - case "RETENTION_UNKNOWN": - return FieldOptions_OptionRetention.RETENTION_UNKNOWN; - case 1: - case "RETENTION_RUNTIME": - return FieldOptions_OptionRetention.RETENTION_RUNTIME; - case 2: - case "RETENTION_SOURCE": - return FieldOptions_OptionRetention.RETENTION_SOURCE; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_OptionRetention.UNRECOGNIZED; - } -} - -export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { - switch (object) { - case FieldOptions_OptionRetention.RETENTION_UNKNOWN: - return "RETENTION_UNKNOWN"; - case FieldOptions_OptionRetention.RETENTION_RUNTIME: - return "RETENTION_RUNTIME"; - case FieldOptions_OptionRetention.RETENTION_SOURCE: - return "RETENTION_SOURCE"; - case FieldOptions_OptionRetention.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * This indicates the types of entities that the field may apply to when used - * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. Note: as of January 2023, support for this is - * in progress and does not yet have an effect (b/264593489). - */ -export enum FieldOptions_OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9, - UNRECOGNIZED = -1, -} - -export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { - switch (object) { - case 0: - case "TARGET_TYPE_UNKNOWN": - return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; - case 1: - case "TARGET_TYPE_FILE": - return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; - case 2: - case "TARGET_TYPE_EXTENSION_RANGE": - return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; - case 3: - case "TARGET_TYPE_MESSAGE": - return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; - case 4: - case "TARGET_TYPE_FIELD": - return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; - case 5: - case "TARGET_TYPE_ONEOF": - return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; - case 6: - case "TARGET_TYPE_ENUM": - return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; - case 7: - case "TARGET_TYPE_ENUM_ENTRY": - return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; - case 8: - case "TARGET_TYPE_SERVICE": - return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; - case 9: - case "TARGET_TYPE_METHOD": - return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_OptionTargetType.UNRECOGNIZED; - } -} - -export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { - switch (object) { - case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: - return "TARGET_TYPE_UNKNOWN"; - case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: - return "TARGET_TYPE_FILE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: - return "TARGET_TYPE_EXTENSION_RANGE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: - return "TARGET_TYPE_MESSAGE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: - return "TARGET_TYPE_FIELD"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: - return "TARGET_TYPE_ONEOF"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: - return "TARGET_TYPE_ENUM"; - case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: - return "TARGET_TYPE_ENUM_ENTRY"; - case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: - return "TARGET_TYPE_SERVICE"; - case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: - return "TARGET_TYPE_METHOD"; - case FieldOptions_OptionTargetType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - export interface OneofOptions { /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; @@ -985,17 +831,6 @@ export interface EnumOptions { * is a formalization for deprecating enums. */ deprecated: boolean; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * TODO(b/261750190) Remove this legacy behavior once downstream teams have - * had time to migrate. - * - * @deprecated - */ - deprecatedLegacyJsonFieldConflicts: boolean; /** The parser stores options it doesn't recognize here. See above. */ uninterpretedOption: UninterpretedOption[]; } @@ -1287,57 +1122,10 @@ export interface GeneratedCodeInfo_Annotation { begin: number; /** * Identifies the ending offset in bytes in the generated code that - * relates to the identified object. The end offset should be one past + * relates to the identified offset. The end offset should be one past * the last relevant byte (so the length of the text = end - begin). */ end: number; - semantic: GeneratedCodeInfo_Annotation_Semantic; -} - -/** - * Represents the identified object's effect on the element in the original - * .proto file. - */ -export enum GeneratedCodeInfo_Annotation_Semantic { - /** NONE - There is no effect or the effect is indescribable. */ - NONE = 0, - /** SET - The element is set or otherwise mutated. */ - SET = 1, - /** ALIAS - An alias to the element is returned. */ - ALIAS = 2, - UNRECOGNIZED = -1, -} - -export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { - switch (object) { - case 0: - case "NONE": - return GeneratedCodeInfo_Annotation_Semantic.NONE; - case 1: - case "SET": - return GeneratedCodeInfo_Annotation_Semantic.SET; - case 2: - case "ALIAS": - return GeneratedCodeInfo_Annotation_Semantic.ALIAS; - case -1: - case "UNRECOGNIZED": - default: - return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; - } -} - -export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { - switch (object) { - case GeneratedCodeInfo_Annotation_Semantic.NONE: - return "NONE"; - case GeneratedCodeInfo_Annotation_Semantic.SET: - return "SET"; - case GeneratedCodeInfo_Annotation_Semantic.ALIAS: - return "ALIAS"; - case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } } function createBaseFileDescriptorSet(): FileDescriptorSet { @@ -1414,7 +1202,6 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { options: undefined, sourceCodeInfo: undefined, syntax: "", - edition: "", }; } @@ -1460,9 +1247,6 @@ export const FileDescriptorProto = { if (message.syntax !== "") { writer.uint32(98).string(message.syntax); } - if (message.edition !== "") { - writer.uint32(106).string(message.edition); - } return writer; }, @@ -1577,13 +1361,6 @@ export const FileDescriptorProto = { message.syntax = reader.string(); continue; - case 13: - if (tag !== 106) { - break; - } - - message.edition = reader.string(); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -1613,7 +1390,6 @@ export const FileDescriptorProto = { options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, syntax: isSet(object.syntax) ? String(object.syntax) : "", - edition: isSet(object.edition) ? String(object.edition) : "", }; }, @@ -1660,7 +1436,6 @@ export const FileDescriptorProto = { message.sourceCodeInfo !== undefined && (obj.sourceCodeInfo = message.sourceCodeInfo ? SourceCodeInfo.toJSON(message.sourceCodeInfo) : undefined); message.syntax !== undefined && (obj.syntax = message.syntax); - message.edition !== undefined && (obj.edition = message.edition); return obj; }, @@ -1686,7 +1461,6 @@ export const FileDescriptorProto = { ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) : undefined; message.syntax = object.syntax ?? ""; - message.edition = object.edition ?? ""; return message; }, }; @@ -3287,7 +3061,6 @@ function createBaseMessageOptions(): MessageOptions { noStandardDescriptorAccessor: false, deprecated: false, mapEntry: false, - deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [], }; } @@ -3306,9 +3079,6 @@ export const MessageOptions = { if (message.mapEntry === true) { writer.uint32(56).bool(message.mapEntry); } - if (message.deprecatedLegacyJsonFieldConflicts === true) { - writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); - } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3350,13 +3120,6 @@ export const MessageOptions = { message.mapEntry = reader.bool(); continue; - case 11: - if (tag !== 88) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; case 999: if (tag !== 7994) { break; @@ -3381,9 +3144,6 @@ export const MessageOptions = { : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, - deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) - ? Boolean(object.deprecatedLegacyJsonFieldConflicts) - : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3397,8 +3157,6 @@ export const MessageOptions = { (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); - message.deprecatedLegacyJsonFieldConflicts !== undefined && - (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3417,7 +3175,6 @@ export const MessageOptions = { message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; message.deprecated = object.deprecated ?? false; message.mapEntry = object.mapEntry ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -3432,9 +3189,6 @@ function createBaseFieldOptions(): FieldOptions { unverifiedLazy: false, deprecated: false, weak: false, - debugRedact: false, - retention: 0, - target: 0, uninterpretedOption: [], }; } @@ -3462,15 +3216,6 @@ export const FieldOptions = { if (message.weak === true) { writer.uint32(80).bool(message.weak); } - if (message.debugRedact === true) { - writer.uint32(128).bool(message.debugRedact); - } - if (message.retention !== 0) { - writer.uint32(136).int32(message.retention); - } - if (message.target !== 0) { - writer.uint32(144).int32(message.target); - } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3533,27 +3278,6 @@ export const FieldOptions = { message.weak = reader.bool(); continue; - case 16: - if (tag !== 128) { - break; - } - - message.debugRedact = reader.bool(); - continue; - case 17: - if (tag !== 136) { - break; - } - - message.retention = reader.int32() as any; - continue; - case 18: - if (tag !== 144) { - break; - } - - message.target = reader.int32() as any; - continue; case 999: if (tag !== 7994) { break; @@ -3579,9 +3303,6 @@ export const FieldOptions = { unverifiedLazy: isSet(object.unverifiedLazy) ? Boolean(object.unverifiedLazy) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, weak: isSet(object.weak) ? Boolean(object.weak) : false, - debugRedact: isSet(object.debugRedact) ? Boolean(object.debugRedact) : false, - retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, - target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3597,9 +3318,6 @@ export const FieldOptions = { message.unverifiedLazy !== undefined && (obj.unverifiedLazy = message.unverifiedLazy); message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.weak !== undefined && (obj.weak = message.weak); - message.debugRedact !== undefined && (obj.debugRedact = message.debugRedact); - message.retention !== undefined && (obj.retention = fieldOptions_OptionRetentionToJSON(message.retention)); - message.target !== undefined && (obj.target = fieldOptions_OptionTargetTypeToJSON(message.target)); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3621,9 +3339,6 @@ export const FieldOptions = { message.unverifiedLazy = object.unverifiedLazy ?? false; message.deprecated = object.deprecated ?? false; message.weak = object.weak ?? false; - message.debugRedact = object.debugRedact ?? false; - message.retention = object.retention ?? 0; - message.target = object.target ?? 0; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -3694,7 +3409,7 @@ export const OneofOptions = { }; function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] }; + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; } export const EnumOptions = { @@ -3705,9 +3420,6 @@ export const EnumOptions = { if (message.deprecated === true) { writer.uint32(24).bool(message.deprecated); } - if (message.deprecatedLegacyJsonFieldConflicts === true) { - writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); - } for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } @@ -3735,13 +3447,6 @@ export const EnumOptions = { message.deprecated = reader.bool(); continue; - case 6: - if (tag !== 48) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; case 999: if (tag !== 7994) { break; @@ -3762,9 +3467,6 @@ export const EnumOptions = { return { allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) - ? Boolean(object.deprecatedLegacyJsonFieldConflicts) - : false, uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [], @@ -3775,8 +3477,6 @@ export const EnumOptions = { const obj: any = {}; message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.deprecatedLegacyJsonFieldConflicts !== undefined && - (obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts); if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => e ? UninterpretedOption.toJSON(e) : undefined); } else { @@ -3793,7 +3493,6 @@ export const EnumOptions = { const message = createBaseEnumOptions(); message.allowAlias = object.allowAlias ?? false; message.deprecated = object.deprecated ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; return message; }, @@ -4543,7 +4242,7 @@ export const GeneratedCodeInfo = { }; function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; + return { path: [], sourceFile: "", begin: 0, end: 0 }; } export const GeneratedCodeInfo_Annotation = { @@ -4562,9 +4261,6 @@ export const GeneratedCodeInfo_Annotation = { if (message.end !== 0) { writer.uint32(32).int32(message.end); } - if (message.semantic !== 0) { - writer.uint32(40).int32(message.semantic); - } return writer; }, @@ -4613,13 +4309,6 @@ export const GeneratedCodeInfo_Annotation = { message.end = reader.int32(); continue; - case 5: - if (tag !== 40) { - break; - } - - message.semantic = reader.int32() as any; - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -4635,7 +4324,6 @@ export const GeneratedCodeInfo_Annotation = { sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", begin: isSet(object.begin) ? Number(object.begin) : 0, end: isSet(object.end) ? Number(object.end) : 0, - semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, }; }, @@ -4649,7 +4337,6 @@ export const GeneratedCodeInfo_Annotation = { message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); message.begin !== undefined && (obj.begin = Math.round(message.begin)); message.end !== undefined && (obj.end = Math.round(message.end)); - message.semantic !== undefined && (obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic)); return obj; }, @@ -4663,7 +4350,6 @@ export const GeneratedCodeInfo_Annotation = { message.sourceFile = object.sourceFile ?? ""; message.begin = object.begin ?? 0; message.end = object.end ?? 0; - message.semantic = object.semantic ?? 0; return message; }, }; diff --git a/app/controlplane/cmd/wire_gen.go b/app/controlplane/cmd/wire_gen.go index 1c96f3ae5..72d52d91c 100644 --- a/app/controlplane/cmd/wire_gen.go +++ b/app/controlplane/cmd/wire_gen.go @@ -112,7 +112,6 @@ func wireApp(bootstrap *conf.Bootstrap, readerWriter credentials.ReaderWriter, l return nil, nil, err } orgMetricsService := service.NewOrgMetricsService(orgMetricsUseCase, v2...) - ociRepositoryService := service.NewOCIRepositoryService(casBackendUseCase, v2...) integrationsService := service.NewIntegrationsService(integrationUseCase, workflowUseCase, availablePlugins, v2...) organizationService := service.NewOrganizationService(membershipUseCase, v2...) casBackendService := service.NewCASBackendService(casBackendUseCase, providers, v2...) @@ -131,7 +130,6 @@ func wireApp(bootstrap *conf.Bootstrap, readerWriter credentials.ReaderWriter, l ContextSvc: contextService, CASCredsSvc: casCredentialsService, OrgMetricsSvc: orgMetricsService, - OCIRepositorySvc: ociRepositoryService, IntegrationsSvc: integrationsService, OrganizationSvc: organizationService, CASBackendSvc: casBackendService, diff --git a/app/controlplane/internal/server/grpc.go b/app/controlplane/internal/server/grpc.go index 95c90244a..4cfddcd28 100644 --- a/app/controlplane/internal/server/grpc.go +++ b/app/controlplane/internal/server/grpc.go @@ -60,7 +60,6 @@ type Opts struct { ContextSvc *service.ContextService CASCredsSvc *service.CASCredentialsService OrgMetricsSvc *service.OrgMetricsService - OCIRepositorySvc *service.OCIRepositoryService IntegrationsSvc *service.IntegrationsService OrganizationSvc *service.OrganizationService CASBackendSvc *service.CASBackendService @@ -96,7 +95,6 @@ func NewGRPCServer(opts *Opts) *grpc.Server { v1.RegisterAttestationServiceServer(srv, opts.AttestationSvc) v1.RegisterWorkflowContractServiceServer(srv, opts.WorkflowContractSvc) v1.RegisterCASCredentialsServiceServer(srv, opts.CASCredsSvc) - v1.RegisterOCIRepositoryServiceServer(srv, opts.OCIRepositorySvc) v1.RegisterContextServiceServer(srv, opts.ContextSvc) v1.RegisterOrgMetricsServiceServer(srv, opts.OrgMetricsSvc) v1.RegisterIntegrationsServiceServer(srv, opts.IntegrationsSvc) diff --git a/app/controlplane/internal/service/attestation.go b/app/controlplane/internal/service/attestation.go index d5d5bdf31..502402976 100644 --- a/app/controlplane/internal/service/attestation.go +++ b/app/controlplane/internal/service/attestation.go @@ -277,7 +277,7 @@ func (s *AttestationService) GetUploadCreds(ctx context.Context, req *cpAPI.Atte } // Return the backend information and associated credentials (if applicable) - resp := &cpAPI.AttestationServiceGetUploadCredsResponse_Result{Backend: bizOCASBackendToPb(backend)} + resp := &cpAPI.AttestationServiceGetUploadCredsResponse_Result{Backend: bizCASBackendToPb(backend)} if backend.SecretName != "" { t, err := s.casCredsUseCase.GenerateTemporaryCredentials(backend.SecretName, casJWT.Uploader) if err != nil { diff --git a/app/controlplane/internal/service/casbackend.go b/app/controlplane/internal/service/casbackend.go index 2251089bc..5fcb0d559 100644 --- a/app/controlplane/internal/service/casbackend.go +++ b/app/controlplane/internal/service/casbackend.go @@ -56,7 +56,7 @@ func (s *CASBackendService) List(ctx context.Context, _ *pb.CASBackendServiceLis res := []*pb.CASBackendItem{} for _, backend := range backends { - res = append(res, bizOCASBackendToPb(backend)) + res = append(res, bizCASBackendToPb(backend)) } return &pb.CASBackendServiceListResponse{Result: res}, nil @@ -90,7 +90,7 @@ func (s *CASBackendService) Create(ctx context.Context, req *pb.CASBackendServic return nil, handleErr(err, s.log) } - return &pb.CASBackendServiceCreateResponse{Result: bizOCASBackendToPb(res)}, nil + return &pb.CASBackendServiceCreateResponse{Result: bizCASBackendToPb(res)}, nil } func (s *CASBackendService) Update(ctx context.Context, req *pb.CASBackendServiceUpdateRequest) (*pb.CASBackendServiceUpdateResponse, error) { @@ -132,7 +132,7 @@ func (s *CASBackendService) Update(ctx context.Context, req *pb.CASBackendServic return nil, handleErr(err, s.log) } - return &pb.CASBackendServiceUpdateResponse{Result: bizOCASBackendToPb(res)}, nil + return &pb.CASBackendServiceUpdateResponse{Result: bizCASBackendToPb(res)}, nil } // Delete the CAS backend @@ -150,7 +150,7 @@ func (s *CASBackendService) Delete(ctx context.Context, req *pb.CASBackendServic return &pb.CASBackendServiceDeleteResponse{}, nil } -func bizOCASBackendToPb(in *biz.CASBackend) *pb.CASBackendItem { +func bizCASBackendToPb(in *biz.CASBackend) *pb.CASBackendItem { r := &pb.CASBackendItem{ Id: in.ID.String(), Location: in.Location, Description: in.Description, CreatedAt: timestamppb.New(*in.CreatedAt), diff --git a/app/controlplane/internal/service/context.go b/app/controlplane/internal/service/context.go index 08ce55323..adb847a49 100644 --- a/app/controlplane/internal/service/context.go +++ b/app/controlplane/internal/service/context.go @@ -51,13 +51,13 @@ func (s *ContextService) Current(ctx context.Context, _ *pb.ContextServiceCurren CurrentOrg: bizOrgToPb((*biz.Organization)(currentOrg)), } - repo, err := s.uc.FindDefaultBackend(ctx, currentOrg.ID) + backend, err := s.uc.FindDefaultBackend(ctx, currentOrg.ID) if err != nil && !biz.IsNotFound(err) { return nil, sl.LogAndMaskErr(err, s.log) } - if repo != nil { - res.CurrentOciRepo = bizOCIRepoToPb(repo) + if backend != nil { + res.CurrentCasBackend = bizCASBackendToPb(backend) } return &pb.ContextServiceCurrentResponse{ diff --git a/app/controlplane/internal/service/ocirepository.go b/app/controlplane/internal/service/ocirepository.go deleted file mode 100644 index 607e94729..000000000 --- a/app/controlplane/internal/service/ocirepository.go +++ /dev/null @@ -1,92 +0,0 @@ -// -// Copyright 2023 The Chainloop Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package service - -import ( - "context" - - pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1" - "github.com/chainloop-dev/chainloop/app/controlplane/internal/biz" - "github.com/chainloop-dev/chainloop/internal/blobmanager/oci" - "github.com/chainloop-dev/chainloop/internal/ociauth" - sl "github.com/chainloop-dev/chainloop/internal/servicelogger" - errors "github.com/go-kratos/kratos/v2/errors" - "google.golang.org/protobuf/types/known/timestamppb" -) - -type OCIRepositoryService struct { - pb.UnimplementedOCIRepositoryServiceServer - *service - - uc *biz.CASBackendUseCase -} - -func NewOCIRepositoryService(uc *biz.CASBackendUseCase, opts ...NewOpt) *OCIRepositoryService { - return &OCIRepositoryService{ - service: newService(opts...), - uc: uc, - } -} - -func (s *OCIRepositoryService) Save(ctx context.Context, req *pb.OCIRepositoryServiceSaveRequest) (*pb.OCIRepositoryServiceSaveResponse, error) { - _, currentOrg, err := loadCurrentUserAndOrg(ctx) - if err != nil { - return nil, err - } - - username := req.GetKeyPair().Username - password := req.GetKeyPair().Password - - // Create and validate credentials - k, err := ociauth.NewCredentials(req.Repository, username, password) - if err != nil { - return nil, errors.BadRequest("wrong credentials", err.Error()) - } - - // Check credentials - b, err := oci.NewBackend(req.Repository, &oci.RegistryOptions{Keychain: k}) - if err != nil { - return nil, sl.LogAndMaskErr(err, s.log) - } - - if err := b.CheckWritePermissions(context.TODO()); err != nil { - s.log.Error(err) - return nil, errors.BadRequest("wrong credentials", "the provided registry credentials are invalid") - } - - // For now we only support one backend which is set as default - _, err = s.uc.CreateOrUpdate(ctx, currentOrg.ID, req.Repository, username, password, biz.CASBackendOCI, true) - if err != nil { - return nil, sl.LogAndMaskErr(err, s.log) - } - - return &pb.OCIRepositoryServiceSaveResponse{}, nil -} - -func bizOCIRepoToPb(repo *biz.CASBackend) *pb.OCIRepositoryItem { - r := &pb.OCIRepositoryItem{ - Id: repo.ID.String(), Repo: repo.Location, CreatedAt: timestamppb.New(*repo.CreatedAt), - } - - switch repo.ValidationStatus { - case biz.CASBackendValidationOK: - r.ValidationStatus = pb.OCIRepositoryItem_VALIDATION_STATUS_OK - case biz.CASBackendValidationFailed: - r.ValidationStatus = pb.OCIRepositoryItem_VALIDATION_STATUS_INVALID - } - - return r -} diff --git a/app/controlplane/internal/service/service.go b/app/controlplane/internal/service/service.go index a8cc45270..cf1ba507c 100644 --- a/app/controlplane/internal/service/service.go +++ b/app/controlplane/internal/service/service.go @@ -35,7 +35,6 @@ var ProviderSet = wire.NewSet( NewAttestationService, NewWorkflowSchemaService, NewCASCredentialsService, - NewOCIRepositoryService, NewContextService, NewOrgMetricsService, NewIntegrationsService, diff --git a/app/controlplane/internal/usercontext/orgrequirements_middleware.go b/app/controlplane/internal/usercontext/orgrequirements_middleware.go index 54b67324b..f99babfdd 100644 --- a/app/controlplane/internal/usercontext/orgrequirements_middleware.go +++ b/app/controlplane/internal/usercontext/orgrequirements_middleware.go @@ -40,7 +40,7 @@ func CheckOrgRequirements(uc biz.CASBackendReader) middleware.Middleware { if err != nil && !biz.IsNotFound(err) { return nil, fmt.Errorf("checking for CAS backends in the org: %w", err) } else if repo == nil { - return nil, v1.ErrorOciRepositoryErrorReasonRequired("your organization does not have an CAS Backend configured yet") + return nil, v1.ErrorCasBackendErrorReasonRequired("your organization does not have an CAS Backend configured yet") } // 2 - Perform a validation if needed @@ -53,7 +53,7 @@ func CheckOrgRequirements(uc biz.CASBackendReader) middleware.Middleware { // 2 - compare the status if repo.ValidationStatus != biz.CASBackendValidationOK { - return nil, v1.ErrorOciRepositoryErrorReasonInvalid("your CAS backend can't be reached") + return nil, v1.ErrorCasBackendErrorReasonInvalid("your CAS backend can't be reached") } return handler(ctx, req)