diff --git a/.DS_Store b/.DS_Store index 9f2958c3b..ec65982af 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Wire.go b/Wire.go index 8e0efd282..9bca14f2b 100644 --- a/Wire.go +++ b/Wire.go @@ -21,6 +21,7 @@ package main import ( "github.com/devtron-labs/authenticator/client" + "github.com/devtron-labs/common-lib/helmLib/registry" "github.com/devtron-labs/common-lib/monitoring" "github.com/devtron-labs/common-lib/utils/k8s" "github.com/devtron-labs/kubelink/api/router" @@ -61,6 +62,12 @@ func InitializeApp() (*App, error) { //cache.NewClusterCacheImpl, //wire.Bind(new(cache.ClusterCache), new(*cache.ClusterCacheImpl)), //cache.GetClusterCacheConfig, + registry.NewSettingsFactoryImpl, + wire.Bind(new(registry.SettingsFactory), new(*registry.SettingsFactoryImpl)), + + registry.NewDefaultSettingsGetter, + wire.Bind(new(registry.DefaultSettingsGetter), new(*registry.DefaultSettingsGetterImpl)), + monitoring.NewMonitoringRouter, ) return &App{}, nil diff --git a/bean/Bean.go b/bean/Bean.go index ad4af381d..66264b7cd 100644 --- a/bean/Bean.go +++ b/bean/Bean.go @@ -1,7 +1,7 @@ package bean import ( - "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" + remoteConnectionBean "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" client "github.com/devtron-labs/kubelink/grpc" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -224,13 +224,13 @@ type EphemeralContainerStatusesInfo struct { } type ClusterInfo struct { - ClusterId int `json:"clusterId"` - ClusterName string `json:"clusterName"` - BearerToken string `json:"bearerToken"` - ServerUrl string `json:"serverUrl"` - InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify"` - KeyData string `json:"-"` - CertData string `json:"-"` - CAData string `json:"-"` - RemoteConnectionConfig *bean.RemoteConnectionConfigBean + ClusterId int `json:"clusterId"` + ClusterName string `json:"clusterName"` + BearerToken string `json:"bearerToken"` + ServerUrl string `json:"serverUrl"` + InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify"` + KeyData string `json:"-"` + CertData string `json:"-"` + CAData string `json:"-"` + RemoteConnectionConfig *remoteConnectionBean.RemoteConnectionConfigBean `json:"remoteConnectionConfig"` } diff --git a/go.mod b/go.mod index 5ba980cfb..5e5079713 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.21 require ( //github.com/argoproj/gitops-engine v0.7.1-0.20231013183858-f15cf615b814 - github.com/aws/aws-sdk-go v1.44.285 + github.com/aws/aws-sdk-go v1.44.285 // indirect github.com/caarlos0/env v3.5.0+incompatible - github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 + github.com/devtron-labs/common-lib v0.0.19-0.20240603142207-287a5e876a52 github.com/docker/docker-credential-helpers v0.7.0 // indirect github.com/evanphx/json-patch v5.7.0+incompatible github.com/go-pg/pg v6.15.1+incompatible diff --git a/go.sum b/go.sum index e7a275b7e..3eef45edd 100644 --- a/go.sum +++ b/go.sum @@ -716,8 +716,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/devtron-labs/authenticator v0.4.31 h1:CEMLek3JnMuH9ULsC6BHNJr+NiyGzBd4lgdSxH2IGnc= github.com/devtron-labs/authenticator v0.4.31/go.mod h1:ozNfT8WcruiSgnUbyp48WVfc41++W6xYXhKFp67lNTU= -github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 h1:lUcMarRvAKzsLpmuYwFgOsKLJQpHsJuvbKG+we/dI58= -github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694/go.mod h1:deAcJ5IjUjM6ozZQLJEgPWDUA0mKa632LBsKx8uM9TE= +github.com/devtron-labs/common-lib v0.0.19-0.20240603142207-287a5e876a52 h1:7Bpn80KXfZHScF1aStQT6Tv3lZZ6dx3fQWIHq44/LkI= +github.com/devtron-labs/common-lib v0.0.19-0.20240603142207-287a5e876a52/go.mod h1:UgYkD75M0rsC4UBPBnUE87H0JIZ7n3P+u5yXsWIkoi0= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= diff --git a/grpc/applist.pb.go b/grpc/applist.pb.go index ddbd15fa8..c85bf7982 100644 --- a/grpc/applist.pb.go +++ b/grpc/applist.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v3.9.1 // source: grpc/applist.proto @@ -24,8 +24,9 @@ const ( type RemoteConnectionMethod int32 const ( - RemoteConnectionMethod_PROXY RemoteConnectionMethod = 0 - RemoteConnectionMethod_SSH RemoteConnectionMethod = 1 + RemoteConnectionMethod_PROXY RemoteConnectionMethod = 0 + RemoteConnectionMethod_SSH RemoteConnectionMethod = 1 + RemoteConnectionMethod_DIRECT RemoteConnectionMethod = 2 ) // Enum value maps for RemoteConnectionMethod. @@ -33,10 +34,12 @@ var ( RemoteConnectionMethod_name = map[int32]string{ 0: "PROXY", 1: "SSH", + 2: "DIRECT", } RemoteConnectionMethod_value = map[string]int32{ - "PROXY": 0, - "SSH": 1, + "PROXY": 0, + "SSH": 1, + "DIRECT": 2, } ) @@ -3613,15 +3616,19 @@ type RegistryCredential struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RegistryUrl string `protobuf:"bytes,1,opt,name=RegistryUrl,proto3" json:"RegistryUrl,omitempty"` - Username string `protobuf:"bytes,2,opt,name=Username,proto3" json:"Username,omitempty"` - Password string `protobuf:"bytes,3,opt,name=Password,proto3" json:"Password,omitempty"` - AwsRegion string `protobuf:"bytes,4,opt,name=AwsRegion,proto3" json:"AwsRegion,omitempty"` - AccessKey string `protobuf:"bytes,5,opt,name=AccessKey,proto3" json:"AccessKey,omitempty"` - SecretKey string `protobuf:"bytes,6,opt,name=SecretKey,proto3" json:"SecretKey,omitempty"` - RegistryType string `protobuf:"bytes,7,opt,name=RegistryType,proto3" json:"RegistryType,omitempty"` - RepoName string `protobuf:"bytes,8,opt,name=RepoName,proto3" json:"RepoName,omitempty"` - IsPublic bool `protobuf:"varint,9,opt,name=IsPublic,proto3" json:"IsPublic,omitempty"` + RegistryUrl string `protobuf:"bytes,1,opt,name=RegistryUrl,proto3" json:"RegistryUrl,omitempty"` + Username string `protobuf:"bytes,2,opt,name=Username,proto3" json:"Username,omitempty"` + Password string `protobuf:"bytes,3,opt,name=Password,proto3" json:"Password,omitempty"` + AwsRegion string `protobuf:"bytes,4,opt,name=AwsRegion,proto3" json:"AwsRegion,omitempty"` + AccessKey string `protobuf:"bytes,5,opt,name=AccessKey,proto3" json:"AccessKey,omitempty"` + SecretKey string `protobuf:"bytes,6,opt,name=SecretKey,proto3" json:"SecretKey,omitempty"` + RegistryType string `protobuf:"bytes,7,opt,name=RegistryType,proto3" json:"RegistryType,omitempty"` + RepoName string `protobuf:"bytes,8,opt,name=RepoName,proto3" json:"RepoName,omitempty"` + IsPublic bool `protobuf:"varint,9,opt,name=IsPublic,proto3" json:"IsPublic,omitempty"` + RemoteConnectionConfig *RemoteConnectionConfig `protobuf:"bytes,10,opt,name=RemoteConnectionConfig,proto3" json:"RemoteConnectionConfig,omitempty"` + Connection string `protobuf:"bytes,11,opt,name=Connection,proto3" json:"Connection,omitempty"` + RegistryName string `protobuf:"bytes,12,opt,name=RegistryName,proto3" json:"RegistryName,omitempty"` + RegistryCertificate string `protobuf:"bytes,13,opt,name=RegistryCertificate,proto3" json:"RegistryCertificate,omitempty"` } func (x *RegistryCredential) Reset() { @@ -3719,6 +3726,34 @@ func (x *RegistryCredential) GetIsPublic() bool { return false } +func (x *RegistryCredential) GetRemoteConnectionConfig() *RemoteConnectionConfig { + if x != nil { + return x.RemoteConnectionConfig + } + return nil +} + +func (x *RegistryCredential) GetConnection() string { + if x != nil { + return x.Connection + } + return "" +} + +func (x *RegistryCredential) GetRegistryName() string { + if x != nil { + return x.RegistryName + } + return "" +} + +func (x *RegistryCredential) GetRegistryCertificate() string { + if x != nil { + return x.RegistryCertificate + } + return "" +} + type ProxyConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4537,7 +4572,7 @@ var file_grpc_applist_proto_rawDesc = []byte{ 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x22, 0xa4, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x67, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x22, 0xeb, 0x03, 0x0a, 0x12, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x55, 0x72, @@ -4555,158 +4590,171 @@ var file_grpc_applist_proto_rawDesc = []byte{ 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, - 0x29, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, - 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, 0x6c, 0x22, 0xa1, 0x01, 0x0a, 0x0f, 0x53, - 0x53, 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, - 0x0a, 0x10, 0x53, 0x53, 0x48, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x53, 0x53, 0x48, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x53, - 0x48, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x53, 0x53, 0x48, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x53, 0x53, 0x48, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x53, 0x53, 0x48, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1e, - 0x0a, 0x0a, 0x53, 0x53, 0x48, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x53, 0x53, 0x48, 0x41, 0x75, 0x74, 0x68, 0x4b, 0x65, 0x79, 0x22, 0xd5, - 0x01, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4f, 0x0a, 0x16, 0x52, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x52, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2e, 0x0a, 0x0b, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0f, 0x53, 0x53, - 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x53, 0x53, 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x53, 0x53, 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x6f, 0x0a, 0x13, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, - 0x0a, 0x49, 0x73, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x64, 0x49, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x49, 0x73, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x64, 0x49, 0x6e, 0x12, 0x38, 0x0a, - 0x0a, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, - 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x50, 0x75, 0x73, - 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4f, 0x0a, 0x17, 0x4f, 0x43, 0x49, 0x52, 0x65, + 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, + 0x4f, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x29, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, + 0x6c, 0x22, 0xa1, 0x01, 0x0a, 0x0f, 0x53, 0x53, 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x53, 0x53, 0x48, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x53, 0x53, 0x48, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x53, 0x48, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x53, 0x53, 0x48, 0x55, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x53, 0x48, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x53, 0x53, 0x48, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x53, 0x48, 0x41, 0x75, 0x74, 0x68, + 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x53, 0x48, 0x41, 0x75, + 0x74, 0x68, 0x4b, 0x65, 0x79, 0x22, 0xd5, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x4f, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x17, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x12, 0x2e, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x3a, 0x0a, 0x0f, 0x53, 0x53, 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x53, 0x53, 0x48, + 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x53, 0x53, + 0x48, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x6f, 0x0a, + 0x13, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x73, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x64, + 0x49, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x49, 0x73, 0x4c, 0x6f, 0x67, 0x67, + 0x65, 0x64, 0x49, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x75, - 0x73, 0x68, 0x65, 0x64, 0x55, 0x52, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50, - 0x75, 0x73, 0x68, 0x65, 0x64, 0x55, 0x52, 0x4c, 0x2a, 0x2c, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x52, 0x4f, 0x58, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x53, 0x53, 0x48, 0x10, 0x01, 0x32, 0x8e, 0x0d, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, - 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x0f, 0x2e, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, 0x41, 0x70, 0x70, - 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, - 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x2e, 0x41, 0x70, - 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x0c, 0x47, 0x65, 0x74, - 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x2e, 0x41, - 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x09, 0x48, 0x69, - 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x11, 0x2e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x48, 0x69, 0x62, - 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x36, 0x0a, 0x0b, 0x55, 0x6e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x12, - 0x11, 0x2e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x41, 0x70, 0x70, 0x44, 0x65, 0x70, - 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x00, - 0x12, 0x32, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x59, 0x61, 0x6d, - 0x6c, 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x44, 0x65, 0x73, 0x69, 0x72, - 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x44, 0x65, 0x73, - 0x69, 0x72, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x10, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x2e, 0x52, 0x65, 0x6c, - 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, 0x19, - 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x2e, + 0x73, 0x65, 0x52, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x4f, + 0x0a, 0x17, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x50, 0x75, 0x73, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x44, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x44, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x75, 0x73, 0x68, 0x65, 0x64, 0x55, 0x52, 0x4c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50, 0x75, 0x73, 0x68, 0x65, 0x64, 0x55, 0x52, 0x4c, 0x2a, + 0x38, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x52, 0x4f, + 0x58, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x53, 0x48, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x10, 0x02, 0x32, 0x8e, 0x0d, 0x0a, 0x12, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x39, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x0f, 0x2e, 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, + 0x41, 0x70, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2f, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x11, 0x2e, 0x41, 0x70, + 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, + 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x0c, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x11, 0x2e, 0x41, + 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x0a, 0x2e, 0x41, 0x70, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x34, 0x0a, + 0x09, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x11, 0x2e, 0x48, 0x69, 0x62, + 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, + 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x0b, 0x55, 0x6e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, + 0x74, 0x65, 0x12, 0x11, 0x2e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x48, 0x69, 0x62, 0x65, 0x72, 0x6e, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x41, 0x70, 0x70, + 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x59, 0x61, 0x6d, 0x6c, 0x12, 0x11, 0x2e, 0x41, 0x70, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x44, 0x65, + 0x73, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, + 0x44, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x10, 0x55, 0x6e, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x1a, 0x19, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, + 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, + 0x12, 0x16, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x2e, 0x44, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, + 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x1b, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, + 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x4c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, - 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x19, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, - 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x1b, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x68, 0x61, 0x72, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x55, 0x70, 0x67, - 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x12, 0x49, 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, - 0x73, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x2e, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, - 0x10, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x10, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0d, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x11, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x1a, 0x2e, 0x42, 0x75, - 0x6c, 0x6b, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x1d, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, - 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x68, 0x61, 0x72, 0x74, 0x22, - 0x00, 0x12, 0x58, 0x0a, 0x1d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, - 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x68, 0x61, - 0x72, 0x74, 0x12, 0x19, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, - 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, - 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x12, 0x49, 0x73, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x12, + 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x1a, 0x10, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x52, 0x6f, 0x6c, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0d, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x13, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x1d, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x17, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x13, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x12, 0x13, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x1a, 0x14, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, - 0x0a, 0x1a, 0x50, 0x75, 0x73, 0x68, 0x48, 0x65, 0x6c, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x74, 0x54, - 0x6f, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x4f, - 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x14, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x23, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, 0x46, 0x6f, 0x72, 0x45, - 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x1c, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x74, 0x72, 0x6f, 0x6e, 0x2d, 0x6c, 0x61, - 0x62, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x62, 0x65, 0x61, 0x6e, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x16, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x11, 0x54, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x1a, + 0x2e, 0x42, 0x75, 0x6c, 0x6b, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x42, 0x75, 0x6c, + 0x6b, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x1d, 0x54, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x74, 0x72, + 0x69, 0x65, 0x76, 0x65, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x1d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x19, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1a, 0x2e, 0x48, 0x65, 0x6c, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x1d, 0x55, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, 0x55, 0x70, 0x67, + 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x6c, 0x65, + 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, + 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x1a, 0x14, 0x2e, 0x4f, 0x43, 0x49, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x49, 0x0a, 0x1a, 0x50, 0x75, 0x73, 0x68, 0x48, 0x65, 0x6c, 0x6d, 0x43, 0x68, 0x61, + 0x72, 0x74, 0x54, 0x6f, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, + 0x13, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x4f, 0x43, 0x49, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x23, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, 0x46, + 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x72, 0x65, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x65, 0x76, 0x74, 0x72, 0x6f, 0x6e, + 0x2d, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x62, + 0x65, 0x61, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4843,63 +4891,64 @@ var file_grpc_applist_proto_depIdxs = []int32{ 50, // 51: ResourceTreeFilter.globalFilter:type_name -> ResourceIdentifier 49, // 52: ResourceTreeFilter.resourceFilters:type_name -> ResourceFilter 54, // 53: OCIRegistryRequest.RegistryCredential:type_name -> RegistryCredential - 0, // 54: RemoteConnectionConfig.RemoteConnectionMethod:type_name -> RemoteConnectionMethod - 55, // 55: RemoteConnectionConfig.ProxyConfig:type_name -> ProxyConfig - 56, // 56: RemoteConnectionConfig.SSHTunnelConfig:type_name -> SSHTunnelConfig - 59, // 57: OCIRegistryResponse.PushResult:type_name -> OCIRegistryPushResponse - 2, // 58: ApplicationService.ListApplications:input_type -> AppListRequest - 8, // 59: ApplicationService.GetAppDetail:input_type -> AppDetailRequest - 8, // 60: ApplicationService.GetAppStatus:input_type -> AppDetailRequest - 21, // 61: ApplicationService.Hibernate:input_type -> HibernateRequest - 21, // 62: ApplicationService.UnHibernate:input_type -> HibernateRequest - 8, // 63: ApplicationService.GetDeploymentHistory:input_type -> AppDetailRequest - 8, // 64: ApplicationService.GetValuesYaml:input_type -> AppDetailRequest - 28, // 65: ApplicationService.GetDesiredManifest:input_type -> ObjectRequest - 31, // 66: ApplicationService.UninstallRelease:input_type -> ReleaseIdentifier - 32, // 67: ApplicationService.UpgradeRelease:input_type -> UpgradeReleaseRequest - 34, // 68: ApplicationService.GetDeploymentDetail:input_type -> DeploymentDetailRequest - 37, // 69: ApplicationService.InstallRelease:input_type -> InstallReleaseRequest - 37, // 70: ApplicationService.UpgradeReleaseWithChartInfo:input_type -> InstallReleaseRequest - 31, // 71: ApplicationService.IsReleaseInstalled:input_type -> ReleaseIdentifier - 41, // 72: ApplicationService.RollbackRelease:input_type -> RollbackReleaseRequest - 37, // 73: ApplicationService.TemplateChart:input_type -> InstallReleaseRequest - 38, // 74: ApplicationService.TemplateChartBulk:input_type -> BulkInstallReleaseRequest - 37, // 75: ApplicationService.TemplateChartAndRetrieveChart:input_type -> InstallReleaseRequest - 45, // 76: ApplicationService.InstallReleaseWithCustomChart:input_type -> HelmInstallCustomRequest - 37, // 77: ApplicationService.GetNotes:input_type -> InstallReleaseRequest - 32, // 78: ApplicationService.UpgradeReleaseWithCustomChart:input_type -> UpgradeReleaseRequest - 54, // 79: ApplicationService.ValidateOCIRegistry:input_type -> RegistryCredential - 53, // 80: ApplicationService.PushHelmChartToOCIRegistry:input_type -> OCIRegistryRequest - 3, // 81: ApplicationService.GetResourceTreeForExternalResources:input_type -> ExternalResourceTreeRequest - 5, // 82: ApplicationService.ListApplications:output_type -> DeployedAppList - 9, // 83: ApplicationService.GetAppDetail:output_type -> AppDetail - 10, // 84: ApplicationService.GetAppStatus:output_type -> AppStatus - 24, // 85: ApplicationService.Hibernate:output_type -> HibernateResponse - 24, // 86: ApplicationService.UnHibernate:output_type -> HibernateResponse - 26, // 87: ApplicationService.GetDeploymentHistory:output_type -> HelmAppDeploymentHistory - 27, // 88: ApplicationService.GetValuesYaml:output_type -> ReleaseInfo - 29, // 89: ApplicationService.GetDesiredManifest:output_type -> DesiredManifestResponse - 30, // 90: ApplicationService.UninstallRelease:output_type -> UninstallReleaseResponse - 33, // 91: ApplicationService.UpgradeRelease:output_type -> UpgradeReleaseResponse - 35, // 92: ApplicationService.GetDeploymentDetail:output_type -> DeploymentDetailResponse - 39, // 93: ApplicationService.InstallRelease:output_type -> InstallReleaseResponse - 33, // 94: ApplicationService.UpgradeReleaseWithChartInfo:output_type -> UpgradeReleaseResponse - 40, // 95: ApplicationService.IsReleaseInstalled:output_type -> BooleanResponse - 40, // 96: ApplicationService.RollbackRelease:output_type -> BooleanResponse - 42, // 97: ApplicationService.TemplateChart:output_type -> TemplateChartResponse - 43, // 98: ApplicationService.TemplateChartBulk:output_type -> BulkTemplateChartResponse - 44, // 99: ApplicationService.TemplateChartAndRetrieveChart:output_type -> TemplateChartResponseWithChart - 46, // 100: ApplicationService.InstallReleaseWithCustomChart:output_type -> HelmInstallCustomResponse - 52, // 101: ApplicationService.GetNotes:output_type -> ChartNotesResponse - 33, // 102: ApplicationService.UpgradeReleaseWithCustomChart:output_type -> UpgradeReleaseResponse - 58, // 103: ApplicationService.ValidateOCIRegistry:output_type -> OCIRegistryResponse - 58, // 104: ApplicationService.PushHelmChartToOCIRegistry:output_type -> OCIRegistryResponse - 13, // 105: ApplicationService.GetResourceTreeForExternalResources:output_type -> ResourceTreeResponse - 82, // [82:106] is the sub-list for method output_type - 58, // [58:82] is the sub-list for method input_type - 58, // [58:58] is the sub-list for extension type_name - 58, // [58:58] is the sub-list for extension extendee - 0, // [0:58] is the sub-list for field type_name + 57, // 54: RegistryCredential.RemoteConnectionConfig:type_name -> RemoteConnectionConfig + 0, // 55: RemoteConnectionConfig.RemoteConnectionMethod:type_name -> RemoteConnectionMethod + 55, // 56: RemoteConnectionConfig.ProxyConfig:type_name -> ProxyConfig + 56, // 57: RemoteConnectionConfig.SSHTunnelConfig:type_name -> SSHTunnelConfig + 59, // 58: OCIRegistryResponse.PushResult:type_name -> OCIRegistryPushResponse + 2, // 59: ApplicationService.ListApplications:input_type -> AppListRequest + 8, // 60: ApplicationService.GetAppDetail:input_type -> AppDetailRequest + 8, // 61: ApplicationService.GetAppStatus:input_type -> AppDetailRequest + 21, // 62: ApplicationService.Hibernate:input_type -> HibernateRequest + 21, // 63: ApplicationService.UnHibernate:input_type -> HibernateRequest + 8, // 64: ApplicationService.GetDeploymentHistory:input_type -> AppDetailRequest + 8, // 65: ApplicationService.GetValuesYaml:input_type -> AppDetailRequest + 28, // 66: ApplicationService.GetDesiredManifest:input_type -> ObjectRequest + 31, // 67: ApplicationService.UninstallRelease:input_type -> ReleaseIdentifier + 32, // 68: ApplicationService.UpgradeRelease:input_type -> UpgradeReleaseRequest + 34, // 69: ApplicationService.GetDeploymentDetail:input_type -> DeploymentDetailRequest + 37, // 70: ApplicationService.InstallRelease:input_type -> InstallReleaseRequest + 37, // 71: ApplicationService.UpgradeReleaseWithChartInfo:input_type -> InstallReleaseRequest + 31, // 72: ApplicationService.IsReleaseInstalled:input_type -> ReleaseIdentifier + 41, // 73: ApplicationService.RollbackRelease:input_type -> RollbackReleaseRequest + 37, // 74: ApplicationService.TemplateChart:input_type -> InstallReleaseRequest + 38, // 75: ApplicationService.TemplateChartBulk:input_type -> BulkInstallReleaseRequest + 37, // 76: ApplicationService.TemplateChartAndRetrieveChart:input_type -> InstallReleaseRequest + 45, // 77: ApplicationService.InstallReleaseWithCustomChart:input_type -> HelmInstallCustomRequest + 37, // 78: ApplicationService.GetNotes:input_type -> InstallReleaseRequest + 32, // 79: ApplicationService.UpgradeReleaseWithCustomChart:input_type -> UpgradeReleaseRequest + 54, // 80: ApplicationService.ValidateOCIRegistry:input_type -> RegistryCredential + 53, // 81: ApplicationService.PushHelmChartToOCIRegistry:input_type -> OCIRegistryRequest + 3, // 82: ApplicationService.GetResourceTreeForExternalResources:input_type -> ExternalResourceTreeRequest + 5, // 83: ApplicationService.ListApplications:output_type -> DeployedAppList + 9, // 84: ApplicationService.GetAppDetail:output_type -> AppDetail + 10, // 85: ApplicationService.GetAppStatus:output_type -> AppStatus + 24, // 86: ApplicationService.Hibernate:output_type -> HibernateResponse + 24, // 87: ApplicationService.UnHibernate:output_type -> HibernateResponse + 26, // 88: ApplicationService.GetDeploymentHistory:output_type -> HelmAppDeploymentHistory + 27, // 89: ApplicationService.GetValuesYaml:output_type -> ReleaseInfo + 29, // 90: ApplicationService.GetDesiredManifest:output_type -> DesiredManifestResponse + 30, // 91: ApplicationService.UninstallRelease:output_type -> UninstallReleaseResponse + 33, // 92: ApplicationService.UpgradeRelease:output_type -> UpgradeReleaseResponse + 35, // 93: ApplicationService.GetDeploymentDetail:output_type -> DeploymentDetailResponse + 39, // 94: ApplicationService.InstallRelease:output_type -> InstallReleaseResponse + 33, // 95: ApplicationService.UpgradeReleaseWithChartInfo:output_type -> UpgradeReleaseResponse + 40, // 96: ApplicationService.IsReleaseInstalled:output_type -> BooleanResponse + 40, // 97: ApplicationService.RollbackRelease:output_type -> BooleanResponse + 42, // 98: ApplicationService.TemplateChart:output_type -> TemplateChartResponse + 43, // 99: ApplicationService.TemplateChartBulk:output_type -> BulkTemplateChartResponse + 44, // 100: ApplicationService.TemplateChartAndRetrieveChart:output_type -> TemplateChartResponseWithChart + 46, // 101: ApplicationService.InstallReleaseWithCustomChart:output_type -> HelmInstallCustomResponse + 52, // 102: ApplicationService.GetNotes:output_type -> ChartNotesResponse + 33, // 103: ApplicationService.UpgradeReleaseWithCustomChart:output_type -> UpgradeReleaseResponse + 58, // 104: ApplicationService.ValidateOCIRegistry:output_type -> OCIRegistryResponse + 58, // 105: ApplicationService.PushHelmChartToOCIRegistry:output_type -> OCIRegistryResponse + 13, // 106: ApplicationService.GetResourceTreeForExternalResources:output_type -> ResourceTreeResponse + 83, // [83:107] is the sub-list for method output_type + 59, // [59:83] is the sub-list for method input_type + 59, // [59:59] is the sub-list for extension type_name + 59, // [59:59] is the sub-list for extension extendee + 0, // [0:59] is the sub-list for field type_name } func init() { file_grpc_applist_proto_init() } diff --git a/grpc/applist.proto b/grpc/applist.proto index ef75b5675..2332701d5 100644 --- a/grpc/applist.proto +++ b/grpc/applist.proto @@ -390,11 +390,16 @@ message RegistryCredential { string RegistryType = 7; string RepoName = 8; bool IsPublic = 9; + RemoteConnectionConfig RemoteConnectionConfig = 10; + string Connection = 11; + string RegistryName = 12; + string RegistryCertificate = 13; } enum RemoteConnectionMethod { PROXY = 0; SSH = 1; + DIRECT = 2 ; } message ProxyConfig { diff --git a/grpc/applist_grpc.pb.go b/grpc/applist_grpc.pb.go index c086c5bf6..8708663b7 100644 --- a/grpc/applist_grpc.pb.go +++ b/grpc/applist_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.9.1 // source: grpc/applist.proto @@ -18,6 +18,33 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + ApplicationService_ListApplications_FullMethodName = "/ApplicationService/ListApplications" + ApplicationService_GetAppDetail_FullMethodName = "/ApplicationService/GetAppDetail" + ApplicationService_GetAppStatus_FullMethodName = "/ApplicationService/GetAppStatus" + ApplicationService_Hibernate_FullMethodName = "/ApplicationService/Hibernate" + ApplicationService_UnHibernate_FullMethodName = "/ApplicationService/UnHibernate" + ApplicationService_GetDeploymentHistory_FullMethodName = "/ApplicationService/GetDeploymentHistory" + ApplicationService_GetValuesYaml_FullMethodName = "/ApplicationService/GetValuesYaml" + ApplicationService_GetDesiredManifest_FullMethodName = "/ApplicationService/GetDesiredManifest" + ApplicationService_UninstallRelease_FullMethodName = "/ApplicationService/UninstallRelease" + ApplicationService_UpgradeRelease_FullMethodName = "/ApplicationService/UpgradeRelease" + ApplicationService_GetDeploymentDetail_FullMethodName = "/ApplicationService/GetDeploymentDetail" + ApplicationService_InstallRelease_FullMethodName = "/ApplicationService/InstallRelease" + ApplicationService_UpgradeReleaseWithChartInfo_FullMethodName = "/ApplicationService/UpgradeReleaseWithChartInfo" + ApplicationService_IsReleaseInstalled_FullMethodName = "/ApplicationService/IsReleaseInstalled" + ApplicationService_RollbackRelease_FullMethodName = "/ApplicationService/RollbackRelease" + ApplicationService_TemplateChart_FullMethodName = "/ApplicationService/TemplateChart" + ApplicationService_TemplateChartBulk_FullMethodName = "/ApplicationService/TemplateChartBulk" + ApplicationService_TemplateChartAndRetrieveChart_FullMethodName = "/ApplicationService/TemplateChartAndRetrieveChart" + ApplicationService_InstallReleaseWithCustomChart_FullMethodName = "/ApplicationService/InstallReleaseWithCustomChart" + ApplicationService_GetNotes_FullMethodName = "/ApplicationService/GetNotes" + ApplicationService_UpgradeReleaseWithCustomChart_FullMethodName = "/ApplicationService/UpgradeReleaseWithCustomChart" + ApplicationService_ValidateOCIRegistry_FullMethodName = "/ApplicationService/ValidateOCIRegistry" + ApplicationService_PushHelmChartToOCIRegistry_FullMethodName = "/ApplicationService/PushHelmChartToOCIRegistry" + ApplicationService_GetResourceTreeForExternalResources_FullMethodName = "/ApplicationService/GetResourceTreeForExternalResources" +) + // ApplicationServiceClient is the client API for ApplicationService 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. @@ -57,7 +84,7 @@ func NewApplicationServiceClient(cc grpc.ClientConnInterface) ApplicationService } func (c *applicationServiceClient) ListApplications(ctx context.Context, in *AppListRequest, opts ...grpc.CallOption) (ApplicationService_ListApplicationsClient, error) { - stream, err := c.cc.NewStream(ctx, &ApplicationService_ServiceDesc.Streams[0], "/ApplicationService/ListApplications", opts...) + stream, err := c.cc.NewStream(ctx, &ApplicationService_ServiceDesc.Streams[0], ApplicationService_ListApplications_FullMethodName, opts...) if err != nil { return nil, err } @@ -90,7 +117,7 @@ func (x *applicationServiceListApplicationsClient) Recv() (*DeployedAppList, err func (c *applicationServiceClient) GetAppDetail(ctx context.Context, in *AppDetailRequest, opts ...grpc.CallOption) (*AppDetail, error) { out := new(AppDetail) - err := c.cc.Invoke(ctx, "/ApplicationService/GetAppDetail", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetAppDetail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -99,7 +126,7 @@ func (c *applicationServiceClient) GetAppDetail(ctx context.Context, in *AppDeta func (c *applicationServiceClient) GetAppStatus(ctx context.Context, in *AppDetailRequest, opts ...grpc.CallOption) (*AppStatus, error) { out := new(AppStatus) - err := c.cc.Invoke(ctx, "/ApplicationService/GetAppStatus", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetAppStatus_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -108,7 +135,7 @@ func (c *applicationServiceClient) GetAppStatus(ctx context.Context, in *AppDeta func (c *applicationServiceClient) Hibernate(ctx context.Context, in *HibernateRequest, opts ...grpc.CallOption) (*HibernateResponse, error) { out := new(HibernateResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/Hibernate", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_Hibernate_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -117,7 +144,7 @@ func (c *applicationServiceClient) Hibernate(ctx context.Context, in *HibernateR func (c *applicationServiceClient) UnHibernate(ctx context.Context, in *HibernateRequest, opts ...grpc.CallOption) (*HibernateResponse, error) { out := new(HibernateResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/UnHibernate", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_UnHibernate_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -126,7 +153,7 @@ func (c *applicationServiceClient) UnHibernate(ctx context.Context, in *Hibernat func (c *applicationServiceClient) GetDeploymentHistory(ctx context.Context, in *AppDetailRequest, opts ...grpc.CallOption) (*HelmAppDeploymentHistory, error) { out := new(HelmAppDeploymentHistory) - err := c.cc.Invoke(ctx, "/ApplicationService/GetDeploymentHistory", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetDeploymentHistory_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -135,7 +162,7 @@ func (c *applicationServiceClient) GetDeploymentHistory(ctx context.Context, in func (c *applicationServiceClient) GetValuesYaml(ctx context.Context, in *AppDetailRequest, opts ...grpc.CallOption) (*ReleaseInfo, error) { out := new(ReleaseInfo) - err := c.cc.Invoke(ctx, "/ApplicationService/GetValuesYaml", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetValuesYaml_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -144,7 +171,7 @@ func (c *applicationServiceClient) GetValuesYaml(ctx context.Context, in *AppDet func (c *applicationServiceClient) GetDesiredManifest(ctx context.Context, in *ObjectRequest, opts ...grpc.CallOption) (*DesiredManifestResponse, error) { out := new(DesiredManifestResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/GetDesiredManifest", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetDesiredManifest_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -153,7 +180,7 @@ func (c *applicationServiceClient) GetDesiredManifest(ctx context.Context, in *O func (c *applicationServiceClient) UninstallRelease(ctx context.Context, in *ReleaseIdentifier, opts ...grpc.CallOption) (*UninstallReleaseResponse, error) { out := new(UninstallReleaseResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/UninstallRelease", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_UninstallRelease_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -162,7 +189,7 @@ func (c *applicationServiceClient) UninstallRelease(ctx context.Context, in *Rel func (c *applicationServiceClient) UpgradeRelease(ctx context.Context, in *UpgradeReleaseRequest, opts ...grpc.CallOption) (*UpgradeReleaseResponse, error) { out := new(UpgradeReleaseResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/UpgradeRelease", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_UpgradeRelease_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -171,7 +198,7 @@ func (c *applicationServiceClient) UpgradeRelease(ctx context.Context, in *Upgra func (c *applicationServiceClient) GetDeploymentDetail(ctx context.Context, in *DeploymentDetailRequest, opts ...grpc.CallOption) (*DeploymentDetailResponse, error) { out := new(DeploymentDetailResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/GetDeploymentDetail", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetDeploymentDetail_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -180,7 +207,7 @@ func (c *applicationServiceClient) GetDeploymentDetail(ctx context.Context, in * func (c *applicationServiceClient) InstallRelease(ctx context.Context, in *InstallReleaseRequest, opts ...grpc.CallOption) (*InstallReleaseResponse, error) { out := new(InstallReleaseResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/InstallRelease", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_InstallRelease_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -189,7 +216,7 @@ func (c *applicationServiceClient) InstallRelease(ctx context.Context, in *Insta func (c *applicationServiceClient) UpgradeReleaseWithChartInfo(ctx context.Context, in *InstallReleaseRequest, opts ...grpc.CallOption) (*UpgradeReleaseResponse, error) { out := new(UpgradeReleaseResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/UpgradeReleaseWithChartInfo", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_UpgradeReleaseWithChartInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -198,7 +225,7 @@ func (c *applicationServiceClient) UpgradeReleaseWithChartInfo(ctx context.Conte func (c *applicationServiceClient) IsReleaseInstalled(ctx context.Context, in *ReleaseIdentifier, opts ...grpc.CallOption) (*BooleanResponse, error) { out := new(BooleanResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/IsReleaseInstalled", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_IsReleaseInstalled_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -207,7 +234,7 @@ func (c *applicationServiceClient) IsReleaseInstalled(ctx context.Context, in *R func (c *applicationServiceClient) RollbackRelease(ctx context.Context, in *RollbackReleaseRequest, opts ...grpc.CallOption) (*BooleanResponse, error) { out := new(BooleanResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/RollbackRelease", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_RollbackRelease_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -216,7 +243,7 @@ func (c *applicationServiceClient) RollbackRelease(ctx context.Context, in *Roll func (c *applicationServiceClient) TemplateChart(ctx context.Context, in *InstallReleaseRequest, opts ...grpc.CallOption) (*TemplateChartResponse, error) { out := new(TemplateChartResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/TemplateChart", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_TemplateChart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -225,7 +252,7 @@ func (c *applicationServiceClient) TemplateChart(ctx context.Context, in *Instal func (c *applicationServiceClient) TemplateChartBulk(ctx context.Context, in *BulkInstallReleaseRequest, opts ...grpc.CallOption) (*BulkTemplateChartResponse, error) { out := new(BulkTemplateChartResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/TemplateChartBulk", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_TemplateChartBulk_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -234,7 +261,7 @@ func (c *applicationServiceClient) TemplateChartBulk(ctx context.Context, in *Bu func (c *applicationServiceClient) TemplateChartAndRetrieveChart(ctx context.Context, in *InstallReleaseRequest, opts ...grpc.CallOption) (*TemplateChartResponseWithChart, error) { out := new(TemplateChartResponseWithChart) - err := c.cc.Invoke(ctx, "/ApplicationService/TemplateChartAndRetrieveChart", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_TemplateChartAndRetrieveChart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -243,7 +270,7 @@ func (c *applicationServiceClient) TemplateChartAndRetrieveChart(ctx context.Con func (c *applicationServiceClient) InstallReleaseWithCustomChart(ctx context.Context, in *HelmInstallCustomRequest, opts ...grpc.CallOption) (*HelmInstallCustomResponse, error) { out := new(HelmInstallCustomResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/InstallReleaseWithCustomChart", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_InstallReleaseWithCustomChart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -252,7 +279,7 @@ func (c *applicationServiceClient) InstallReleaseWithCustomChart(ctx context.Con func (c *applicationServiceClient) GetNotes(ctx context.Context, in *InstallReleaseRequest, opts ...grpc.CallOption) (*ChartNotesResponse, error) { out := new(ChartNotesResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/GetNotes", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetNotes_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -261,7 +288,7 @@ func (c *applicationServiceClient) GetNotes(ctx context.Context, in *InstallRele func (c *applicationServiceClient) UpgradeReleaseWithCustomChart(ctx context.Context, in *UpgradeReleaseRequest, opts ...grpc.CallOption) (*UpgradeReleaseResponse, error) { out := new(UpgradeReleaseResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/UpgradeReleaseWithCustomChart", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_UpgradeReleaseWithCustomChart_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -270,7 +297,7 @@ func (c *applicationServiceClient) UpgradeReleaseWithCustomChart(ctx context.Con func (c *applicationServiceClient) ValidateOCIRegistry(ctx context.Context, in *RegistryCredential, opts ...grpc.CallOption) (*OCIRegistryResponse, error) { out := new(OCIRegistryResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/ValidateOCIRegistry", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_ValidateOCIRegistry_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -279,7 +306,7 @@ func (c *applicationServiceClient) ValidateOCIRegistry(ctx context.Context, in * func (c *applicationServiceClient) PushHelmChartToOCIRegistry(ctx context.Context, in *OCIRegistryRequest, opts ...grpc.CallOption) (*OCIRegistryResponse, error) { out := new(OCIRegistryResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/PushHelmChartToOCIRegistry", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_PushHelmChartToOCIRegistry_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -288,7 +315,7 @@ func (c *applicationServiceClient) PushHelmChartToOCIRegistry(ctx context.Contex func (c *applicationServiceClient) GetResourceTreeForExternalResources(ctx context.Context, in *ExternalResourceTreeRequest, opts ...grpc.CallOption) (*ResourceTreeResponse, error) { out := new(ResourceTreeResponse) - err := c.cc.Invoke(ctx, "/ApplicationService/GetResourceTreeForExternalResources", in, out, opts...) + err := c.cc.Invoke(ctx, ApplicationService_GetResourceTreeForExternalResources_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -446,7 +473,7 @@ func _ApplicationService_GetAppDetail_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetAppDetail", + FullMethod: ApplicationService_GetAppDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetAppDetail(ctx, req.(*AppDetailRequest)) @@ -464,7 +491,7 @@ func _ApplicationService_GetAppStatus_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetAppStatus", + FullMethod: ApplicationService_GetAppStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetAppStatus(ctx, req.(*AppDetailRequest)) @@ -482,7 +509,7 @@ func _ApplicationService_Hibernate_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/Hibernate", + FullMethod: ApplicationService_Hibernate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).Hibernate(ctx, req.(*HibernateRequest)) @@ -500,7 +527,7 @@ func _ApplicationService_UnHibernate_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/UnHibernate", + FullMethod: ApplicationService_UnHibernate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).UnHibernate(ctx, req.(*HibernateRequest)) @@ -518,7 +545,7 @@ func _ApplicationService_GetDeploymentHistory_Handler(srv interface{}, ctx conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetDeploymentHistory", + FullMethod: ApplicationService_GetDeploymentHistory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetDeploymentHistory(ctx, req.(*AppDetailRequest)) @@ -536,7 +563,7 @@ func _ApplicationService_GetValuesYaml_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetValuesYaml", + FullMethod: ApplicationService_GetValuesYaml_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetValuesYaml(ctx, req.(*AppDetailRequest)) @@ -554,7 +581,7 @@ func _ApplicationService_GetDesiredManifest_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetDesiredManifest", + FullMethod: ApplicationService_GetDesiredManifest_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetDesiredManifest(ctx, req.(*ObjectRequest)) @@ -572,7 +599,7 @@ func _ApplicationService_UninstallRelease_Handler(srv interface{}, ctx context.C } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/UninstallRelease", + FullMethod: ApplicationService_UninstallRelease_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).UninstallRelease(ctx, req.(*ReleaseIdentifier)) @@ -590,7 +617,7 @@ func _ApplicationService_UpgradeRelease_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/UpgradeRelease", + FullMethod: ApplicationService_UpgradeRelease_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).UpgradeRelease(ctx, req.(*UpgradeReleaseRequest)) @@ -608,7 +635,7 @@ func _ApplicationService_GetDeploymentDetail_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetDeploymentDetail", + FullMethod: ApplicationService_GetDeploymentDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetDeploymentDetail(ctx, req.(*DeploymentDetailRequest)) @@ -626,7 +653,7 @@ func _ApplicationService_InstallRelease_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/InstallRelease", + FullMethod: ApplicationService_InstallRelease_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).InstallRelease(ctx, req.(*InstallReleaseRequest)) @@ -644,7 +671,7 @@ func _ApplicationService_UpgradeReleaseWithChartInfo_Handler(srv interface{}, ct } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/UpgradeReleaseWithChartInfo", + FullMethod: ApplicationService_UpgradeReleaseWithChartInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).UpgradeReleaseWithChartInfo(ctx, req.(*InstallReleaseRequest)) @@ -662,7 +689,7 @@ func _ApplicationService_IsReleaseInstalled_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/IsReleaseInstalled", + FullMethod: ApplicationService_IsReleaseInstalled_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).IsReleaseInstalled(ctx, req.(*ReleaseIdentifier)) @@ -680,7 +707,7 @@ func _ApplicationService_RollbackRelease_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/RollbackRelease", + FullMethod: ApplicationService_RollbackRelease_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).RollbackRelease(ctx, req.(*RollbackReleaseRequest)) @@ -698,7 +725,7 @@ func _ApplicationService_TemplateChart_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/TemplateChart", + FullMethod: ApplicationService_TemplateChart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).TemplateChart(ctx, req.(*InstallReleaseRequest)) @@ -716,7 +743,7 @@ func _ApplicationService_TemplateChartBulk_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/TemplateChartBulk", + FullMethod: ApplicationService_TemplateChartBulk_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).TemplateChartBulk(ctx, req.(*BulkInstallReleaseRequest)) @@ -734,7 +761,7 @@ func _ApplicationService_TemplateChartAndRetrieveChart_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/TemplateChartAndRetrieveChart", + FullMethod: ApplicationService_TemplateChartAndRetrieveChart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).TemplateChartAndRetrieveChart(ctx, req.(*InstallReleaseRequest)) @@ -752,7 +779,7 @@ func _ApplicationService_InstallReleaseWithCustomChart_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/InstallReleaseWithCustomChart", + FullMethod: ApplicationService_InstallReleaseWithCustomChart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).InstallReleaseWithCustomChart(ctx, req.(*HelmInstallCustomRequest)) @@ -770,7 +797,7 @@ func _ApplicationService_GetNotes_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetNotes", + FullMethod: ApplicationService_GetNotes_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetNotes(ctx, req.(*InstallReleaseRequest)) @@ -788,7 +815,7 @@ func _ApplicationService_UpgradeReleaseWithCustomChart_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/UpgradeReleaseWithCustomChart", + FullMethod: ApplicationService_UpgradeReleaseWithCustomChart_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).UpgradeReleaseWithCustomChart(ctx, req.(*UpgradeReleaseRequest)) @@ -806,7 +833,7 @@ func _ApplicationService_ValidateOCIRegistry_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/ValidateOCIRegistry", + FullMethod: ApplicationService_ValidateOCIRegistry_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).ValidateOCIRegistry(ctx, req.(*RegistryCredential)) @@ -824,7 +851,7 @@ func _ApplicationService_PushHelmChartToOCIRegistry_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/PushHelmChartToOCIRegistry", + FullMethod: ApplicationService_PushHelmChartToOCIRegistry_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).PushHelmChartToOCIRegistry(ctx, req.(*OCIRegistryRequest)) @@ -842,7 +869,7 @@ func _ApplicationService_GetResourceTreeForExternalResources_Handler(srv interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ApplicationService/GetResourceTreeForExternalResources", + FullMethod: ApplicationService_GetResourceTreeForExternalResources_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApplicationServiceServer).GetResourceTreeForExternalResources(ctx, req.(*ExternalResourceTreeRequest)) diff --git a/pkg/service/HelmAppService.go b/pkg/service/HelmAppService.go index 5843c509a..8c2945793 100644 --- a/pkg/service/HelmAppService.go +++ b/pkg/service/HelmAppService.go @@ -4,10 +4,10 @@ import ( "bytes" "compress/gzip" "context" - "encoding/base64" "encoding/json" "errors" "fmt" + registry2 "github.com/devtron-labs/common-lib/helmLib/registry" k8sCommonBean "github.com/devtron-labs/common-lib/utils/k8s/commonBean" k8sObjectUtils "github.com/devtron-labs/common-lib/utils/k8sObjectsUtil" "github.com/devtron-labs/kubelink/converter" @@ -19,14 +19,11 @@ import ( "helm.sh/helm/v3/pkg/storage/driver" "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/util/yaml" + "net/url" "path" + "strings" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ecr" "sync" "github.com/devtron-labs/common-lib/pubsub-lib" @@ -55,7 +52,6 @@ import ( "os" "path/filepath" "strconv" - "strings" ) const ( @@ -92,10 +88,6 @@ type HelmAppService interface { UpgradeReleaseWithCustomChart(ctx context.Context, request *client.UpgradeReleaseRequest) (bool, error) // ValidateOCIRegistryLogin Validates the OCI registry credentials by login ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error) - // ExtractCredentialsForRegistry Takes client.RegistryCredential and extracts credentials for the provided registry details - ExtractCredentialsForRegistry(registryCredential *client.RegistryCredential) (string, string, error) - // OCIRegistryLogin Takes client.OCIRegistryRequest and helm client, Performs registry login for the given client session and return err if fails - OCIRegistryLogin(client *registry.Client, registryCredential *client.RegistryCredential) error // PushHelmChartToOCIRegistryRepo Pushes the helm chart to the OCI registry and returns the generated digest and pushedUrl PushHelmChartToOCIRegistryRepo(ctx context.Context, OCIRegistryRequest *client.OCIRegistryRequest) (*client.OCIRegistryResponse, error) GetResourceTreeForExternalResources(req *client.ExternalResourceTreeRequest) (*bean.ResourceTreeResponse, error) @@ -111,12 +103,15 @@ type HelmAppServiceImpl struct { pubsubClient *pubsub_lib.PubSubClientServiceImpl clusterRepository repository.ClusterRepository converter converter.ClusterBeanConverter + registrySettings registry2.SettingsFactory } func NewHelmAppServiceImpl(logger *zap.SugaredLogger, k8sService K8sService, k8sInformer k8sInformer.K8sInformer, helmReleaseConfig *HelmReleaseConfig, k8sUtil k8sUtils.K8sService, converter converter.ClusterBeanConverter, - clusterRepository repository.ClusterRepository) (*HelmAppServiceImpl, error) { + clusterRepository repository.ClusterRepository, + registrySettings registry2.SettingsFactory, +) (*HelmAppServiceImpl, error) { var pubsubClient *pubsub_lib.PubSubClientServiceImpl var err error @@ -136,6 +131,7 @@ func NewHelmAppServiceImpl(logger *zap.SugaredLogger, k8sService K8sService, k8sUtil: k8sUtil, clusterRepository: clusterRepository, converter: converter, + registrySettings: registrySettings, } err = os.MkdirAll(helmReleaseConfig.ChartWorkingDirectory, os.ModePerm) if err != nil { @@ -761,10 +757,17 @@ func (impl HelmAppServiceImpl) InstallRelease(ctx context.Context, request *clie } -func (impl HelmAppServiceImpl) GetOCIChartName(registryUrl, repoName string) string { +func parseOCIChartName(registryUrl, repoName string) (string, error) { // helm package expects chart name to be in this format - chartName := fmt.Sprintf("%s://%s/%s", "oci", registryUrl, repoName) - return chartName + if !strings.Contains(strings.ToLower(registryUrl), "https") && !strings.Contains(strings.ToLower(registryUrl), "http") { + registryUrl = fmt.Sprintf("//%s", registryUrl) + } + parsedUrl, err := url.Parse(registryUrl) + if err != nil { + return registryUrl, err + } + chartName := fmt.Sprintf("%s://%s/%s", "oci", parsedUrl.Host, repoName) + return chartName, nil } func (impl HelmAppServiceImpl) installRelease(ctx context.Context, request *client.InstallReleaseRequest, dryRun bool) (*release.Release, error) { @@ -772,25 +775,50 @@ func (impl HelmAppServiceImpl) installRelease(ctx context.Context, request *clie releaseIdentifier := request.ReleaseIdentifier helmClientObj, err := impl.getHelmClient(releaseIdentifier.ClusterConfig, releaseIdentifier.ReleaseNamespace) if err != nil { + impl.logger.Errorw("error in creating helm client object", "releaseIdentifier", releaseIdentifier, "err", err) return nil, err } - // oci registry client - registryClient, err := registry.NewClient() + registryConfig, err := NewRegistryConfig(request.RegistryCredential) + defer func() { + if registryConfig != nil { + err := registry2.DeleteCertificateFolder(registryConfig.RegistryCAFilePath) + if err != nil { + impl.logger.Errorw("error in deleting certificate folder", "registryName", registryConfig.RegistryId, "err", err) + } + } + }() if err != nil { - impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + impl.logger.Errorw("error in getting registry config from registry proto", "registryName", request.RegistryCredential.RegistryName, "err", err) return nil, err } + // oci registry client + var registryClient *registry.Client + if registryConfig != nil { + settingsGetter, err := impl.registrySettings.GetSettings(registryConfig) + if err != nil { + impl.logger.Errorw("error in getting registry settings", "registryName", request.RegistryCredential.RegistryName, "err", err) + return nil, err + } + settings, err := settingsGetter.GetRegistrySettings(registryConfig) + if err != nil { + impl.logger.Errorw(HELM_CLIENT_ERROR, "registryName", request.RegistryCredential.RegistryName, "err", err) + return nil, err + } + registryClient = settings.RegistryClient + request.RegistryCredential.RegistryUrl = settings.RegistryHostURL + } + var chartName string switch request.IsOCIRepo { case true: - chartName = impl.GetOCIChartName(request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) - if request.RegistryCredential != nil && !request.RegistryCredential.IsPublic { - err = impl.OCIRegistryLogin(registryClient, request.RegistryCredential) - if err != nil { - return nil, err - } + + chartName, err = parseOCIChartName(request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) + if err != nil { + impl.logger.Errorw("error in parsing oci chart name", "registryUrl", request.RegistryCredential.RegistryUrl, "repoName", request.RegistryCredential.RepoName, "err", err) + return nil, err } + case false: chartRepoRequest := request.ChartRepository chartRepoName := chartRepoRequest.Name @@ -865,6 +893,7 @@ func (impl HelmAppServiceImpl) installRelease(ctx context.Context, request *clie return } _ = impl.pubsubClient.Publish(pubsub_lib.HELM_CHART_INSTALL_STATUS_TOPIC, string(data)) + return } _, err = helmClientObj.InstallChart(context.Background(), chartSpec) @@ -929,29 +958,50 @@ func (impl HelmAppServiceImpl) GetNotes(ctx context.Context, request *client.Ins } func (impl HelmAppServiceImpl) UpgradeReleaseWithChartInfo(ctx context.Context, request *client.InstallReleaseRequest) (*client.UpgradeReleaseResponse, error) { + releaseIdentifier := request.ReleaseIdentifier helmClientObj, err := impl.getHelmClient(releaseIdentifier.ClusterConfig, releaseIdentifier.ReleaseNamespace) if err != nil { return nil, err } + + registryConfig, err := NewRegistryConfig(request.RegistryCredential) + defer func() { + if registryConfig != nil { + err := registry2.DeleteCertificateFolder(registryConfig.RegistryCAFilePath) + if err != nil { + impl.logger.Errorw("error in deleting certificate folder", "registryName", registryConfig.RegistryId, "err", err) + } + } + }() + if err != nil { + impl.logger.Errorw("error in getting registry config from registry proto", "registryName", request.RegistryCredential.RegistryName, "err", err) + return nil, err + } var registryClient *registry.Client - var chartName string + if registryConfig != nil { + settingsGetter, err := impl.registrySettings.GetSettings(registryConfig) + if err != nil { + impl.logger.Errorw("error in getting registry settings", "registryName", request.RegistryCredential.RegistryName, "err", err) + return nil, err + } + settings, err := settingsGetter.GetRegistrySettings(registryConfig) + if err != nil { + impl.logger.Errorw(HELM_CLIENT_ERROR, "registryName", request.RegistryCredential.RegistryName, "err", err) + return nil, err + } + registryClient = settings.RegistryClient + request.RegistryCredential.RegistryUrl = settings.RegistryHostURL + } + var chartName string switch request.IsOCIRepo { case true: - registryClient, err = registry.NewClient() + chartName, err = parseOCIChartName(request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) if err != nil { - impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + impl.logger.Errorw("error in parsing oci chart name", "registryUrl", request.RegistryCredential.RegistryUrl, "repoName", request.RegistryCredential.RepoName, "err", err) return nil, err } - if request.RegistryCredential != nil && !request.RegistryCredential.IsPublic { - err = impl.OCIRegistryLogin(registryClient, request.RegistryCredential) - if err != nil { - impl.logger.Errorw("error in oci registry login", "chartName", request.ChartName, "err", err) - return nil, err - } - } - chartName = fmt.Sprintf("%s://%s/%s", "oci", request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) case false: chartRepoRequest := request.ChartRepository chartRepoName := chartRepoRequest.Name @@ -1115,24 +1165,47 @@ func (impl HelmAppServiceImpl) TemplateChart(ctx context.Context, request *clien helmClientObj, err := impl.getHelmClient(releaseIdentifier.ClusterConfig, releaseIdentifier.ReleaseNamespace) if err != nil { impl.logger.Errorw("error in getting helm app client") + return "", nil, err } - registryClient, err := registry.NewClient() + registryConfig, err := NewRegistryConfig(request.RegistryCredential) + defer func() { + if registryConfig != nil { + err := registry2.DeleteCertificateFolder(registryConfig.RegistryCAFilePath) + if err != nil { + impl.logger.Errorw("error in deleting certificate folder", "registryName", registryConfig.RegistryId, "err", err) + } + } + }() if err != nil { - impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + impl.logger.Errorw("error in getting registry config from registry proto", "registryName", request.RegistryCredential.RegistryName, "err", err) return "", nil, err } + var registryClient *registry.Client + if registryConfig != nil { + settingsGetter, err := impl.registrySettings.GetSettings(registryConfig) + if err != nil { + impl.logger.Errorw("error in getting registry settings", "registryName", request.RegistryCredential.RegistryName, "err", err) + return "", nil, err + } + settings, err := settingsGetter.GetRegistrySettings(registryConfig) + if err != nil { + impl.logger.Errorw(HELM_CLIENT_ERROR, "registryName", request.RegistryCredential.RegistryName, "err", err) + return "", nil, err + } + registryClient = settings.RegistryClient + request.RegistryCredential.RegistryUrl = settings.RegistryHostURL + } + var chartName, repoURL string switch request.IsOCIRepo { case true: - if request.RegistryCredential != nil && !request.RegistryCredential.IsPublic { - err = impl.OCIRegistryLogin(registryClient, request.RegistryCredential) - if err != nil { - return "", nil, err - } + chartName, err = parseOCIChartName(request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) + if err != nil { + impl.logger.Errorw("error in parsing oci chart name", "registryUrl", request.RegistryCredential.RegistryUrl, "repoName", request.RegistryCredential.RepoName, "err", err) + return "", nil, err } - chartName = impl.GetOCIChartName(request.RegistryCredential.RegistryUrl, request.RegistryCredential.RepoName) case false: chartName = request.ChartName repoURL = request.ChartRepository.Url @@ -1952,86 +2025,37 @@ func (impl HelmAppServiceImpl) UpgradeReleaseWithCustomChart(ctx context.Context return true, nil } -func (impl HelmAppServiceImpl) ExtractCredentialsForRegistry(registryCredential *client.RegistryCredential) (string, string, error) { - username := registryCredential.Username - pwd := registryCredential.Password - if (registryCredential.RegistryType == REGISTRYTYPE_GCR || registryCredential.RegistryType == REGISTRYTYPE_ARTIFACT_REGISTRY) && username == JSON_KEY_USERNAME { - if strings.HasPrefix(pwd, "'") { - pwd = pwd[1:] - } - if strings.HasSuffix(pwd, "'") { - pwd = pwd[:len(pwd)-1] +func (impl HelmAppServiceImpl) ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error) { + registryClient, err := registry.NewClient() + if err != nil { + impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + return nil, err + } + var caFilePath string + if OCIRegistryRequest.Connection == registry2.SECURE_WITH_CERT { + caFilePath, err = registry2.CreateCertificateFile(OCIRegistryRequest.RegistryName, OCIRegistryRequest.RegistryCertificate) + if err != nil { + impl.logger.Errorw("error in creating certificate file path", "registryName", OCIRegistryRequest.RegistryName, "err", err) + return nil, err } } - if registryCredential.RegistryType == REGISTRY_TYPE_ECR { - accessKey, secretKey := registryCredential.AccessKey, registryCredential.SecretKey - var creds *credentials.Credentials - - if len(registryCredential.AccessKey) == 0 || len(registryCredential.SecretKey) == 0 { - sess, err := session.NewSession(&aws.Config{ - Region: ®istryCredential.AwsRegion, - }) + registryConfig, err := NewRegistryConfig(OCIRegistryRequest) + defer func() { + if registryConfig != nil { + err := registry2.DeleteCertificateFolder(registryConfig.RegistryCAFilePath) if err != nil { - impl.logger.Errorw("Error in creating AWS client", "err", err) - return "", "", err + impl.logger.Errorw("error in deleting certificate folder", "registryName", registryConfig.RegistryId, "err", err) } - creds = ec2rolecreds.NewCredentials(sess) - } else { - creds = credentials.NewStaticCredentials(accessKey, secretKey, "") - } - sess, err := session.NewSession(&aws.Config{ - Region: ®istryCredential.AwsRegion, - Credentials: creds, - }) - if err != nil { - impl.logger.Errorw("Error in creating AWS client session", "err", err) - return "", "", err - } - svc := ecr.New(sess) - input := &ecr.GetAuthorizationTokenInput{} - authData, err := svc.GetAuthorizationToken(input) - if err != nil { - impl.logger.Errorw("Error fetching authData", "err", err) - return "", "", err - } - // decode token - token := authData.AuthorizationData[0].AuthorizationToken - decodedToken, err := base64.StdEncoding.DecodeString(*token) - if err != nil { - impl.logger.Errorw("Error in decoding auth token", "err", err) - return "", "", err } - credsSlice := strings.Split(string(decodedToken), ":") - username = credsSlice[0] - pwd = credsSlice[1] - - } - return username, pwd, nil -} - -func (impl HelmAppServiceImpl) OCIRegistryLogin(client *registry.Client, registryCredential *client.RegistryCredential) error { - username, pwd, err := impl.ExtractCredentialsForRegistry(registryCredential) + }() if err != nil { - return err - } - // helm registry login --username "" --password "" - err = client.Login(registryCredential.RegistryUrl, - registry.LoginOptBasicAuth(username, pwd), registry.LoginOptInsecure(false)) - if err != nil { - impl.logger.Errorw("Failed to login to registry", "registryURL", registryCredential.RegistryUrl, "err", err) - return err - } - return nil -} - -func (impl HelmAppServiceImpl) ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error) { - helmClient, err := registry.NewClient() - if err != nil { - impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + impl.logger.Errorw("error in getting registry config from registry proto", "registryName", OCIRegistryRequest.RegistryName, "err", err) return nil, err } - err = impl.OCIRegistryLogin(helmClient, OCIRegistryRequest) + registryConfig.RegistryCAFilePath = caFilePath + registryClient, err = registry2.GetLoggedInClient(registryClient, registryConfig) if err != nil { + impl.logger.Errorw("error in registry login", "registryName", OCIRegistryRequest.RegistryName, "err", err) return nil, err } return &client.OCIRegistryResponse{ @@ -2040,19 +2064,36 @@ func (impl HelmAppServiceImpl) ValidateOCIRegistryLogin(ctx context.Context, OCI } func (impl HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo(ctx context.Context, OCIRegistryRequest *client.OCIRegistryRequest) (*client.OCIRegistryResponse, error) { - // Login to OCI registry + registryPushResponse := &client.OCIRegistryResponse{} - helmClient, err := registry.NewClient() + + registryConfig, err := NewRegistryConfig(OCIRegistryRequest.RegistryCredential) + defer func() { + if registryConfig != nil { + err := registry2.DeleteCertificateFolder(registryConfig.RegistryCAFilePath) + if err != nil { + impl.logger.Errorw("error in deleting certificate folder", "registryName", registryConfig.RegistryId, "err", err) + } + } + }() if err != nil { - impl.logger.Errorw(HELM_CLIENT_ERROR, "err", err) + impl.logger.Errorw("error in getting registry config from registry proto", "registryName", OCIRegistryRequest.RegistryCredential.RegistryName, "err", err) return nil, err } - err = impl.OCIRegistryLogin(helmClient, OCIRegistryRequest.RegistryCredential) + + settingsGetter, err := impl.registrySettings.GetSettings(registryConfig) if err != nil { - registryPushResponse.IsLoggedIn = false - return registryPushResponse, err + impl.logger.Errorw("error in getting registry settings", "err", err) + return nil, err } - // LoggedIn successfully + settings, err := settingsGetter.GetRegistrySettings(registryConfig) + if err != nil { + impl.logger.Errorw(HELM_CLIENT_ERROR, "registryName", OCIRegistryRequest.RegistryCredential.RegistryName, "err", err) + return nil, err + } + registryClient := settings.RegistryClient + OCIRegistryRequest.RegistryCredential.RegistryUrl = settings.RegistryHostURL + registryPushResponse.IsLoggedIn = true var pushOpts []registry.PushOption @@ -2077,20 +2118,30 @@ func (impl HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo(ctx context.Contex impl.logger.Errorw("Error in loading chart bytes", "err", err) return nil, err } + trimmedURL := TrimSchemeFromURL(repoURL) + if err != nil { + impl.logger.Errorw("err in getting repo url without scheme", "repoURL", repoURL, "err", err) + return nil, err + } // add chart name and version from the chart metadata ref = fmt.Sprintf("%s:%s", - path.Join(strings.TrimPrefix(repoURL, fmt.Sprintf("%s://", registry.OCIScheme)), meta.Metadata.Name), + path.Join(trimmedURL, meta.Metadata.Name), meta.Metadata.Version) } else { // disable strict mode for configuring chartName in repo withStrictMode = registry.PushOptStrictMode(false) + trimmedURL := TrimSchemeFromURL(repoURL) + if err != nil { + impl.logger.Errorw("err in getting repo url without scheme", "repoURL", repoURL, "err", err) + return nil, err + } // add chartName and version to url ref = fmt.Sprintf("%s:%s", - path.Join(strings.TrimPrefix(repoURL, fmt.Sprintf("%s://", registry.OCIScheme)), OCIRegistryRequest.ChartName), + path.Join(trimmedURL, OCIRegistryRequest.ChartName), OCIRegistryRequest.ChartVersion) } - pushResult, err := helmClient.Push(OCIRegistryRequest.Chart, ref, withStrictMode) + pushResult, err := registryClient.Push(OCIRegistryRequest.Chart, ref, withStrictMode) if err != nil { impl.logger.Errorw("Error in pushing helm chart to OCI registry", "err", err) return registryPushResponse, err @@ -2102,6 +2153,19 @@ func (impl HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo(ctx context.Contex return registryPushResponse, err } +func TrimSchemeFromURL(registryUrl string) string { + if !strings.Contains(strings.ToLower(registryUrl), "https") && !strings.Contains(strings.ToLower(registryUrl), "http") { + registryUrl = fmt.Sprintf("//%s", registryUrl) + } + parsedUrl, err := url.Parse(registryUrl) + if err != nil { + return registryUrl + } + urlWithoutScheme := parsedUrl.Host + parsedUrl.Path + urlWithoutScheme = strings.TrimPrefix(urlWithoutScheme, "/") + return urlWithoutScheme +} + func (impl HelmAppServiceImpl) GetNatsMessageForHelmInstallError(ctx context.Context, helmInstallMessage HelmReleaseStatusConfig, releaseIdentifier *client.ReleaseIdentifier, installationErr error) (string, error) { helmInstallMessage.Message = installationErr.Error() isReleaseInstalled, err := impl.IsReleaseInstalled(ctx, releaseIdentifier) diff --git a/pkg/service/adapter.go b/pkg/service/adapter.go new file mode 100644 index 000000000..a5428243c --- /dev/null +++ b/pkg/service/adapter.go @@ -0,0 +1,73 @@ +package service + +import ( + "github.com/devtron-labs/common-lib/helmLib/registry" + "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" + client "github.com/devtron-labs/kubelink/grpc" +) + +func NewRegistryConfig(credential *client.RegistryCredential) (*registry.Configuration, error) { + var registryConfig *registry.Configuration + if credential != nil { + registryConfig = ®istry.Configuration{ + RegistryId: credential.RegistryName, + RegistryUrl: credential.RegistryUrl, + Username: credential.Username, + Password: credential.Password, + AwsAccessKey: credential.AccessKey, + AwsSecretKey: credential.SecretKey, + AwsRegion: credential.AwsRegion, + RegistryConnectionType: credential.Connection, + RegistryCertificateString: credential.RegistryCertificate, + RegistryType: credential.RegistryType, + IsPublicRegistry: credential.IsPublic, + } + + if credential.Connection == registry.SECURE_WITH_CERT { + certificatePath, err := registry.CreateCertificateFile(credential.RegistryName, credential.RegistryCertificate) + if err != nil { + return nil, err + } + registryConfig.RegistryCAFilePath = certificatePath + } + + connectionConfig := credential.RemoteConnectionConfig + if connectionConfig != nil { + registryConfig.RemoteConnectionConfig = &bean.RemoteConnectionConfigBean{} + switch connectionConfig.RemoteConnectionMethod { + case client.RemoteConnectionMethod_DIRECT: + registryConfig.RemoteConnectionConfig.ConnectionMethod = bean.RemoteConnectionMethodDirect + case client.RemoteConnectionMethod_PROXY: + registryConfig.RemoteConnectionConfig.ConnectionMethod = bean.RemoteConnectionMethodProxy + registryConfig.RemoteConnectionConfig.ProxyConfig = ConvertConfigToProxyConfig(connectionConfig) + case client.RemoteConnectionMethod_SSH: + registryConfig.RemoteConnectionConfig.ConnectionMethod = bean.RemoteConnectionMethodSSH + registryConfig.RemoteConnectionConfig.SSHTunnelConfig = ConvertConfigToSSHTunnelConfig(connectionConfig) + } + } + } + return registryConfig, nil +} + +func ConvertConfigToProxyConfig(config *client.RemoteConnectionConfig) *bean.ProxyConfig { + var proxyConfig *bean.ProxyConfig + if config.ProxyConfig != nil { + proxyConfig = &bean.ProxyConfig{ + ProxyUrl: config.ProxyConfig.ProxyUrl, + } + } + return proxyConfig +} + +func ConvertConfigToSSHTunnelConfig(config *client.RemoteConnectionConfig) *bean.SSHTunnelConfig { + var sshConfig *bean.SSHTunnelConfig + if config.SSHTunnelConfig != nil { + sshConfig = &bean.SSHTunnelConfig{ + SSHUsername: config.SSHTunnelConfig.SSHUsername, + SSHPassword: config.SSHTunnelConfig.SSHPassword, + SSHAuthKey: config.SSHTunnelConfig.SSHAuthKey, + SSHServerAddress: config.SSHTunnelConfig.SSHServerAddress, + } + } + return sshConfig +} diff --git a/pkg/util/Helper.go b/pkg/util/Helper.go index 5c4dee397..535d1db00 100644 --- a/pkg/util/Helper.go +++ b/pkg/util/Helper.go @@ -1,6 +1,8 @@ package util -import "reflect" +import ( + "reflect" +) func IsMapSubset(mapSet interface{}, mapSubset interface{}) bool { diff --git a/vendor/github.com/devtron-labs/common-lib/helmLib/registry/bean.go b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/bean.go new file mode 100644 index 000000000..cd25e430d --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/bean.go @@ -0,0 +1,55 @@ +package registry + +import ( + "github.com/devtron-labs/common-lib/utils/remoteConnection/bean" + "helm.sh/helm/v3/pkg/registry" + "net/http" +) + +type Configuration struct { + RegistryId string + RegistryUrl string + Username string + Password string + AwsAccessKey string + AwsSecretKey string + AwsRegion string + RegistryConnectionType string //secure, insecure, secure-with-cert + RegistryCertificateString string + RegistryCAFilePath string + RegistryType string + IsPublicRegistry bool + RemoteConnectionConfig *bean.RemoteConnectionConfigBean +} + +type RegistryConnectionType string + +type Settings struct { + RegistryClient *registry.Client + RegistryHostURL string + RegistryConnectionType RegistryConnectionType + HttpClient *http.Client + Header http.Header +} + +const ( + REGISTRY_CONNECTION_TYPE_DIRECT RegistryConnectionType = "DIRECT" + REGISTRY_CONNECTION_TYPE_PROXY RegistryConnectionType = "PROXY" + REGISTRY_CONNECTION_TYPE_SSH RegistryConnectionType = "SSH" +) + +const ( + REGISTRY_TYPE_ECR = "ecr" + REGISTRYTYPE_GCR = "gcr" + REGISTRYTYPE_ARTIFACT_REGISTRY = "artifact-registry" + JSON_KEY_USERNAME string = "_json_key" +) + +const ( + INSECURE_CONNECTION = "insecure" + SECURE_WITH_CERT = "secure-with-cert" +) + +const ( + REGISTRY_CREDENTIAL_BASE_PATH = "/home/devtron/registry-credentials" +) diff --git a/vendor/github.com/devtron-labs/common-lib/helmLib/registry/common.go b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/common.go new file mode 100644 index 000000000..21b0ea4ae --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/common.go @@ -0,0 +1,223 @@ +package registry + +import ( + "crypto/tls" + "crypto/x509" + "encoding/base64" + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/ecr" + "github.com/pkg/errors" + "helm.sh/helm/v3/pkg/registry" + "log" + "math/rand" + "net/http" + "os" + "strings" +) + +func GetLoggedInClient(client *registry.Client, config *Configuration) (*registry.Client, error) { + + username, pwd, err := extractCredentialsForRegistry(config) + if err != nil { + return nil, err + } + config.Username = username + config.Password = pwd + + loginOptions, err := getLoginOptions(config) + if err != nil { + return nil, err + } + + err = client.Login(config.RegistryUrl, + loginOptions..., + ) + if err != nil { + return nil, err + } + + return client, nil +} + +func CreateCertificateFile(registryName, caString string) (certificatePath string, err error) { + + registryFolderPath := fmt.Sprintf("%s/%s-%v", REGISTRY_CREDENTIAL_BASE_PATH, registryName, rand.Int()) + certificatePath = fmt.Sprintf("%s/ca.crt", registryFolderPath) + + if _, err = os.Stat(certificatePath); os.IsExist(err) { + // if file exists - remove file + err := os.Remove(certificatePath) + if err != nil { + return certificatePath, err + } + } else if _, err = os.Stat(registryFolderPath); os.IsNotExist(err) { + // create folder if not exist + err = os.MkdirAll(registryFolderPath, os.ModePerm) + if err != nil { + return certificatePath, err + } + } + f, err := os.Create(certificatePath) + if err != nil { + return certificatePath, err + } + defer f.Close() + _, err2 := f.WriteString(caString) + if err2 != nil { + return certificatePath, err + } + return certificatePath, nil +} + +func DeleteCertificateFolder(filePath string) error { + folder := strings.TrimRight(filePath, "/ca.crt") + err := os.RemoveAll(folder) + if err != nil { + return err + } + return nil +} + +func extractCredentialsForRegistry(config *Configuration) (string, string, error) { + username := config.Username + pwd := config.Password + if (config.RegistryType == REGISTRYTYPE_GCR || config.RegistryType == REGISTRYTYPE_ARTIFACT_REGISTRY) && username == JSON_KEY_USERNAME { + if strings.HasPrefix(pwd, "'") { + pwd = pwd[1:] + } + if strings.HasSuffix(pwd, "'") { + pwd = pwd[:len(pwd)-1] + } + } + if config.RegistryType == REGISTRY_TYPE_ECR { + accessKey, secretKey := config.AwsAccessKey, config.AwsSecretKey + var creds *credentials.Credentials + + if len(config.AwsAccessKey) == 0 || len(config.AwsSecretKey) == 0 { + sess, err := session.NewSession(&aws.Config{ + Region: &config.AwsRegion, + }) + if err != nil { + log.Printf("error in creating AWS client %w ", err) + return "", "", err + } + creds = ec2rolecreds.NewCredentials(sess) + } else { + creds = credentials.NewStaticCredentials(accessKey, secretKey, "") + } + sess, err := session.NewSession(&aws.Config{ + Region: &config.AwsRegion, + Credentials: creds, + }) + if err != nil { + log.Printf("error in creating AWS client %w ", err) + return "", "", err + } + svc := ecr.New(sess) + input := &ecr.GetAuthorizationTokenInput{} + authData, err := svc.GetAuthorizationToken(input) + if err != nil { + log.Printf("error in creating AWS client %w ", err) + return "", "", err + } + // decode token + token := authData.AuthorizationData[0].AuthorizationToken + decodedToken, err := base64.StdEncoding.DecodeString(*token) + if err != nil { + log.Printf("error in creating AWS client %w ", err) + return "", "", err + } + credsSlice := strings.Split(string(decodedToken), ":") + username = credsSlice[0] + pwd = credsSlice[1] + + } + return username, pwd, nil +} + +func getLoginOptions(config *Configuration) ([]registry.LoginOption, error) { + + var loginOptions []registry.LoginOption + + loginOptions = append(loginOptions, registry.LoginOptBasicAuth(config.Username, config.Password)) + + isSecureConnection := config.RegistryConnectionType == INSECURE_CONNECTION + + loginOptions = append(loginOptions, + registry.LoginOptInsecure(isSecureConnection)) + + if !isSecureConnection && config.RegistryConnectionType == SECURE_WITH_CERT { + loginOptions = append(loginOptions, registry.LoginOptTLSClientConfig("", "", config.RegistryCAFilePath)) + } + + return loginOptions, nil +} + +func GetHttpClient(config *Configuration) (*http.Client, error) { + tlsConfig, err := GetTlsConfig(config) + if err != nil { + return nil, err + } + httpClient := &http.Client{ + Transport: &http.Transport{TLSClientConfig: tlsConfig}, + } + return httpClient, nil +} + +func GetTlsConfig(config *Configuration) (*tls.Config, error) { + isInsecure := config.RegistryConnectionType == INSECURE_CONNECTION + tlsConfig, err := NewClientTLS("", "", config.RegistryCAFilePath, isInsecure) + if err != nil { + return nil, err + } + return tlsConfig, nil +} + +// TODO: add support for certFile, keyFile on UI? +func NewClientTLS(certFile, keyFile, caFile string, insecureSkipTLSverify bool) (*tls.Config, error) { + config := tls.Config{ + InsecureSkipVerify: insecureSkipTLSverify, + } + + if certFile != "" && keyFile != "" { + cert, err := CertFromFilePair(certFile, keyFile) + if err != nil { + return nil, err + } + config.Certificates = []tls.Certificate{*cert} + } + + if caFile != "" { + cp, err := CertPoolFromFile(caFile) + if err != nil { + return nil, err + } + config.RootCAs = cp + } + + return &config, nil +} + +func CertFromFilePair(certFile, keyFile string) (*tls.Certificate, error) { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, errors.Wrapf(err, "can't load key pair from cert %s and key %s", certFile, keyFile) + } + return &cert, err +} + +func CertPoolFromFile(filename string) (*x509.CertPool, error) { + b, err := os.ReadFile(filename) + if err != nil { + return nil, errors.Errorf("can't read CA file: %v", filename) + } + cp := x509.NewCertPool() + if !cp.AppendCertsFromPEM(b) { + return nil, errors.Errorf("failed to append certificates from file: %s", filename) + } + return cp, nil +} diff --git a/vendor/github.com/devtron-labs/common-lib/helmLib/registry/defaultSettings.go b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/defaultSettings.go new file mode 100644 index 000000000..645af368c --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/defaultSettings.go @@ -0,0 +1,65 @@ +package registry + +import ( + "go.uber.org/zap" + "helm.sh/helm/v3/pkg/registry" +) + +type DefaultSettingsGetter interface { + SettingsGetter +} + +type DefaultSettingsGetterImpl struct { + logger *zap.SugaredLogger +} + +func NewDefaultSettingsGetter(logger *zap.SugaredLogger) *DefaultSettingsGetterImpl { + return &DefaultSettingsGetterImpl{ + logger: logger, + } +} + +func (s *DefaultSettingsGetterImpl) GetRegistrySettings(config *Configuration) (*Settings, error) { + + registryClient, err := s.getRegistryClient(config) + if err != nil { + s.logger.Error("error in getting registry client", "registryUrl", config.RegistryUrl, "err", err) + return nil, err + } + + return &Settings{ + RegistryClient: registryClient, + RegistryHostURL: config.RegistryUrl, + RegistryConnectionType: REGISTRY_CONNECTION_TYPE_DIRECT, + HttpClient: nil, + Header: nil, + }, nil +} + +func (s *DefaultSettingsGetterImpl) getRegistryClient(config *Configuration) (*registry.Client, error) { + + httpClient, err := GetHttpClient(config) + if err != nil { + s.logger.Errorw("error in getting http client", "registryName", config.RegistryId, "err", err) + return nil, err + } + + clientOptions := []registry.ClientOption{registry.ClientOptHTTPClient(httpClient)} + if config.RegistryConnectionType == INSECURE_CONNECTION { + clientOptions = append(clientOptions, registry.ClientOptPlainHTTP()) + } + + registryClient, err := registry.NewClient(clientOptions...) + if err != nil { + s.logger.Errorw("error in getting registryClient", "registryName", config.RegistryId, "err", err) + return nil, err + } + + if config != nil && !config.IsPublicRegistry { + registryClient, err = GetLoggedInClient(registryClient, config) + if err != nil { + return nil, err + } + } + return registryClient, nil +} diff --git a/vendor/github.com/devtron-labs/common-lib/helmLib/registry/settingsFactory.go b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/settingsFactory.go new file mode 100644 index 000000000..67ab968d0 --- /dev/null +++ b/vendor/github.com/devtron-labs/common-lib/helmLib/registry/settingsFactory.go @@ -0,0 +1,25 @@ +package registry + +type SettingsGetter interface { + GetRegistrySettings(config *Configuration) (*Settings, error) +} + +type SettingsFactory interface { + GetSettings(config *Configuration) (SettingsGetter, error) +} + +type SettingsFactoryImpl struct { + DefaultSettings DefaultSettingsGetter +} + +func NewSettingsFactoryImpl( + DefaultSettings DefaultSettingsGetter, +) *SettingsFactoryImpl { + return &SettingsFactoryImpl{ + DefaultSettings: DefaultSettings, + } +} + +func (impl SettingsFactoryImpl) GetSettings(config *Configuration) (SettingsGetter, error) { + return impl.DefaultSettings, nil +} diff --git a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go index 15fedc710..6565dfda3 100644 --- a/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go +++ b/vendor/github.com/devtron-labs/common-lib/utils/remoteConnection/bean/bean.go @@ -11,8 +11,9 @@ const ( type ConnectionMethod string const ( - ConnectionMethod_Proxy ConnectionMethod = "PROXY" - ConnectionMethod_SSH ConnectionMethod = "SSH" + ConnectionMethod_Proxy ConnectionMethod = "PROXY" + ConnectionMethod_SSH ConnectionMethod = "SSH" + ConnectionMethod_DIRECT ConnectionMethod = "DIRECT" ) type ProxyConfig struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index c13b422aa..292581c57 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -137,9 +137,10 @@ github.com/davecgh/go-spew/spew github.com/devtron-labs/authenticator/client github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/oidc -# github.com/devtron-labs/common-lib v0.0.18-0.20240524141543-f4ed1281e694 -## explicit; go 1.20 +# github.com/devtron-labs/common-lib v0.0.19-0.20240603142207-287a5e876a52 +## explicit; go 1.21 github.com/devtron-labs/common-lib/constants +github.com/devtron-labs/common-lib/helmLib/registry github.com/devtron-labs/common-lib/middlewares github.com/devtron-labs/common-lib/monitoring github.com/devtron-labs/common-lib/monitoring/pprof diff --git a/wire_gen.go b/wire_gen.go index 46403adaa..3d3855eea 100644 --- a/wire_gen.go +++ b/wire_gen.go @@ -8,6 +8,7 @@ package main import ( "github.com/devtron-labs/authenticator/client" + "github.com/devtron-labs/common-lib/helmLib/registry" "github.com/devtron-labs/common-lib/monitoring" "github.com/devtron-labs/common-lib/utils/k8s" "github.com/devtron-labs/kubelink/api/router" @@ -53,7 +54,9 @@ func InitializeApp() (*App, error) { k8sK8sServiceImpl := k8s.NewK8sUtil(sugaredLogger, runtimeConfig) clusterBeanConverterImpl := converter.NewConverterImpl() k8sInformerImpl := k8sInformer.Newk8sInformerImpl(sugaredLogger, clusterRepositoryImpl, k8sInformerHelmReleaseConfig, k8sK8sServiceImpl, clusterBeanConverterImpl) - helmAppServiceImpl, err := service.NewHelmAppServiceImpl(sugaredLogger, k8sServiceImpl, k8sInformerImpl, helmReleaseConfig, k8sK8sServiceImpl, clusterBeanConverterImpl, clusterRepositoryImpl) + defaultSettingsGetterImpl := registry.NewDefaultSettingsGetter(sugaredLogger) + settingsFactoryImpl := registry.NewSettingsFactoryImpl(defaultSettingsGetterImpl) + helmAppServiceImpl, err := service.NewHelmAppServiceImpl(sugaredLogger, k8sServiceImpl, k8sInformerImpl, helmReleaseConfig, k8sK8sServiceImpl, clusterBeanConverterImpl, clusterRepositoryImpl, settingsFactoryImpl) if err != nil { return nil, err }