From 63308239d94f4b58e181a5d15816119fcb838d5c Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Mon, 1 Nov 2021 13:26:15 -0400 Subject: [PATCH] Define Validator Key Management Standard API Schema (#9817) * begin service for key management * begin defining schema * generate bindings * rev * add in custom compiler * use custom plugin with option * goimports * fix up proto to take in multiple passwords * keymanagent proto edit * rev * rev * dev * builds * comment * indent Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- proto/eth/service/BUILD.bazel | 73 +- proto/eth/service/key_management.pb.go | 997 ++++++++++++++++++++++ proto/eth/service/key_management.pb.gw.go | 321 +++++++ proto/eth/service/key_management.proto | 137 +++ 4 files changed, 1526 insertions(+), 2 deletions(-) create mode 100755 proto/eth/service/key_management.pb.go create mode 100755 proto/eth/service/key_management.pb.gw.go create mode 100644 proto/eth/service/key_management.proto diff --git a/proto/eth/service/BUILD.bazel b/proto/eth/service/BUILD.bazel index 5ceda7c94..1f3bc8347 100644 --- a/proto/eth/service/BUILD.bazel +++ b/proto/eth/service/BUILD.bazel @@ -1,6 +1,7 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load("@prysm//tools/go:def.bzl", "go_library") +load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler") # gazelle:ignore proto_library( @@ -25,6 +26,28 @@ proto_library( ], ) +# We create a custom proto library for key_management.proto as it requires a different +# compiler plugin for grpc gateway than the others. Namely, it requires adding the option +# --allow_delete_body=true to allow grpc gateway endpoints to take in DELETE HTTP requests +# with a request body properly. +proto_library( + name = "custom_proto", + srcs = [ + "key_management.proto", + ], + visibility = ["//visibility:public"], + deps = [ + "//proto/eth/ext:proto", + "//proto/eth/v1:proto", + "//proto/eth/v2:proto", + "@com_google_protobuf//:descriptor_proto", + "@com_google_protobuf//:empty_proto", + "@com_google_protobuf//:timestamp_proto", + "@go_googleapis//google/api:annotations_proto", + "@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto", + ], +) + go_proto_library( name = "go_proto", compilers = ["@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",], @@ -44,6 +67,31 @@ go_proto_library( ], ) +go_proto_library( + name = "custom_go_proto", + compilers = ["@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",], + importpath = "github.com/prysmaticlabs/prysm/proto/eth/service", + proto = ":custom_proto", + visibility = ["//visibility:public"], + deps = [ + "//proto/eth/ext:go_default_library", + "//proto/eth/v1:go_default_library", + "//proto/eth/v2:go_default_library", + "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", + "@io_bazel_rules_go//proto/wkt:empty_go_proto", + "@com_github_prysmaticlabs_eth2_types//:go_default_library", + "@go_googleapis//google/api:annotations_go_proto", + "@com_github_golang_protobuf//proto:go_default_library", + "@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library", + ], +) + +go_proto_compiler( + name = "allow_delete_body_gateway_compiler", + plugin = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:protoc-gen-grpc-gateway", + options = ["allow_delete_body=true"], +) + go_proto_library( name = "go_grpc_gateway_library", compilers = [ @@ -65,9 +113,30 @@ go_proto_library( ], ) +go_proto_library( + name = "custom_go_grpc_gateway_library", + compilers = [ + "allow_delete_body_gateway_compiler", + ], + embed = [":custom_go_proto"], + importpath = "github.com/prysmaticlabs/prysm/proto/eth/service", + protos = [":custom_proto"], + visibility = ["//proto:__subpackages__"], + deps = [ + "//proto/eth/ext:go_default_library", + "@io_bazel_rules_go//proto/wkt:empty_go_proto", + "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto", + "@com_github_prysmaticlabs_go_bitfield//:go_default_library", + "@go_googleapis//google/api:annotations_go_proto", + "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", + "@io_bazel_rules_go//proto/wkt:descriptor_go_proto", + "@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library", + ], +) + go_library( name = "go_default_library", - embed = [":go_grpc_gateway_library"], + embed = [":go_grpc_gateway_library", ":custom_go_grpc_gateway_library"], importpath = "github.com/prysmaticlabs/prysm/proto/eth/service", visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/proto/eth/service/key_management.pb.go b/proto/eth/service/key_management.pb.go new file mode 100755 index 000000000..fa5b88495 --- /dev/null +++ b/proto/eth/service/key_management.pb.go @@ -0,0 +1,997 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.15.8 +// source: proto/eth/service/key_management.proto + +package service + +import ( + context "context" + reflect "reflect" + sync "sync" + + proto "github.com/golang/protobuf/proto" + _ "github.com/golang/protobuf/protoc-gen-go/descriptor" + empty "github.com/golang/protobuf/ptypes/empty" + _ "github.com/prysmaticlabs/prysm/proto/eth/v1" + _ "github.com/prysmaticlabs/prysm/proto/eth/v2" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type ImportedKeystoreStatus_Status int32 + +const ( + ImportedKeystoreStatus_IMPORTED ImportedKeystoreStatus_Status = 0 + ImportedKeystoreStatus_DUPLICATE ImportedKeystoreStatus_Status = 1 + ImportedKeystoreStatus_ERROR ImportedKeystoreStatus_Status = 2 +) + +// Enum value maps for ImportedKeystoreStatus_Status. +var ( + ImportedKeystoreStatus_Status_name = map[int32]string{ + 0: "IMPORTED", + 1: "DUPLICATE", + 2: "ERROR", + } + ImportedKeystoreStatus_Status_value = map[string]int32{ + "IMPORTED": 0, + "DUPLICATE": 1, + "ERROR": 2, + } +) + +func (x ImportedKeystoreStatus_Status) Enum() *ImportedKeystoreStatus_Status { + p := new(ImportedKeystoreStatus_Status) + *p = x + return p +} + +func (x ImportedKeystoreStatus_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ImportedKeystoreStatus_Status) Descriptor() protoreflect.EnumDescriptor { + return file_proto_eth_service_key_management_proto_enumTypes[0].Descriptor() +} + +func (ImportedKeystoreStatus_Status) Type() protoreflect.EnumType { + return &file_proto_eth_service_key_management_proto_enumTypes[0] +} + +func (x ImportedKeystoreStatus_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ImportedKeystoreStatus_Status.Descriptor instead. +func (ImportedKeystoreStatus_Status) EnumDescriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{5, 0} +} + +type DeletedKeystoreStatus_Status int32 + +const ( + DeletedKeystoreStatus_DELETED DeletedKeystoreStatus_Status = 0 + DeletedKeystoreStatus_NOT_FOUND DeletedKeystoreStatus_Status = 1 + DeletedKeystoreStatus_ERROR DeletedKeystoreStatus_Status = 2 +) + +// Enum value maps for DeletedKeystoreStatus_Status. +var ( + DeletedKeystoreStatus_Status_name = map[int32]string{ + 0: "DELETED", + 1: "NOT_FOUND", + 2: "ERROR", + } + DeletedKeystoreStatus_Status_value = map[string]int32{ + "DELETED": 0, + "NOT_FOUND": 1, + "ERROR": 2, + } +) + +func (x DeletedKeystoreStatus_Status) Enum() *DeletedKeystoreStatus_Status { + p := new(DeletedKeystoreStatus_Status) + *p = x + return p +} + +func (x DeletedKeystoreStatus_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DeletedKeystoreStatus_Status) Descriptor() protoreflect.EnumDescriptor { + return file_proto_eth_service_key_management_proto_enumTypes[1].Descriptor() +} + +func (DeletedKeystoreStatus_Status) Type() protoreflect.EnumType { + return &file_proto_eth_service_key_management_proto_enumTypes[1] +} + +func (x DeletedKeystoreStatus_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DeletedKeystoreStatus_Status.Descriptor instead. +func (DeletedKeystoreStatus_Status) EnumDescriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{6, 0} +} + +type ListKeystoresResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keystores []*ListKeystoresResponse_Keystore `protobuf:"bytes,1,rep,name=keystores,proto3" json:"keystores,omitempty"` +} + +func (x *ListKeystoresResponse) Reset() { + *x = ListKeystoresResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKeystoresResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeystoresResponse) ProtoMessage() {} + +func (x *ListKeystoresResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeystoresResponse.ProtoReflect.Descriptor instead. +func (*ListKeystoresResponse) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{0} +} + +func (x *ListKeystoresResponse) GetKeystores() []*ListKeystoresResponse_Keystore { + if x != nil { + return x.Keystores + } + return nil +} + +type ImportKeystoresRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keystores []string `protobuf:"bytes,1,rep,name=keystores,proto3" json:"keystores,omitempty"` + Passwords []string `protobuf:"bytes,2,rep,name=passwords,proto3" json:"passwords,omitempty"` + SlashingProtection string `protobuf:"bytes,3,opt,name=slashing_protection,json=slashingProtection,proto3" json:"slashing_protection,omitempty"` +} + +func (x *ImportKeystoresRequest) Reset() { + *x = ImportKeystoresRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportKeystoresRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportKeystoresRequest) ProtoMessage() {} + +func (x *ImportKeystoresRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportKeystoresRequest.ProtoReflect.Descriptor instead. +func (*ImportKeystoresRequest) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{1} +} + +func (x *ImportKeystoresRequest) GetKeystores() []string { + if x != nil { + return x.Keystores + } + return nil +} + +func (x *ImportKeystoresRequest) GetPasswords() []string { + if x != nil { + return x.Passwords + } + return nil +} + +func (x *ImportKeystoresRequest) GetSlashingProtection() string { + if x != nil { + return x.SlashingProtection + } + return "" +} + +type ImportKeystoresResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Statuses []*ImportedKeystoreStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` +} + +func (x *ImportKeystoresResponse) Reset() { + *x = ImportKeystoresResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportKeystoresResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportKeystoresResponse) ProtoMessage() {} + +func (x *ImportKeystoresResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportKeystoresResponse.ProtoReflect.Descriptor instead. +func (*ImportKeystoresResponse) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{2} +} + +func (x *ImportKeystoresResponse) GetStatuses() []*ImportedKeystoreStatus { + if x != nil { + return x.Statuses + } + return nil +} + +type DeleteKeystoresRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PublicKeys [][]byte `protobuf:"bytes,1,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"` +} + +func (x *DeleteKeystoresRequest) Reset() { + *x = DeleteKeystoresRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteKeystoresRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteKeystoresRequest) ProtoMessage() {} + +func (x *DeleteKeystoresRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteKeystoresRequest.ProtoReflect.Descriptor instead. +func (*DeleteKeystoresRequest) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteKeystoresRequest) GetPublicKeys() [][]byte { + if x != nil { + return x.PublicKeys + } + return nil +} + +type DeleteKeystoresResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Statuses []*DeletedKeystoreStatus `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses,omitempty"` + SlashingProtection string `protobuf:"bytes,2,opt,name=slashing_protection,json=slashingProtection,proto3" json:"slashing_protection,omitempty"` +} + +func (x *DeleteKeystoresResponse) Reset() { + *x = DeleteKeystoresResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteKeystoresResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteKeystoresResponse) ProtoMessage() {} + +func (x *DeleteKeystoresResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteKeystoresResponse.ProtoReflect.Descriptor instead. +func (*DeleteKeystoresResponse) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteKeystoresResponse) GetStatuses() []*DeletedKeystoreStatus { + if x != nil { + return x.Statuses + } + return nil +} + +func (x *DeleteKeystoresResponse) GetSlashingProtection() string { + if x != nil { + return x.SlashingProtection + } + return "" +} + +type ImportedKeystoreStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ImportedKeystoreStatus_Status `protobuf:"varint,1,opt,name=status,proto3,enum=ethereum.eth.service.ImportedKeystoreStatus_Status" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *ImportedKeystoreStatus) Reset() { + *x = ImportedKeystoreStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImportedKeystoreStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImportedKeystoreStatus) ProtoMessage() {} + +func (x *ImportedKeystoreStatus) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImportedKeystoreStatus.ProtoReflect.Descriptor instead. +func (*ImportedKeystoreStatus) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{5} +} + +func (x *ImportedKeystoreStatus) GetStatus() ImportedKeystoreStatus_Status { + if x != nil { + return x.Status + } + return ImportedKeystoreStatus_IMPORTED +} + +func (x *ImportedKeystoreStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type DeletedKeystoreStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status DeletedKeystoreStatus_Status `protobuf:"varint,1,opt,name=status,proto3,enum=ethereum.eth.service.DeletedKeystoreStatus_Status" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *DeletedKeystoreStatus) Reset() { + *x = DeletedKeystoreStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletedKeystoreStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletedKeystoreStatus) ProtoMessage() {} + +func (x *DeletedKeystoreStatus) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletedKeystoreStatus.ProtoReflect.Descriptor instead. +func (*DeletedKeystoreStatus) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{6} +} + +func (x *DeletedKeystoreStatus) GetStatus() DeletedKeystoreStatus_Status { + if x != nil { + return x.Status + } + return DeletedKeystoreStatus_DELETED +} + +func (x *DeletedKeystoreStatus) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type ListKeystoresResponse_Keystore struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ValidatingPubkey []byte `protobuf:"bytes,1,opt,name=validating_pubkey,json=validatingPubkey,proto3" json:"validating_pubkey,omitempty"` + DerivationPath string `protobuf:"bytes,2,opt,name=derivation_path,json=derivationPath,proto3" json:"derivation_path,omitempty"` +} + +func (x *ListKeystoresResponse_Keystore) Reset() { + *x = ListKeystoresResponse_Keystore{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_eth_service_key_management_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListKeystoresResponse_Keystore) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListKeystoresResponse_Keystore) ProtoMessage() {} + +func (x *ListKeystoresResponse_Keystore) ProtoReflect() protoreflect.Message { + mi := &file_proto_eth_service_key_management_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListKeystoresResponse_Keystore.ProtoReflect.Descriptor instead. +func (*ListKeystoresResponse_Keystore) Descriptor() ([]byte, []int) { + return file_proto_eth_service_key_management_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ListKeystoresResponse_Keystore) GetValidatingPubkey() []byte { + if x != nil { + return x.ValidatingPubkey + } + return nil +} + +func (x *ListKeystoresResponse_Keystore) GetDerivationPath() string { + if x != nil { + return x.DerivationPath + } + return "" +} + +var File_proto_eth_service_key_management_proto protoreflect.FileDescriptor + +var file_proto_eth_service_key_management_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2f, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, + 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x52, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, + 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x27, + 0x0a, 0x0f, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x22, 0x85, 0x01, 0x0a, 0x16, 0x49, 0x6d, 0x70, 0x6f, + 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x2f, + 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x63, 0x0a, 0x17, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x22, + 0x93, 0x01, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x08, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x13, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb1, 0x01, 0x0a, 0x16, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x4b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x33, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x30, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x09, + 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x22, 0xae, 0x01, 0x0a, 0x15, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x4a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, + 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2f, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0x89, 0x03, 0x0a, 0x0d, 0x4b, + 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x78, 0x0a, 0x0d, + 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x2b, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, + 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x7e, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x22, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x12, 0x7e, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x2a, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x42, 0x97, 0x01, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x2e, 0x65, + 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x42, 0x19, 0x4b, 0x65, 0x79, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, + 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0xaa, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, + 0x68, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xca, 0x02, 0x14, 0x45, 0x74, 0x68, 0x65, + 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_eth_service_key_management_proto_rawDescOnce sync.Once + file_proto_eth_service_key_management_proto_rawDescData = file_proto_eth_service_key_management_proto_rawDesc +) + +func file_proto_eth_service_key_management_proto_rawDescGZIP() []byte { + file_proto_eth_service_key_management_proto_rawDescOnce.Do(func() { + file_proto_eth_service_key_management_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_eth_service_key_management_proto_rawDescData) + }) + return file_proto_eth_service_key_management_proto_rawDescData +} + +var file_proto_eth_service_key_management_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_proto_eth_service_key_management_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_proto_eth_service_key_management_proto_goTypes = []interface{}{ + (ImportedKeystoreStatus_Status)(0), // 0: ethereum.eth.service.ImportedKeystoreStatus.Status + (DeletedKeystoreStatus_Status)(0), // 1: ethereum.eth.service.DeletedKeystoreStatus.Status + (*ListKeystoresResponse)(nil), // 2: ethereum.eth.service.ListKeystoresResponse + (*ImportKeystoresRequest)(nil), // 3: ethereum.eth.service.ImportKeystoresRequest + (*ImportKeystoresResponse)(nil), // 4: ethereum.eth.service.ImportKeystoresResponse + (*DeleteKeystoresRequest)(nil), // 5: ethereum.eth.service.DeleteKeystoresRequest + (*DeleteKeystoresResponse)(nil), // 6: ethereum.eth.service.DeleteKeystoresResponse + (*ImportedKeystoreStatus)(nil), // 7: ethereum.eth.service.ImportedKeystoreStatus + (*DeletedKeystoreStatus)(nil), // 8: ethereum.eth.service.DeletedKeystoreStatus + (*ListKeystoresResponse_Keystore)(nil), // 9: ethereum.eth.service.ListKeystoresResponse.Keystore + (*empty.Empty)(nil), // 10: google.protobuf.Empty +} +var file_proto_eth_service_key_management_proto_depIdxs = []int32{ + 9, // 0: ethereum.eth.service.ListKeystoresResponse.keystores:type_name -> ethereum.eth.service.ListKeystoresResponse.Keystore + 7, // 1: ethereum.eth.service.ImportKeystoresResponse.statuses:type_name -> ethereum.eth.service.ImportedKeystoreStatus + 8, // 2: ethereum.eth.service.DeleteKeystoresResponse.statuses:type_name -> ethereum.eth.service.DeletedKeystoreStatus + 0, // 3: ethereum.eth.service.ImportedKeystoreStatus.status:type_name -> ethereum.eth.service.ImportedKeystoreStatus.Status + 1, // 4: ethereum.eth.service.DeletedKeystoreStatus.status:type_name -> ethereum.eth.service.DeletedKeystoreStatus.Status + 10, // 5: ethereum.eth.service.KeyManagement.ListKeystores:input_type -> google.protobuf.Empty + 3, // 6: ethereum.eth.service.KeyManagement.ImportKeystores:input_type -> ethereum.eth.service.ImportKeystoresRequest + 3, // 7: ethereum.eth.service.KeyManagement.DeleteKeystores:input_type -> ethereum.eth.service.ImportKeystoresRequest + 2, // 8: ethereum.eth.service.KeyManagement.ListKeystores:output_type -> ethereum.eth.service.ListKeystoresResponse + 10, // 9: ethereum.eth.service.KeyManagement.ImportKeystores:output_type -> google.protobuf.Empty + 10, // 10: ethereum.eth.service.KeyManagement.DeleteKeystores:output_type -> google.protobuf.Empty + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_proto_eth_service_key_management_proto_init() } +func file_proto_eth_service_key_management_proto_init() { + if File_proto_eth_service_key_management_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_eth_service_key_management_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKeystoresResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportKeystoresRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportKeystoresResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteKeystoresRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteKeystoresResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportedKeystoreStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletedKeystoreStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_eth_service_key_management_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListKeystoresResponse_Keystore); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_eth_service_key_management_proto_rawDesc, + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_eth_service_key_management_proto_goTypes, + DependencyIndexes: file_proto_eth_service_key_management_proto_depIdxs, + EnumInfos: file_proto_eth_service_key_management_proto_enumTypes, + MessageInfos: file_proto_eth_service_key_management_proto_msgTypes, + }.Build() + File_proto_eth_service_key_management_proto = out.File + file_proto_eth_service_key_management_proto_rawDesc = nil + file_proto_eth_service_key_management_proto_goTypes = nil + file_proto_eth_service_key_management_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// KeyManagementClient is the client API for KeyManagement service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type KeyManagementClient interface { + ListKeystores(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListKeystoresResponse, error) + ImportKeystores(ctx context.Context, in *ImportKeystoresRequest, opts ...grpc.CallOption) (*empty.Empty, error) + DeleteKeystores(ctx context.Context, in *ImportKeystoresRequest, opts ...grpc.CallOption) (*empty.Empty, error) +} + +type keyManagementClient struct { + cc grpc.ClientConnInterface +} + +func NewKeyManagementClient(cc grpc.ClientConnInterface) KeyManagementClient { + return &keyManagementClient{cc} +} + +func (c *keyManagementClient) ListKeystores(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListKeystoresResponse, error) { + out := new(ListKeystoresResponse) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/ListKeystores", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementClient) ImportKeystores(ctx context.Context, in *ImportKeystoresRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/ImportKeystores", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *keyManagementClient) DeleteKeystores(ctx context.Context, in *ImportKeystoresRequest, opts ...grpc.CallOption) (*empty.Empty, error) { + out := new(empty.Empty) + err := c.cc.Invoke(ctx, "/ethereum.eth.service.KeyManagement/DeleteKeystores", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// KeyManagementServer is the server API for KeyManagement service. +type KeyManagementServer interface { + ListKeystores(context.Context, *empty.Empty) (*ListKeystoresResponse, error) + ImportKeystores(context.Context, *ImportKeystoresRequest) (*empty.Empty, error) + DeleteKeystores(context.Context, *ImportKeystoresRequest) (*empty.Empty, error) +} + +// UnimplementedKeyManagementServer can be embedded to have forward compatible implementations. +type UnimplementedKeyManagementServer struct { +} + +func (*UnimplementedKeyManagementServer) ListKeystores(context.Context, *empty.Empty) (*ListKeystoresResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListKeystores not implemented") +} +func (*UnimplementedKeyManagementServer) ImportKeystores(context.Context, *ImportKeystoresRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportKeystores not implemented") +} +func (*UnimplementedKeyManagementServer) DeleteKeystores(context.Context, *ImportKeystoresRequest) (*empty.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteKeystores not implemented") +} + +func RegisterKeyManagementServer(s *grpc.Server, srv KeyManagementServer) { + s.RegisterService(&_KeyManagement_serviceDesc, srv) +} + +func _KeyManagement_ListKeystores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).ListKeystores(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/ListKeystores", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).ListKeystores(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagement_ImportKeystores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportKeystoresRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).ImportKeystores(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/ImportKeystores", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).ImportKeystores(ctx, req.(*ImportKeystoresRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _KeyManagement_DeleteKeystores_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportKeystoresRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyManagementServer).DeleteKeystores(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.eth.service.KeyManagement/DeleteKeystores", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyManagementServer).DeleteKeystores(ctx, req.(*ImportKeystoresRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _KeyManagement_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ethereum.eth.service.KeyManagement", + HandlerType: (*KeyManagementServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListKeystores", + Handler: _KeyManagement_ListKeystores_Handler, + }, + { + MethodName: "ImportKeystores", + Handler: _KeyManagement_ImportKeystores_Handler, + }, + { + MethodName: "DeleteKeystores", + Handler: _KeyManagement_DeleteKeystores_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/eth/service/key_management.proto", +} diff --git a/proto/eth/service/key_management.pb.gw.go b/proto/eth/service/key_management.pb.gw.go new file mode 100755 index 000000000..3c160b8b0 --- /dev/null +++ b/proto/eth/service/key_management.pb.gw.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: proto/eth/service/key_management.proto + +/* +Package service is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package service + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/ptypes/empty" + emptypb "github.com/golang/protobuf/ptypes/empty" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + github_com_prysmaticlabs_eth2_types "github.com/prysmaticlabs/eth2-types" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join +var _ = github_com_prysmaticlabs_eth2_types.Epoch(0) +var _ = emptypb.Empty{} +var _ = empty.Empty{} + +func request_KeyManagement_ListKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.ListKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_ListKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.ListKeystores(ctx, &protoReq) + return msg, metadata, err + +} + +func request_KeyManagement_ImportKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ImportKeystoresRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ImportKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_ImportKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ImportKeystoresRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ImportKeystores(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_KeyManagement_DeleteKeystores_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_KeyManagement_DeleteKeystores_0(ctx context.Context, marshaler runtime.Marshaler, client KeyManagementClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ImportKeystoresRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_KeyManagement_DeleteKeystores_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteKeystores(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_KeyManagement_DeleteKeystores_0(ctx context.Context, marshaler runtime.Marshaler, server KeyManagementServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ImportKeystoresRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_KeyManagement_DeleteKeystores_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteKeystores(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterKeyManagementHandlerServer registers the http handlers for service KeyManagement to "mux". +// UnaryRPC :call KeyManagementServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterKeyManagementHandlerFromEndpoint instead. +func RegisterKeyManagementHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KeyManagementServer) error { + + mux.Handle("GET", pattern_KeyManagement_ListKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ListKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_ListKeystores_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_ListKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KeyManagement_ImportKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ImportKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_ImportKeystores_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_ImportKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_KeyManagement_DeleteKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/DeleteKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_KeyManagement_DeleteKeystores_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_DeleteKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterKeyManagementHandlerFromEndpoint is same as RegisterKeyManagementHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterKeyManagementHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterKeyManagementHandler(ctx, mux, conn) +} + +// RegisterKeyManagementHandler registers the http handlers for service KeyManagement to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterKeyManagementHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterKeyManagementHandlerClient(ctx, mux, NewKeyManagementClient(conn)) +} + +// RegisterKeyManagementHandlerClient registers the http handlers for service KeyManagement +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "KeyManagementClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "KeyManagementClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "KeyManagementClient" to call the correct interceptors. +func RegisterKeyManagementHandlerClient(ctx context.Context, mux *runtime.ServeMux, client KeyManagementClient) error { + + mux.Handle("GET", pattern_KeyManagement_ListKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ListKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_ListKeystores_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_ListKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_KeyManagement_ImportKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/ImportKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_ImportKeystores_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_ImportKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_KeyManagement_DeleteKeystores_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.service.KeyManagement/DeleteKeystores") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_KeyManagement_DeleteKeystores_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_KeyManagement_DeleteKeystores_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_KeyManagement_ListKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, "")) + + pattern_KeyManagement_ImportKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, "")) + + pattern_KeyManagement_DeleteKeystores_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"internal", "eth", "v1", "keystores"}, "")) +) + +var ( + forward_KeyManagement_ListKeystores_0 = runtime.ForwardResponseMessage + + forward_KeyManagement_ImportKeystores_0 = runtime.ForwardResponseMessage + + forward_KeyManagement_DeleteKeystores_0 = runtime.ForwardResponseMessage +) diff --git a/proto/eth/service/key_management.proto b/proto/eth/service/key_management.proto new file mode 100644 index 000000000..79d17d1f6 --- /dev/null +++ b/proto/eth/service/key_management.proto @@ -0,0 +1,137 @@ +// Copyright 2020 Prysmatic Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +package ethereum.eth.service; + +import "google/api/annotations.proto"; +import "google/protobuf/descriptor.proto"; +import "google/protobuf/empty.proto"; + +import "proto/eth/v1/validator.proto"; +import "proto/eth/v2/validator.proto"; + +option csharp_namespace = "Ethereum.Eth.Service"; +option go_package = "github.com/prysmaticlabs/prysm/proto/eth/service"; +option java_multiple_files = true; +option java_outer_classname = "KeyManagementServiceProto"; +option java_package = "org.ethereum.eth.service"; +option php_namespace = "Ethereum\\Eth\\Service"; + +// Validator Key Management Standard API +// +// The validator key management API is a set of endpoints to be used for keystore management in the validator client. +// +// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/keystores). +service KeyManagement { + // ListKeystores for all keystores known to and decrypted by the keymanager. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc ListKeystores(google.protobuf.Empty) returns (ListKeystoresResponse) { + option (google.api.http) = { + get: "/internal/eth/v1/keystores" + }; + } + + // ImportKeystores generated by the Eth2.0 deposit CLI tooling. All keystores MUST be encrypted with + // the same password. Users SHOULD send slashing_protection data associated with the imported + // pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc ImportKeystores(ImportKeystoresRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/internal/eth/v1/keystores", + body: "*" + }; + } + + // DeleteKeystores must delete all keystores from `request.pubkeys` that are known to the keymanager and exist + // in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from + // persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the + // case of two identical delete requests being made, both will have access to slashing protection data. + // In a single atomic sequential operation the keymanager must: + // + // 1. Guarantee that key(s) can not produce any more signature; only then + // 2. Delete key(s) and serialize its associated slashing protection data + // + // DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores + // nor slashing protection data. + // + // HTTP response status codes: + // - 200: Successful response + // - 401: Unauthorized + // - 403: Forbidden from accessing the resource + // - 500: Validator internal error + rpc DeleteKeystores(ImportKeystoresRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/internal/eth/v1/keystores", + body: "*" + }; + } +} + +message ListKeystoresResponse { + message Keystore { + bytes validating_pubkey = 1; + string derivation_path = 2; + } + repeated Keystore keystores = 1; +} + +message ImportKeystoresRequest { + repeated string keystores = 1; + repeated string passwords = 2; + string slashing_protection = 3; +} + +message ImportKeystoresResponse { + repeated ImportedKeystoreStatus statuses = 1; +} + +message DeleteKeystoresRequest { + repeated bytes public_keys = 1; +} + +message DeleteKeystoresResponse { + repeated DeletedKeystoreStatus statuses = 1; + string slashing_protection = 2; +} + +message ImportedKeystoreStatus { + enum Status { + IMPORTED = 0; + DUPLICATE = 1; + ERROR = 2; + } + Status status = 1; + string message = 2; +} + +message DeletedKeystoreStatus { + enum Status { + DELETED = 0; + NOT_FOUND = 1; + ERROR = 2; + } + Status status = 1; + string message = 2; +}