diff --git a/.gitignore b/.gitignore index 3231d10..5552455 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ Makefile *.lineno autom4te.cache/ *.service -tmp +tmp.* *.tar.* cmd/certmanagerctl/certmanagerctl cmd/certmanagerd/certmanagerd diff --git a/api/certmanagercontrol/certmanagercontrol.pb.go b/api/certmanagercontrol/certmanagercontrol.pb.go index 191a143..6ccdfc3 100644 --- a/api/certmanagercontrol/certmanagercontrol.pb.go +++ b/api/certmanagercontrol/certmanagercontrol.pb.go @@ -110,11 +110,12 @@ type CreateIssuerPairParams struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IssuerName string `protobuf:"bytes,1,opt,name=issuerName,proto3" json:"issuerName,omitempty"` - ValidUntil string `protobuf:"bytes,2,opt,name=validUntil,proto3" json:"validUntil,omitempty"` - SelfSigned bool `protobuf:"varint,3,opt,name=selfSigned,proto3" json:"selfSigned,omitempty"` - UplevelIssuerID int64 `protobuf:"varint,4,opt,name=uplevelIssuerID,proto3" json:"uplevelIssuerID,omitempty"` - UplevelIssuerName string `protobuf:"bytes,5,opt,name=uplevelIssuerName,proto3" json:"uplevelIssuerName,omitempty"` + IssuerCommonName string `protobuf:"bytes,1,opt,name=issuerCommonName,proto3" json:"issuerCommonName,omitempty"` + Intermediate bool `protobuf:"varint,2,opt,name=intermediate,proto3" json:"intermediate,omitempty"` + SignerIssuerID int64 `protobuf:"varint,3,opt,name=signerIssuerID,proto3" json:"signerIssuerID,omitempty"` + SignerIssuerName string `protobuf:"bytes,4,opt,name=signerIssuerName,proto3" json:"signerIssuerName,omitempty"` + ValidUntil string `protobuf:"bytes,5,opt,name=validUntil,proto3" json:"validUntil,omitempty"` + KeySize string `protobuf:"bytes,6,opt,name=keySize,proto3" json:"keySize,omitempty"` } func (x *CreateIssuerPairParams) Reset() { @@ -149,9 +150,30 @@ func (*CreateIssuerPairParams) Descriptor() ([]byte, []int) { return file_certmanagercontrol_proto_rawDescGZIP(), []int{2} } -func (x *CreateIssuerPairParams) GetIssuerName() string { +func (x *CreateIssuerPairParams) GetIssuerCommonName() string { if x != nil { - return x.IssuerName + return x.IssuerCommonName + } + return "" +} + +func (x *CreateIssuerPairParams) GetIntermediate() bool { + if x != nil { + return x.Intermediate + } + return false +} + +func (x *CreateIssuerPairParams) GetSignerIssuerID() int64 { + if x != nil { + return x.SignerIssuerID + } + return 0 +} + +func (x *CreateIssuerPairParams) GetSignerIssuerName() string { + if x != nil { + return x.SignerIssuerName } return "" } @@ -163,23 +185,9 @@ func (x *CreateIssuerPairParams) GetValidUntil() string { return "" } -func (x *CreateIssuerPairParams) GetSelfSigned() bool { +func (x *CreateIssuerPairParams) GetKeySize() string { if x != nil { - return x.SelfSigned - } - return false -} - -func (x *CreateIssuerPairParams) GetUplevelIssuerID() int64 { - if x != nil { - return x.UplevelIssuerID - } - return 0 -} - -func (x *CreateIssuerPairParams) GetUplevelIssuerName() string { - if x != nil { - return x.UplevelIssuerName + return x.KeySize } return "" } @@ -189,8 +197,8 @@ type CreateIssuerPairResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` - CaCertificate string `protobuf:"bytes,2,opt,name=caCertificate,proto3" json:"caCertificate,omitempty"` + IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + Certificate string `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` } func (x *CreateIssuerPairResult) Reset() { @@ -232,13 +240,139 @@ func (x *CreateIssuerPairResult) GetIssuerID() int64 { return 0 } -func (x *CreateIssuerPairResult) GetCaCertificate() string { +func (x *CreateIssuerPairResult) GetCertificate() string { if x != nil { - return x.CaCertificate + return x.Certificate } return "" } +type GetIssuerCertificateParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + IssuerName string `protobuf:"bytes,2,opt,name=issuerName,proto3" json:"issuerName,omitempty"` +} + +func (x *GetIssuerCertificateParams) Reset() { + *x = GetIssuerCertificateParams{} + if protoimpl.UnsafeEnabled { + mi := &file_certmanagercontrol_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIssuerCertificateParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIssuerCertificateParams) ProtoMessage() {} + +func (x *GetIssuerCertificateParams) ProtoReflect() protoreflect.Message { + mi := &file_certmanagercontrol_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 GetIssuerCertificateParams.ProtoReflect.Descriptor instead. +func (*GetIssuerCertificateParams) Descriptor() ([]byte, []int) { + return file_certmanagercontrol_proto_rawDescGZIP(), []int{4} +} + +func (x *GetIssuerCertificateParams) GetIssuerID() int64 { + if x != nil { + return x.IssuerID + } + return 0 +} + +func (x *GetIssuerCertificateParams) GetIssuerName() string { + if x != nil { + return x.IssuerName + } + return "" +} + +type GetIssuerCertificateResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Certificate string `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` + Revoked bool `protobuf:"varint,3,opt,name=revoked,proto3" json:"revoked,omitempty"` + IssuerID int64 `protobuf:"varint,4,opt,name=issuerID,proto3" json:"issuerID,omitempty"` +} + +func (x *GetIssuerCertificateResult) Reset() { + *x = GetIssuerCertificateResult{} + if protoimpl.UnsafeEnabled { + mi := &file_certmanagercontrol_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIssuerCertificateResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIssuerCertificateResult) ProtoMessage() {} + +func (x *GetIssuerCertificateResult) ProtoReflect() protoreflect.Message { + mi := &file_certmanagercontrol_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 GetIssuerCertificateResult.ProtoReflect.Descriptor instead. +func (*GetIssuerCertificateResult) Descriptor() ([]byte, []int) { + return file_certmanagercontrol_proto_rawDescGZIP(), []int{5} +} + +func (x *GetIssuerCertificateResult) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetIssuerCertificateResult) GetCertificate() string { + if x != nil { + return x.Certificate + } + return "" +} + +func (x *GetIssuerCertificateResult) GetRevoked() bool { + if x != nil { + return x.Revoked + } + return false +} + +func (x *GetIssuerCertificateResult) GetIssuerID() int64 { + if x != nil { + return x.IssuerID + } + return 0 +} + type ImportIssuerPairParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -251,7 +385,7 @@ type ImportIssuerPairParams struct { func (x *ImportIssuerPairParams) Reset() { *x = ImportIssuerPairParams{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[4] + mi := &file_certmanagercontrol_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -264,7 +398,7 @@ func (x *ImportIssuerPairParams) String() string { func (*ImportIssuerPairParams) ProtoMessage() {} func (x *ImportIssuerPairParams) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[4] + mi := &file_certmanagercontrol_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -277,7 +411,7 @@ func (x *ImportIssuerPairParams) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportIssuerPairParams.ProtoReflect.Descriptor instead. func (*ImportIssuerPairParams) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{4} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{6} } func (x *ImportIssuerPairParams) GetCertificate() string { @@ -299,13 +433,14 @@ type ImportIssuerPairResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + IssuerName string `protobuf:"bytes,2,opt,name=issuerName,proto3" json:"issuerName,omitempty"` } func (x *ImportIssuerPairResult) Reset() { *x = ImportIssuerPairResult{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[5] + mi := &file_certmanagercontrol_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -318,7 +453,7 @@ func (x *ImportIssuerPairResult) String() string { func (*ImportIssuerPairResult) ProtoMessage() {} func (x *ImportIssuerPairResult) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[5] + mi := &file_certmanagercontrol_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -331,7 +466,7 @@ func (x *ImportIssuerPairResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ImportIssuerPairResult.ProtoReflect.Descriptor instead. func (*ImportIssuerPairResult) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{5} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{7} } func (x *ImportIssuerPairResult) GetIssuerID() int64 { @@ -341,6 +476,13 @@ func (x *ImportIssuerPairResult) GetIssuerID() int64 { return 0 } +func (x *ImportIssuerPairResult) GetIssuerName() string { + if x != nil { + return x.IssuerName + } + return "" +} + type RevokeIssuerPairParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -353,7 +495,7 @@ type RevokeIssuerPairParams struct { func (x *RevokeIssuerPairParams) Reset() { *x = RevokeIssuerPairParams{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[6] + mi := &file_certmanagercontrol_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -366,7 +508,7 @@ func (x *RevokeIssuerPairParams) String() string { func (*RevokeIssuerPairParams) ProtoMessage() {} func (x *RevokeIssuerPairParams) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[6] + mi := &file_certmanagercontrol_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -379,7 +521,7 @@ func (x *RevokeIssuerPairParams) ProtoReflect() protoreflect.Message { // Deprecated: Use RevokeIssuerPairParams.ProtoReflect.Descriptor instead. func (*RevokeIssuerPairParams) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{6} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{8} } func (x *RevokeIssuerPairParams) GetIssuerID() int64 { @@ -405,7 +547,7 @@ type RevokeIssuerPairResult struct { func (x *RevokeIssuerPairResult) Reset() { *x = RevokeIssuerPairResult{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[7] + mi := &file_certmanagercontrol_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -418,7 +560,7 @@ func (x *RevokeIssuerPairResult) String() string { func (*RevokeIssuerPairResult) ProtoMessage() {} func (x *RevokeIssuerPairResult) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[7] + mi := &file_certmanagercontrol_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -431,7 +573,7 @@ func (x *RevokeIssuerPairResult) ProtoReflect() protoreflect.Message { // Deprecated: Use RevokeIssuerPairResult.ProtoReflect.Descriptor instead. func (*RevokeIssuerPairResult) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{7} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{9} } type UnrevokeIssuerPairParams struct { @@ -446,7 +588,7 @@ type UnrevokeIssuerPairParams struct { func (x *UnrevokeIssuerPairParams) Reset() { *x = UnrevokeIssuerPairParams{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[8] + mi := &file_certmanagercontrol_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -459,7 +601,7 @@ func (x *UnrevokeIssuerPairParams) String() string { func (*UnrevokeIssuerPairParams) ProtoMessage() {} func (x *UnrevokeIssuerPairParams) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[8] + mi := &file_certmanagercontrol_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -472,7 +614,7 @@ func (x *UnrevokeIssuerPairParams) ProtoReflect() protoreflect.Message { // Deprecated: Use UnrevokeIssuerPairParams.ProtoReflect.Descriptor instead. func (*UnrevokeIssuerPairParams) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{8} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{10} } func (x *UnrevokeIssuerPairParams) GetIssuerID() int64 { @@ -498,7 +640,7 @@ type UnrevokeIssuerPairResult struct { func (x *UnrevokeIssuerPairResult) Reset() { *x = UnrevokeIssuerPairResult{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[9] + mi := &file_certmanagercontrol_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -511,7 +653,7 @@ func (x *UnrevokeIssuerPairResult) String() string { func (*UnrevokeIssuerPairResult) ProtoMessage() {} func (x *UnrevokeIssuerPairResult) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[9] + mi := &file_certmanagercontrol_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -524,7 +666,7 @@ func (x *UnrevokeIssuerPairResult) ProtoReflect() protoreflect.Message { // Deprecated: Use UnrevokeIssuerPairResult.ProtoReflect.Descriptor instead. func (*UnrevokeIssuerPairResult) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{9} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{11} } type ListIssuerPairsParams struct { @@ -536,7 +678,7 @@ type ListIssuerPairsParams struct { func (x *ListIssuerPairsParams) Reset() { *x = ListIssuerPairsParams{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[10] + mi := &file_certmanagercontrol_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -549,7 +691,7 @@ func (x *ListIssuerPairsParams) String() string { func (*ListIssuerPairsParams) ProtoMessage() {} func (x *ListIssuerPairsParams) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[10] + mi := &file_certmanagercontrol_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -562,7 +704,7 @@ func (x *ListIssuerPairsParams) ProtoReflect() protoreflect.Message { // Deprecated: Use ListIssuerPairsParams.ProtoReflect.Descriptor instead. func (*ListIssuerPairsParams) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{10} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{12} } type ListIssuerPairsResult struct { @@ -570,13 +712,13 @@ type ListIssuerPairsResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Issiers []*IssierShortDescriptor `protobuf:"bytes,1,rep,name=issiers,proto3" json:"issiers,omitempty"` + Issuers []*IssierShortDescriptor `protobuf:"bytes,1,rep,name=issuers,proto3" json:"issuers,omitempty"` } func (x *ListIssuerPairsResult) Reset() { *x = ListIssuerPairsResult{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[11] + mi := &file_certmanagercontrol_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -589,7 +731,7 @@ func (x *ListIssuerPairsResult) String() string { func (*ListIssuerPairsResult) ProtoMessage() {} func (x *ListIssuerPairsResult) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[11] + mi := &file_certmanagercontrol_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -602,12 +744,12 @@ func (x *ListIssuerPairsResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ListIssuerPairsResult.ProtoReflect.Descriptor instead. func (*ListIssuerPairsResult) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{11} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{13} } -func (x *ListIssuerPairsResult) GetIssiers() []*IssierShortDescriptor { +func (x *ListIssuerPairsResult) GetIssuers() []*IssierShortDescriptor { if x != nil { - return x.Issiers + return x.Issuers } return nil } @@ -617,15 +759,15 @@ type IssierShortDescriptor struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` - IssuerName string `protobuf:"bytes,2,opt,name=issuerName,proto3" json:"issuerName,omitempty"` - Revoked bool `protobuf:"varint,3,opt,name=revoked,proto3" json:"revoked,omitempty"` + IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Revoked bool `protobuf:"varint,3,opt,name=revoked,proto3" json:"revoked,omitempty"` } func (x *IssierShortDescriptor) Reset() { *x = IssierShortDescriptor{} if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[12] + mi := &file_certmanagercontrol_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +780,7 @@ func (x *IssierShortDescriptor) String() string { func (*IssierShortDescriptor) ProtoMessage() {} func (x *IssierShortDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[12] + mi := &file_certmanagercontrol_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +793,7 @@ func (x *IssierShortDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use IssierShortDescriptor.ProtoReflect.Descriptor instead. func (*IssierShortDescriptor) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{12} + return file_certmanagercontrol_proto_rawDescGZIP(), []int{14} } func (x *IssierShortDescriptor) GetIssuerID() int64 { @@ -661,9 +803,9 @@ func (x *IssierShortDescriptor) GetIssuerID() int64 { return 0 } -func (x *IssierShortDescriptor) GetIssuerName() string { +func (x *IssierShortDescriptor) GetName() string { if x != nil { - return x.IssuerName + return x.Name } return "" } @@ -675,119 +817,16 @@ func (x *IssierShortDescriptor) GetRevoked() bool { return false } -type GetIssuerCertificateParams struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - IssuerID int64 `protobuf:"varint,1,opt,name=issuerID,proto3" json:"issuerID,omitempty"` - IssuerName string `protobuf:"bytes,2,opt,name=issuerName,proto3" json:"issuerName,omitempty"` -} - -func (x *GetIssuerCertificateParams) Reset() { - *x = GetIssuerCertificateParams{} - if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetIssuerCertificateParams) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetIssuerCertificateParams) ProtoMessage() {} - -func (x *GetIssuerCertificateParams) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[13] - 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 GetIssuerCertificateParams.ProtoReflect.Descriptor instead. -func (*GetIssuerCertificateParams) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{13} -} - -func (x *GetIssuerCertificateParams) GetIssuerID() int64 { - if x != nil { - return x.IssuerID - } - return 0 -} - -func (x *GetIssuerCertificateParams) GetIssuerName() string { - if x != nil { - return x.IssuerName - } - return "" -} - -type GetIssuerCertificateResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CaCertificate string `protobuf:"bytes,1,opt,name=caCertificate,proto3" json:"caCertificate,omitempty"` -} - -func (x *GetIssuerCertificateResult) Reset() { - *x = GetIssuerCertificateResult{} - if protoimpl.UnsafeEnabled { - mi := &file_certmanagercontrol_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetIssuerCertificateResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetIssuerCertificateResult) ProtoMessage() {} - -func (x *GetIssuerCertificateResult) ProtoReflect() protoreflect.Message { - mi := &file_certmanagercontrol_proto_msgTypes[14] - 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 GetIssuerCertificateResult.ProtoReflect.Descriptor instead. -func (*GetIssuerCertificateResult) Descriptor() ([]byte, []int) { - return file_certmanagercontrol_proto_rawDescGZIP(), []int{14} -} - -func (x *GetIssuerCertificateResult) GetCaCertificate() string { - if x != nil { - return x.CaCertificate - } - return "" -} - type CreateServicePairParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - IssuerName string `protobuf:"bytes,1,opt,name=issuerName,proto3" json:"issuerName,omitempty"` - IssuerID int64 `protobuf:"varint,2,opt,name=issuerID,proto3" json:"issuerID,omitempty"` - ServiceName string `protobuf:"bytes,3,opt,name=serviceName,proto3" json:"serviceName,omitempty"` - ValidUntil string `protobuf:"bytes,4,opt,name=validUntil,proto3" json:"validUntil,omitempty"` - Hostnames []string `protobuf:"bytes,5,rep,name=hostnames,proto3" json:"hostnames,omitempty"` - InetAddress []string `protobuf:"bytes,6,rep,name=inetAddress,proto3" json:"inetAddress,omitempty"` + IssuerName string `protobuf:"bytes,1,opt,name=issuerName,proto3" json:"issuerName,omitempty"` + IssuerID int64 `protobuf:"varint,2,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + ServiceCommonName string `protobuf:"bytes,3,opt,name=serviceCommonName,proto3" json:"serviceCommonName,omitempty"` + Hostnames []string `protobuf:"bytes,5,rep,name=hostnames,proto3" json:"hostnames,omitempty"` + InetAddresses []string `protobuf:"bytes,6,rep,name=inetAddresses,proto3" json:"inetAddresses,omitempty"` } func (x *CreateServicePairParams) Reset() { @@ -836,16 +875,9 @@ func (x *CreateServicePairParams) GetIssuerID() int64 { return 0 } -func (x *CreateServicePairParams) GetServiceName() string { +func (x *CreateServicePairParams) GetServiceCommonName() string { if x != nil { - return x.ServiceName - } - return "" -} - -func (x *CreateServicePairParams) GetValidUntil() string { - if x != nil { - return x.ValidUntil + return x.ServiceCommonName } return "" } @@ -857,9 +889,9 @@ func (x *CreateServicePairParams) GetHostnames() []string { return nil } -func (x *CreateServicePairParams) GetInetAddress() []string { +func (x *CreateServicePairParams) GetInetAddresses() []string { if x != nil { - return x.InetAddress + return x.InetAddresses } return nil } @@ -869,10 +901,12 @@ type CreateServicePairResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServicePairId int64 `protobuf:"varint,1,opt,name=servicePairId,proto3" json:"servicePairId,omitempty"` - Ca string `protobuf:"bytes,2,opt,name=ca,proto3" json:"ca,omitempty"` - Cerificate string `protobuf:"bytes,3,opt,name=cerificate,proto3" json:"cerificate,omitempty"` - Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` + ServiceID int64 `protobuf:"varint,1,opt,name=serviceID,proto3" json:"serviceID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + IssuerCertificate string `protobuf:"bytes,3,opt,name=issuerCertificate,proto3" json:"issuerCertificate,omitempty"` + IssuerID int64 `protobuf:"varint,4,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + Cerificate string `protobuf:"bytes,5,opt,name=cerificate,proto3" json:"cerificate,omitempty"` + Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` } func (x *CreateServicePairResult) Reset() { @@ -907,20 +941,34 @@ func (*CreateServicePairResult) Descriptor() ([]byte, []int) { return file_certmanagercontrol_proto_rawDescGZIP(), []int{16} } -func (x *CreateServicePairResult) GetServicePairId() int64 { +func (x *CreateServicePairResult) GetServiceID() int64 { if x != nil { - return x.ServicePairId + return x.ServiceID } return 0 } -func (x *CreateServicePairResult) GetCa() string { +func (x *CreateServicePairResult) GetName() string { if x != nil { - return x.Ca + return x.Name } return "" } +func (x *CreateServicePairResult) GetIssuerCertificate() string { + if x != nil { + return x.IssuerCertificate + } + return "" +} + +func (x *CreateServicePairResult) GetIssuerID() int64 { + if x != nil { + return x.IssuerID + } + return 0 +} + func (x *CreateServicePairResult) GetCerificate() string { if x != nil { return x.Cerificate @@ -1158,11 +1206,11 @@ type ServiceShortDescriptor struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ServiceID int64 `protobuf:"varint,1,opt,name=serviceID,proto3" json:"serviceID,omitempty"` - ServiceName string `protobuf:"bytes,2,opt,name=serviceName,proto3" json:"serviceName,omitempty"` - IssuerName string `protobuf:"bytes,3,opt,name=issuerName,proto3" json:"issuerName,omitempty"` - IssuerID int64 `protobuf:"varint,4,opt,name=issuerID,proto3" json:"issuerID,omitempty"` - Revoked bool `protobuf:"varint,5,opt,name=revoked,proto3" json:"revoked,omitempty"` + ServiceID int64 `protobuf:"varint,1,opt,name=serviceID,proto3" json:"serviceID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + IssuerName string `protobuf:"bytes,3,opt,name=issuerName,proto3" json:"issuerName,omitempty"` + IssuerID int64 `protobuf:"varint,4,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + Revoked bool `protobuf:"varint,5,opt,name=revoked,proto3" json:"revoked,omitempty"` } func (x *ServiceShortDescriptor) Reset() { @@ -1204,9 +1252,9 @@ func (x *ServiceShortDescriptor) GetServiceID() int64 { return 0 } -func (x *ServiceShortDescriptor) GetServiceName() string { +func (x *ServiceShortDescriptor) GetName() string { if x != nil { - return x.ServiceName + return x.Name } return "" } @@ -1377,8 +1425,12 @@ type GetServicePairResult struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CaCertificate string `protobuf:"bytes,1,opt,name=caCertificate,proto3" json:"caCertificate,omitempty"` - Certificate string `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Certificate string `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` + Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + IssuerID int64 `protobuf:"varint,4,opt,name=issuerID,proto3" json:"issuerID,omitempty"` + IssuerName string `protobuf:"bytes,5,opt,name=issuerName,proto3" json:"issuerName,omitempty"` + Revoked bool `protobuf:"varint,6,opt,name=revoked,proto3" json:"revoked,omitempty"` } func (x *GetServicePairResult) Reset() { @@ -1413,9 +1465,9 @@ func (*GetServicePairResult) Descriptor() ([]byte, []int) { return file_certmanagercontrol_proto_rawDescGZIP(), []int{25} } -func (x *GetServicePairResult) GetCaCertificate() string { +func (x *GetServicePairResult) GetName() string { if x != nil { - return x.CaCertificate + return x.Name } return "" } @@ -1427,6 +1479,34 @@ func (x *GetServicePairResult) GetCertificate() string { return "" } +func (x *GetServicePairResult) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetServicePairResult) GetIssuerID() int64 { + if x != nil { + return x.IssuerID + } + return 0 +} + +func (x *GetServicePairResult) GetIssuerName() string { + if x != nil { + return x.IssuerName + } + return "" +} + +func (x *GetServicePairResult) GetRevoked() bool { + if x != nil { + return x.Revoked + } + return false +} + var File_certmanagercontrol_proto protoreflect.FileDescriptor var file_certmanagercontrol_proto_rawDesc = []byte{ @@ -1436,227 +1516,242 @@ var file_certmanagercontrol_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x2b, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xd0, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x16, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, - 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6c, - 0x66, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, - 0x65, 0x6c, 0x66, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x75, 0x70, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x75, 0x70, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x2c, 0x0a, 0x11, 0x75, 0x70, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, - 0x75, 0x70, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x22, 0x5a, 0x0a, 0x16, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x61, 0x43, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x63, 0x61, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x4c, 0x0a, - 0x16, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, - 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x34, 0x0a, 0x16, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x22, 0x54, 0x0a, 0x16, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x72, 0x65, 0x76, 0x6f, 0x6b, + 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6b, 0x65, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x56, 0x0a, 0x16, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x56, 0x0a, 0x18, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, + 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, + 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, + 0x58, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x75, 0x6e, 0x72, - 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, - 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x07, 0x69, 0x73, 0x73, 0x69, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x49, 0x73, - 0x73, 0x69, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x52, 0x07, 0x69, 0x73, 0x73, 0x69, 0x65, 0x72, 0x73, 0x22, 0x6d, 0x0a, 0x15, - 0x49, 0x73, 0x73, 0x69, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x58, 0x0a, 0x1a, 0x67, - 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x61, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0xd7, 0x01, 0x0a, 0x17, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, - 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, - 0x74, 0x69, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x61, 0x69, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x63, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x63, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x9b, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0x9d, 0x01, 0x0a, 0x19, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, - 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x22, 0x1b, 0x0a, 0x19, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xae, 0x01, - 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, - 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x67, 0x65, + 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, - 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x18, - 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, - 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x60, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x56, 0x0a, 0x14, 0x67, 0x65, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, - 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x61, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x63, 0x61, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x32, 0xbd, 0x09, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x57, - 0x0a, 0x09, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x65, - 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x1a, 0x23, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, - 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, - 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, - 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, - 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0x00, 0x12, 0x72, 0x0a, 0x12, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x75, 0x6e, 0x72, - 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x75, 0x6e, 0x72, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, - 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, - 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, - 0x12, 0x78, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, - 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2e, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, - 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x11, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, - 0x2b, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x63, - 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, - 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x11, 0x72, + 0x65, 0x72, 0x49, 0x44, 0x22, 0x4c, 0x0a, 0x16, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, + 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x22, 0x54, 0x0a, 0x16, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x54, 0x0a, 0x16, 0x72, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, + 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x18, + 0x0a, 0x16, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, + 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x56, 0x0a, 0x18, 0x75, 0x6e, 0x72, 0x65, + 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, + 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x1a, 0x0a, 0x18, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x17, 0x0a, 0x15, + 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, + 0x0a, 0x07, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x49, 0x73, 0x73, 0x69, 0x65, 0x72, 0x53, 0x68, 0x6f, 0x72, 0x74, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x07, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x73, 0x22, 0x61, 0x0a, 0x15, 0x49, 0x73, 0x73, 0x69, 0x65, 0x72, 0x53, 0x68, 0x6f, + 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, + 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0xc7, 0x01, 0x0a, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x2c, + 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x09, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, + 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x22, 0xc7, 0x01, 0x0a, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, + 0x0a, 0x11, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x9b, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, - 0x12, 0x2b, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, - 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, - 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, - 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x72, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x9d, 0x01, 0x0a, 0x19, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, + 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0xa0, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x72, + 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, + 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x6f, + 0x6b, 0x65, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x60, 0x0a, + 0x16, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, + 0x56, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, + 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x14, 0x67, 0x65, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x32, 0xbd, + 0x09, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x57, 0x0a, 0x09, 0x67, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x23, 0x2e, 0x63, + 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, + 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, + 0x6c, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, + 0x61, 0x69, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x72, 0x0a, + 0x12, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, + 0x61, 0x69, 0x72, 0x12, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, + 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x75, 0x6e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x00, 0x12, 0x69, 0x0a, 0x0f, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, + 0x61, 0x69, 0x72, 0x73, 0x12, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x29, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, + 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x78, 0x0a, 0x14, + 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2e, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, + 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2b, 0x2e, 0x63, 0x65, + 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, + 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x11, 0x72, 0x65, 0x76, 0x6f, 0x6b, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x2b, 0x2e, 0x63, + 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2e, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2b, 0x2e, 0x63, 0x65, 0x72, 0x74, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x72, + 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x6c, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0e, 0x67, 0x65, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x28, 0x2e, 0x63, - 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x3b, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6c, 0x69, + 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42, 0x16, + 0x5a, 0x14, 0x2e, 0x3b, 0x63, 0x65, 0x72, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1677,17 +1772,17 @@ var file_certmanagercontrol_proto_goTypes = []interface{}{ (*GetStatusResult)(nil), // 1: certmanagercontrol.getStatusResult (*CreateIssuerPairParams)(nil), // 2: certmanagercontrol.createIssuerPairParams (*CreateIssuerPairResult)(nil), // 3: certmanagercontrol.createIssuerPairResult - (*ImportIssuerPairParams)(nil), // 4: certmanagercontrol.importIssuerPairParams - (*ImportIssuerPairResult)(nil), // 5: certmanagercontrol.importIssuerPairResult - (*RevokeIssuerPairParams)(nil), // 6: certmanagercontrol.revokeIssuerPairParams - (*RevokeIssuerPairResult)(nil), // 7: certmanagercontrol.revokeIssuerPairResult - (*UnrevokeIssuerPairParams)(nil), // 8: certmanagercontrol.unrevokeIssuerPairParams - (*UnrevokeIssuerPairResult)(nil), // 9: certmanagercontrol.unrevokeIssuerPairResult - (*ListIssuerPairsParams)(nil), // 10: certmanagercontrol.listIssuerPairsParams - (*ListIssuerPairsResult)(nil), // 11: certmanagercontrol.listIssuerPairsResult - (*IssierShortDescriptor)(nil), // 12: certmanagercontrol.IssierShortDescriptor - (*GetIssuerCertificateParams)(nil), // 13: certmanagercontrol.getIssuerCertificateParams - (*GetIssuerCertificateResult)(nil), // 14: certmanagercontrol.getIssuerCertificateResult + (*GetIssuerCertificateParams)(nil), // 4: certmanagercontrol.getIssuerCertificateParams + (*GetIssuerCertificateResult)(nil), // 5: certmanagercontrol.getIssuerCertificateResult + (*ImportIssuerPairParams)(nil), // 6: certmanagercontrol.importIssuerPairParams + (*ImportIssuerPairResult)(nil), // 7: certmanagercontrol.importIssuerPairResult + (*RevokeIssuerPairParams)(nil), // 8: certmanagercontrol.revokeIssuerPairParams + (*RevokeIssuerPairResult)(nil), // 9: certmanagercontrol.revokeIssuerPairResult + (*UnrevokeIssuerPairParams)(nil), // 10: certmanagercontrol.unrevokeIssuerPairParams + (*UnrevokeIssuerPairResult)(nil), // 11: certmanagercontrol.unrevokeIssuerPairResult + (*ListIssuerPairsParams)(nil), // 12: certmanagercontrol.listIssuerPairsParams + (*ListIssuerPairsResult)(nil), // 13: certmanagercontrol.listIssuerPairsResult + (*IssierShortDescriptor)(nil), // 14: certmanagercontrol.IssierShortDescriptor (*CreateServicePairParams)(nil), // 15: certmanagercontrol.createServicePairParams (*CreateServicePairResult)(nil), // 16: certmanagercontrol.createServicePairResult (*RevokeServicePairParams)(nil), // 17: certmanagercontrol.revokeServicePairParams @@ -1701,26 +1796,26 @@ var file_certmanagercontrol_proto_goTypes = []interface{}{ (*GetServicePairResult)(nil), // 25: certmanagercontrol.getServicePairResult } var file_certmanagercontrol_proto_depIdxs = []int32{ - 12, // 0: certmanagercontrol.listIssuerPairsResult.issiers:type_name -> certmanagercontrol.IssierShortDescriptor + 14, // 0: certmanagercontrol.listIssuerPairsResult.issuers:type_name -> certmanagercontrol.IssierShortDescriptor 21, // 1: certmanagercontrol.listServicePairsResult.services:type_name -> certmanagercontrol.ServiceShortDescriptor 0, // 2: certmanagercontrol.Control.getStatus:input_type -> certmanagercontrol.getStatusParams 2, // 3: certmanagercontrol.Control.createIssuerPair:input_type -> certmanagercontrol.createIssuerPairParams - 4, // 4: certmanagercontrol.Control.importIssuerPair:input_type -> certmanagercontrol.importIssuerPairParams - 6, // 5: certmanagercontrol.Control.revokeIssuerPair:input_type -> certmanagercontrol.revokeIssuerPairParams - 8, // 6: certmanagercontrol.Control.unrevokeIssuerPair:input_type -> certmanagercontrol.unrevokeIssuerPairParams - 10, // 7: certmanagercontrol.Control.listIssuerPairs:input_type -> certmanagercontrol.listIssuerPairsParams - 13, // 8: certmanagercontrol.Control.getIssuerCertificate:input_type -> certmanagercontrol.getIssuerCertificateParams + 6, // 4: certmanagercontrol.Control.importIssuerPair:input_type -> certmanagercontrol.importIssuerPairParams + 8, // 5: certmanagercontrol.Control.revokeIssuerPair:input_type -> certmanagercontrol.revokeIssuerPairParams + 10, // 6: certmanagercontrol.Control.unrevokeIssuerPair:input_type -> certmanagercontrol.unrevokeIssuerPairParams + 12, // 7: certmanagercontrol.Control.listIssuerPairs:input_type -> certmanagercontrol.listIssuerPairsParams + 4, // 8: certmanagercontrol.Control.getIssuerCertificate:input_type -> certmanagercontrol.getIssuerCertificateParams 15, // 9: certmanagercontrol.Control.createServicePair:input_type -> certmanagercontrol.createServicePairParams 17, // 10: certmanagercontrol.Control.revokeServicePair:input_type -> certmanagercontrol.revokeServicePairParams 22, // 11: certmanagercontrol.Control.listServicePairs:input_type -> certmanagercontrol.listServicePairsParams 24, // 12: certmanagercontrol.Control.getServicePair:input_type -> certmanagercontrol.getServicePairParams 1, // 13: certmanagercontrol.Control.getStatus:output_type -> certmanagercontrol.getStatusResult 3, // 14: certmanagercontrol.Control.createIssuerPair:output_type -> certmanagercontrol.createIssuerPairResult - 5, // 15: certmanagercontrol.Control.importIssuerPair:output_type -> certmanagercontrol.importIssuerPairResult - 7, // 16: certmanagercontrol.Control.revokeIssuerPair:output_type -> certmanagercontrol.revokeIssuerPairResult - 9, // 17: certmanagercontrol.Control.unrevokeIssuerPair:output_type -> certmanagercontrol.unrevokeIssuerPairResult - 11, // 18: certmanagercontrol.Control.listIssuerPairs:output_type -> certmanagercontrol.listIssuerPairsResult - 14, // 19: certmanagercontrol.Control.getIssuerCertificate:output_type -> certmanagercontrol.getIssuerCertificateResult + 7, // 15: certmanagercontrol.Control.importIssuerPair:output_type -> certmanagercontrol.importIssuerPairResult + 9, // 16: certmanagercontrol.Control.revokeIssuerPair:output_type -> certmanagercontrol.revokeIssuerPairResult + 11, // 17: certmanagercontrol.Control.unrevokeIssuerPair:output_type -> certmanagercontrol.unrevokeIssuerPairResult + 13, // 18: certmanagercontrol.Control.listIssuerPairs:output_type -> certmanagercontrol.listIssuerPairsResult + 5, // 19: certmanagercontrol.Control.getIssuerCertificate:output_type -> certmanagercontrol.getIssuerCertificateResult 16, // 20: certmanagercontrol.Control.createServicePair:output_type -> certmanagercontrol.createServicePairResult 18, // 21: certmanagercontrol.Control.revokeServicePair:output_type -> certmanagercontrol.revokeServicePairResult 23, // 22: certmanagercontrol.Control.listServicePairs:output_type -> certmanagercontrol.listServicePairsResult @@ -1787,114 +1882,6 @@ func file_certmanagercontrol_proto_init() { } } file_certmanagercontrol_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportIssuerPairParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportIssuerPairResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RevokeIssuerPairParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RevokeIssuerPairResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnrevokeIssuerPairParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnrevokeIssuerPairResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListIssuerPairsParams); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListIssuerPairsResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IssierShortDescriptor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_certmanagercontrol_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetIssuerCertificateParams); i { case 0: return &v.state @@ -1906,7 +1893,7 @@ func file_certmanagercontrol_proto_init() { return nil } } - file_certmanagercontrol_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_certmanagercontrol_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetIssuerCertificateResult); i { case 0: return &v.state @@ -1918,6 +1905,114 @@ func file_certmanagercontrol_proto_init() { return nil } } + file_certmanagercontrol_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportIssuerPairParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportIssuerPairResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeIssuerPairParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RevokeIssuerPairResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnrevokeIssuerPairParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnrevokeIssuerPairResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIssuerPairsParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIssuerPairsResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_certmanagercontrol_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IssierShortDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } file_certmanagercontrol_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateServicePairParams); i { case 0: diff --git a/configure b/configure index 6fd870b..a4d97f6 100755 --- a/configure +++ b/configure @@ -3174,7 +3174,7 @@ srv_sbindir="${prefix}/sbin" -ac_config_files="$ac_config_files Makefile internal/config/path.go initrc/certmanagerd.service" +ac_config_files="$ac_config_files Makefile internal/test/Makefile internal/config/path.go initrc/certmanagerd.service" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3913,6 +3913,7 @@ for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "internal/test/Makefile") CONFIG_FILES="$CONFIG_FILES internal/test/Makefile" ;; "internal/config/path.go") CONFIG_FILES="$CONFIG_FILES internal/config/path.go" ;; "initrc/certmanagerd.service") CONFIG_FILES="$CONFIG_FILES initrc/certmanagerd.service" ;; diff --git a/configure.ac b/configure.ac index 8f6b0c2..5801f79 100644 --- a/configure.ac +++ b/configure.ac @@ -189,6 +189,7 @@ AC_SUBST(srv_sbindir, "${prefix}/sbin") AC_CONFIG_FILES([ Makefile +internal/test/Makefile internal/config/path.go initrc/certmanagerd.service ]) diff --git a/internal/descriptor/descriptor.go b/internal/descriptor/descriptor.go index 053ae9d..3a11582 100644 --- a/internal/descriptor/descriptor.go +++ b/internal/descriptor/descriptor.go @@ -9,10 +9,11 @@ type Issuer struct { } type Service struct { - ID int64 `json:"id" yaml:"id" db:"id"` - IssuerID int64 `json:"issuerId" yaml:"issuerId" db:"issuer_id"` - Name string `json:"name" yaml:"name" db:"name"` - Cert string `json:"cert" yaml:"cert" db:"cert"` - Key string `json:"key" yaml:"key" db:"key"` - Revoked bool `json:"revoked" yaml:"revoked" db:"revoked"` + ID int64 `json:"id" yaml:"id" db:"id"` + IssuerID int64 `json:"issuerId" yaml:"issuerId" db:"issuer_id"` + IssuerName string `json:"issuerName" yaml:"issuerName" db:"issuer_name"` + Name string `json:"name" yaml:"name" db:"name"` + Cert string `json:"cert" yaml:"cert" db:"cert"` + Key string `json:"key" yaml:"key" db:"key"` + Revoked bool `json:"revoked" yaml:"revoked" db:"revoked"` } diff --git a/internal/logic/certman.go b/internal/logic/certman.go deleted file mode 100644 index 452073d..0000000 --- a/internal/logic/certman.go +++ /dev/null @@ -1,91 +0,0 @@ -package logic - -import ( - "context" - "encoding/base64" - "encoding/json" - - cmapi "certmanager/api/certmanagercontrol" - "certmanager/internal/descriptor" - //yaml "gopkg.in/yaml.v3" -) - -func (lg *Logic) CreateIssuerPair(ctx context.Context, params *cmapi.CreateIssuerPairParams) (*cmapi.CreateIssuerPairResult, error) { - var err error - res := &cmapi.CreateIssuerPairResult{} - - paramsJson, err := json.Marshal(params) - if err != nil { - return res, err - } - lg.log.Debugf("params: \n%s\n", string(paramsJson)) - - certBytes, keyBytes, err := CreateX509SelfSignedCert(params.IssuerName) - certString := base64.StdEncoding.EncodeToString(certBytes) - keyString := base64.StdEncoding.EncodeToString(keyBytes) - issuer := &descriptor.Issuer{ - Name: params.IssuerName, - Cert: certString, - Key: keyString, - } - issuerID, err := lg.db.InsertIssuer(ctx, issuer) - if err != nil { - return res, err - } - res.IssuerID = issuerID - return res, err -} - -func (lg *Logic) ImportIssuerPair(ctx context.Context, params *cmapi.ImportIssuerPairParams) (*cmapi.ImportIssuerPairResult, error) { - var err error - res := &cmapi.ImportIssuerPairResult{} - return res, err -} - -func (lg *Logic) RevokeIssuerPair(ctx context.Context, params *cmapi.RevokeIssuerPairParams) (*cmapi.RevokeIssuerPairResult, error) { - var err error - res := &cmapi.RevokeIssuerPairResult{} - return res, err -} - -func (lg *Logic) UnrevokeIssuerPair(ctx context.Context, params *cmapi.UnrevokeIssuerPairParams) (*cmapi.UnrevokeIssuerPairResult, error) { - var err error - res := &cmapi.UnrevokeIssuerPairResult{} - return res, err -} - -func (lg *Logic) ListIssuerPairs(ctx context.Context, params *cmapi.ListIssuerPairsParams) (*cmapi.ListIssuerPairsResult, error) { - var err error - res := &cmapi.ListIssuerPairsResult{} - return res, err -} - -func (lg *Logic) GetIssuerCertificate(ctx context.Context, params *cmapi.GetIssuerCertificateParams) (*cmapi.GetIssuerCertificateResult, error) { - var err error - res := &cmapi.GetIssuerCertificateResult{} - return res, err -} - -func (lg *Logic) CreateServicePair(ctx context.Context, params *cmapi.CreateServicePairParams) (*cmapi.CreateServicePairResult, error) { - var err error - res := &cmapi.CreateServicePairResult{} - return res, err -} - -func (lg *Logic) RevokeServicePair(ctx context.Context, params *cmapi.RevokeServicePairParams) (*cmapi.RevokeServicePairResult, error) { - var err error - res := &cmapi.RevokeServicePairResult{} - return res, err -} - -func (lg *Logic) ListServicePairs(ctx context.Context, params *cmapi.ListServicePairsParams) (*cmapi.ListServicePairsResult, error) { - var err error - res := &cmapi.ListServicePairsResult{} - return res, err -} - -func (lg *Logic) GetServicePair(ctx context.Context, params *cmapi.GetServicePairParams) (*cmapi.GetServicePairResult, error) { - var err error - res := &cmapi.GetServicePairResult{} - return res, err -} diff --git a/internal/logic/issuer.go b/internal/logic/issuer.go new file mode 100644 index 0000000..ee83b72 --- /dev/null +++ b/internal/logic/issuer.go @@ -0,0 +1,238 @@ +package logic + +import ( + "context" + "fmt" + + "crypto/x509" + "encoding/base64" + "encoding/pem" + + cmapi "certmanager/api/certmanagercontrol" + "certmanager/internal/descriptor" +) + +func (lg *Logic) CreateIssuerPair(ctx context.Context, params *cmapi.CreateIssuerPairParams) (*cmapi.CreateIssuerPairResult, error) { + var err error + res := &cmapi.CreateIssuerPairResult{} + + createIssuerPairParams := &CreateIssuerPairParams{ + CommonName: params.IssuerCommonName, + } + createIssuerPairRes, err := CreateIssuerPair(createIssuerPairParams) + if err != nil { + return res, err + } + + issuer := &descriptor.Issuer{ + Name: createIssuerPairRes.Name, + Cert: createIssuerPairRes.Cert, + Key: createIssuerPairRes.Key, + } + issuerID, err := lg.db.InsertIssuer(ctx, issuer) + if err != nil { + return res, err + } + res.IssuerID = issuerID + return res, err +} + +func (lg *Logic) GetIssuerCertificate(ctx context.Context, params *cmapi.GetIssuerCertificateParams) (*cmapi.GetIssuerCertificateResult, error) { + var err error + res := &cmapi.GetIssuerCertificateResult{} + var issuerDescr *descriptor.Issuer + var issuerExists bool + switch { + case params.IssuerID != 0: + issuerExists, issuerDescr, err = lg.db.GetIssuerByID(ctx, params.IssuerID) + if !issuerExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.IssuerName != "": + issuerExists, issuerDescr, err = lg.db.GetIssuerByName(ctx, params.IssuerName) + if !issuerExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Issuer ID or name is not specified") + if err != nil { + return res, err + } + } + if issuerDescr == nil { + err := fmt.Errorf("Issuer descriptor is nil") + if err != nil { + return res, err + } + } + res.IssuerID = issuerDescr.ID + res.Certificate = issuerDescr.Cert + res.Name = issuerDescr.Name + res.Revoked = issuerDescr.Revoked + return res, err +} + +func (lg *Logic) ImportIssuerPair(ctx context.Context, params *cmapi.ImportIssuerPairParams) (*cmapi.ImportIssuerPairResult, error) { + var err error + res := &cmapi.ImportIssuerPairResult{} + + certPEM, err := base64.StdEncoding.DecodeString(params.Certificate) + if err != nil { + return res, err + } + certBlock, _ := pem.Decode([]byte(certPEM)) + if certBlock == nil { + err := fmt.Errorf("Failed to parse certificate PEM") + return res, err + } + cert, err := x509.ParseCertificate(certBlock.Bytes) + if err != nil { + return res, err + } + if !cert.IsCA { + err := fmt.Errorf("Certificate is not CA") + return res, err + } + + if params.Key != "" { + keyPEM, err := base64.StdEncoding.DecodeString(params.Key) + if err != nil { + return res, err + } + keyBlock, _ := pem.Decode([]byte(keyPEM)) + if keyBlock == nil { + err := fmt.Errorf("Failed to parse certificate PEM") + return res, err + } + } + + issuerDescr := &descriptor.Issuer{ + Name: cert.Issuer.String(), + Cert: params.Certificate, + Key: params.Key, + } + issuerID, err := lg.db.InsertIssuer(ctx, issuerDescr) + if err != nil { + return res, err + } + res.IssuerName = cert.Subject.String() + res.IssuerID = issuerID + return res, err +} + +func (lg *Logic) RevokeIssuerPair(ctx context.Context, params *cmapi.RevokeIssuerPairParams) (*cmapi.RevokeIssuerPairResult, error) { + var err error + res := &cmapi.RevokeIssuerPairResult{} + + var issuerDescr *descriptor.Issuer + var issuerExists bool + switch { + case params.IssuerID != 0: + issuerExists, issuerDescr, err = lg.db.GetIssuerByID(ctx, params.IssuerID) + if !issuerExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.IssuerName != "": + issuerExists, issuerDescr, err = lg.db.GetIssuerByName(ctx, params.IssuerName) + if !issuerExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Issuer ID or name is not specified") + if err != nil { + return res, err + } + } + if issuerDescr == nil { + err := fmt.Errorf("Issuer descriptor is nil") + if err != nil { + return res, err + } + } + if !issuerDescr.Revoked { + issuerDescr.Revoked = true + err = lg.db.UpdateIssuerByID(ctx, issuerDescr.ID, issuerDescr) + if err != nil { + return res, err + } + } + return res, err +} + +func (lg *Logic) UnrevokeIssuerPair(ctx context.Context, params *cmapi.UnrevokeIssuerPairParams) (*cmapi.UnrevokeIssuerPairResult, error) { + var err error + res := &cmapi.UnrevokeIssuerPairResult{} + + var issuerDescr *descriptor.Issuer + var issuerExists bool + switch { + case params.IssuerID != 0: + issuerExists, issuerDescr, err = lg.db.GetIssuerByID(ctx, params.IssuerID) + if !issuerExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.IssuerName != "": + issuerExists, issuerDescr, err = lg.db.GetIssuerByName(ctx, params.IssuerName) + if !issuerExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Issuer ID or name is not specified") + if err != nil { + return res, err + } + } + if issuerDescr == nil { + err := fmt.Errorf("Issuer descriptor is nil") + if err != nil { + return res, err + } + } + if issuerDescr.Revoked { + issuerDescr.Revoked = false + err = lg.db.UpdateIssuerByID(ctx, issuerDescr.ID, issuerDescr) + if err != nil { + return res, err + } + } + return res, err +} + +func (lg *Logic) ListIssuerPairs(ctx context.Context, params *cmapi.ListIssuerPairsParams) (*cmapi.ListIssuerPairsResult, error) { + var err error + res := &cmapi.ListIssuerPairsResult{ + Issuers: make([]*cmapi.IssierShortDescriptor, 0), + } + + listIssuers, err := lg.db.ListIssuers(ctx) + if err != nil { + return res, err + } + for _, issuer := range listIssuers { + issuerShortDescr := cmapi.IssierShortDescriptor{ + IssuerID: issuer.ID, + Name: issuer.Name, + Revoked: issuer.Revoked, + } + res.Issuers = append(res.Issuers, &issuerShortDescr) + } + return res, err +} diff --git a/internal/logic/service.go b/internal/logic/service.go new file mode 100644 index 0000000..eb8be8e --- /dev/null +++ b/internal/logic/service.go @@ -0,0 +1,238 @@ +package logic + +import ( + "context" + "fmt" + + "certmanager/internal/descriptor" + + cmapi "certmanager/api/certmanagercontrol" +) + +func (lg *Logic) CreateServicePair(ctx context.Context, params *cmapi.CreateServicePairParams) (*cmapi.CreateServicePairResult, error) { + var err error + res := &cmapi.CreateServicePairResult{} + + var issuerDescr *descriptor.Issuer + var issuerExists bool + switch { + case params.IssuerID != 0: + issuerExists, issuerDescr, err = lg.db.GetIssuerByID(ctx, params.IssuerID) + if !issuerExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.IssuerName != "": + issuerExists, issuerDescr, err = lg.db.GetIssuerByName(ctx, params.IssuerName) + if !issuerExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Issuer ID or name is not specified") + if err != nil { + return res, err + } + } + if issuerDescr == nil { + err := fmt.Errorf("Issuer descriptor is nil") + if err != nil { + return res, err + } + } + if issuerDescr.Revoked { + err := fmt.Errorf("The issuer revoked") + if err != nil { + return res, err + } + } + + createServicePairParams := &CreateServicePairParams{ + CommonName: params.ServiceCommonName, + IssuerKey: issuerDescr.Key, + IssuerCert: issuerDescr.Cert, + IPAddresses: params.InetAddresses, + } + createSericePairRes, err := CreateServicePair(createServicePairParams) + if err != nil { + return res, err + } + + serviceDescr := &descriptor.Service{ + Name: createSericePairRes.Name, + IssuerID: issuerDescr.ID, + IssuerName: issuerDescr.Name, + Cert: createSericePairRes.Cert, + Key: createSericePairRes.Key, + } + serviceID, err := lg.db.InsertService(ctx, serviceDescr) + if err != nil { + return res, err + } + res.Name = createSericePairRes.Name + res.ServiceID = serviceID + res.Cerificate = createSericePairRes.Cert + res.Key = createSericePairRes.Key + res.IssuerID = issuerDescr.ID + res.IssuerCertificate = issuerDescr.Cert + return res, err +} + +func (lg *Logic) GetServicePair(ctx context.Context, params *cmapi.GetServicePairParams) (*cmapi.GetServicePairResult, error) { + var err error + res := &cmapi.GetServicePairResult{} + var serviceDescr *descriptor.Service + var serviceExists bool + switch { + case params.ServiceID != 0: + serviceExists, serviceDescr, err = lg.db.GetServiceByID(ctx, params.ServiceID) + if !serviceExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.ServiceName != "": + serviceExists, serviceDescr, err = lg.db.GetServiceByName(ctx, params.ServiceName) + if !serviceExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Service ID or name is not specified") + if err != nil { + return res, err + } + } + if serviceDescr == nil { + err := fmt.Errorf("Service descriptor is nil") + if err != nil { + return res, err + } + } + res.Certificate = serviceDescr.Cert + res.Key = serviceDescr.Key + res.IssuerID = serviceDescr.IssuerID + res.IssuerName = serviceDescr.IssuerName + res.Revoked = serviceDescr.Revoked + return res, err +} + +func (lg *Logic) ListServicePairs(ctx context.Context, params *cmapi.ListServicePairsParams) (*cmapi.ListServicePairsResult, error) { + var err error + res := &cmapi.ListServicePairsResult{ + Services: make([]*cmapi.ServiceShortDescriptor, 0), + } + + listServices, err := lg.db.ListServices(ctx) + if err != nil { + return res, err + } + for _, service := range listServices { + serviceShortDescr := cmapi.ServiceShortDescriptor{ + ServiceID: service.ID, + IssuerID: service.IssuerID, + IssuerName: service.IssuerName, + Name: service.Name, + Revoked: service.Revoked, + } + res.Services = append(res.Services, &serviceShortDescr) + } + return res, err +} + +func (lg *Logic) RevokeServicePair(ctx context.Context, params *cmapi.RevokeServicePairParams) (*cmapi.RevokeServicePairResult, error) { + var err error + res := &cmapi.RevokeServicePairResult{} + + var serviceDescr *descriptor.Service + var serviceExists bool + switch { + case params.ServiceID != 0: + serviceExists, serviceDescr, err = lg.db.GetServiceByID(ctx, params.ServiceID) + if !serviceExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.ServiceName != "": + serviceExists, serviceDescr, err = lg.db.GetServiceByName(ctx, params.ServiceName) + if !serviceExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Service ID or name is not specified") + if err != nil { + return res, err + } + } + if serviceDescr == nil { + err := fmt.Errorf("Service descriptor is nil") + if err != nil { + return res, err + } + } + if !serviceDescr.Revoked { + serviceDescr.Revoked = true + err = lg.db.UpdateServiceByID(ctx, serviceDescr.ID, serviceDescr) + if err != nil { + return res, err + } + } + return res, err +} + +func (lg *Logic) UnrevokeServicePair(ctx context.Context, params *cmapi.UnrevokeServicePairParams) (*cmapi.UnrevokeServicePairResult, error) { + var err error + res := &cmapi.UnrevokeServicePairResult{} + + var serviceDescr *descriptor.Service + var serviceExists bool + switch { + case params.ServiceID != 0: + serviceExists, serviceDescr, err = lg.db.GetServiceByID(ctx, params.ServiceID) + if !serviceExists { + err := fmt.Errorf("No signer with this ID was found") + if err != nil { + return res, err + } + } + case params.ServiceName != "": + serviceExists, serviceDescr, err = lg.db.GetServiceByName(ctx, params.ServiceName) + if !serviceExists { + err := fmt.Errorf("No signer with this common name was found") + if err != nil { + return res, err + } + } + default: + err := fmt.Errorf("Service ID or name is not specified") + if err != nil { + return res, err + } + } + if serviceDescr == nil { + err := fmt.Errorf("Service descriptor is nil") + if err != nil { + return res, err + } + } + if serviceDescr.Revoked { + serviceDescr.Revoked = false + err = lg.db.UpdateServiceByID(ctx, serviceDescr.ID, serviceDescr) + if err != nil { + return res, err + } + } + return res, err +} diff --git a/internal/logic/x509.go b/internal/logic/x509.go index dfe1b1f..b57b226 100644 --- a/internal/logic/x509.go +++ b/internal/logic/x509.go @@ -5,6 +5,7 @@ import ( "crypto/rsa" "crypto/x509" "crypto/x509/pkix" + "encoding/base64" "encoding/pem" "fmt" "math/big" @@ -12,60 +13,19 @@ import ( "time" ) -func CreateX509SelfSignedCert(subject string, commonNames ...string) ([]byte, []byte, error) { - var err error - certPem := make([]byte, 0) - keyPem := make([]byte, 0) - - now := time.Now() - - const yearsAfter int = 10 - const keySize int = 2048 - - key, err := rsa.GenerateKey(rand.Reader, keySize) - if err != nil { - err := fmt.Errorf("Can't create a private key: %v", err) - return certPem, keyPem, err - - } - keyPemBlock := pem.Block{ - Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(key), - } - keyPem = pem.EncodeToMemory(&keyPemBlock) - - dnsNames := make([]string, 0) - dnsNames = append(dnsNames, subject) - dnsNames = append(dnsNames, commonNames...) - tml := x509.Certificate{ - SerialNumber: big.NewInt(now.Unix()), - NotBefore: now, - NotAfter: now.AddDate(yearsAfter, 0, 0), - Subject: pkix.Name{ - CommonName: subject, - }, - DNSNames: dnsNames, - IPAddresses: []net.IP{net.ParseIP("192.168.57.1")}, - BasicConstraintsValid: true, - } - certBytes, err := x509.CreateCertificate(rand.Reader, &tml, &tml, &key.PublicKey, key) - if err != nil { - return certPem, keyPem, fmt.Errorf("Can't create a certificate: %v", err) - - } - certPemBlock := pem.Block{ - Type: "CERTIFICATE", - Bytes: certBytes, - } - certPem = pem.EncodeToMemory(&certPemBlock) - if err != nil { - return certPem, keyPem, err - } - return certPem, keyPem, err +type CreateIssuerPairParams struct { + CommonName string +} +type CreateIssuerPairResult struct { + Name string + Cert string + Key string } -func CreateX509CACert(commonName string) ([]byte, []byte, error) { +func CreateIssuerPair(params *CreateIssuerPairParams) (*CreateIssuerPairResult, error) { var err error + res := &CreateIssuerPairResult{} + certPem := make([]byte, 0) keyPem := make([]byte, 0) @@ -77,7 +37,7 @@ func CreateX509CACert(commonName string) ([]byte, []byte, error) { key, err := rsa.GenerateKey(rand.Reader, keySize) if err != nil { err := fmt.Errorf("Can't create a private key: %v", err) - return certPem, keyPem, err + return res, err } keyPemBlock := pem.Block{ @@ -86,13 +46,16 @@ func CreateX509CACert(commonName string) ([]byte, []byte, error) { } keyPem = pem.EncodeToMemory(&keyPemBlock) + subjectName := pkix.Name{ + CommonName: params.CommonName, + } + res.Name = subjectName.String() + tml := x509.Certificate{ - SerialNumber: big.NewInt(now.Unix()), - NotBefore: now, - NotAfter: now.AddDate(yearsAfter, 0, 0), - Subject: pkix.Name{ - CommonName: commonName, - }, + SerialNumber: big.NewInt(now.Unix()), + NotBefore: now, + NotAfter: now.AddDate(yearsAfter, 0, 0), + Subject: subjectName, IsCA: true, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, @@ -100,7 +63,8 @@ func CreateX509CACert(commonName string) ([]byte, []byte, error) { } certBytes, err := x509.CreateCertificate(rand.Reader, &tml, &tml, &key.PublicKey, key) if err != nil { - return certPem, keyPem, fmt.Errorf("Can't create a certificate: %v", err) + err := fmt.Errorf("Can't create a certificate: %v", err) + return res, err } certPemBlock := pem.Block{ @@ -108,15 +72,33 @@ func CreateX509CACert(commonName string) ([]byte, []byte, error) { Bytes: certBytes, } certPem = pem.EncodeToMemory(&certPemBlock) - if err != nil { - return certPem, keyPem, err + return res, err } - return certPem, keyPem, err + + res.Cert = base64.StdEncoding.EncodeToString(certPem) + res.Key = base64.StdEncoding.EncodeToString(keyPem) + return res, err } -func CreateX509Cert(commonName string, caKeyPem []byte, dnsNames ...string) ([]byte, []byte, error) { +type CreateServicePairParams struct { + CommonName string + DNSNames []string + IPAddresses []string + IssuerKey string + IssuerCert string +} +type CreateServicePairResult struct { + Name string + Cert string + Key string +} + +func CreateServicePair(params *CreateServicePairParams) (*CreateServicePairResult, error) { var err error + + var res *CreateServicePairResult + certPem := make([]byte, 0) keyPem := make([]byte, 0) now := time.Now() @@ -127,7 +109,7 @@ func CreateX509Cert(commonName string, caKeyPem []byte, dnsNames ...string) ([]b key, err := rsa.GenerateKey(rand.Reader, keySize) if err != nil { err := fmt.Errorf("Can't create a private key: %v", err) - return certPem, keyPem, err + return res, err } keyPemBlock := pem.Block{ Type: "RSA PRIVATE KEY", @@ -135,25 +117,36 @@ func CreateX509Cert(commonName string, caKeyPem []byte, dnsNames ...string) ([]b } keyPem = pem.EncodeToMemory(&keyPemBlock) + caKeyPem, err := base64.StdEncoding.DecodeString(params.IssuerKey) + if err != nil { + return res, err + } + pemBlock, _ := pem.Decode(caKeyPem) if pemBlock == nil { err := fmt.Errorf("Can't parse a CA private key block") - return certPem, keyPem, err + return res, err } caKey, err := x509.ParsePKCS1PrivateKey(pemBlock.Bytes) if err != nil { err := fmt.Errorf("Can't parse a CA private key") - return certPem, keyPem, err + return res, err } + netAddresses := make([]net.IP, 0) + for _, ipAddress := range params.IPAddresses { + netAddress := net.ParseIP(ipAddress) + netAddresses = append(netAddresses, netAddress) + } tml := x509.Certificate{ SerialNumber: big.NewInt(now.Unix()), NotBefore: now, NotAfter: now.AddDate(yearsAfter, 0, 0), Subject: pkix.Name{ - CommonName: commonName, + CommonName: params.CommonName, }, - DNSNames: append([]string{commonName}, dnsNames...), + DNSNames: params.DNSNames, + IPAddresses: netAddresses, IsCA: false, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, KeyUsage: x509.KeyUsageDigitalSignature, @@ -161,7 +154,7 @@ func CreateX509Cert(commonName string, caKeyPem []byte, dnsNames ...string) ([]b } certBytes, err := x509.CreateCertificate(rand.Reader, &tml, &tml, &key.PublicKey, caKey) if err != nil { - return certPem, keyPem, fmt.Errorf("Can't create a certificate: %v", err) + return res, fmt.Errorf("Can't create a certificate: %v", err) } certPemBlock := pem.Block{ @@ -170,7 +163,9 @@ func CreateX509Cert(commonName string, caKeyPem []byte, dnsNames ...string) ([]b } certPem = pem.EncodeToMemory(&certPemBlock) if err != nil { - return certPem, keyPem, err + return res, err } - return certPem, keyPem, err + res.Cert = base64.StdEncoding.EncodeToString(certPem) + res.Key = base64.StdEncoding.EncodeToString(keyPem) + return res, err } diff --git a/internal/test/Makefile.am b/internal/test/Makefile.am new file mode 100644 index 0000000..4993115 --- /dev/null +++ b/internal/test/Makefile.am @@ -0,0 +1,16 @@ + +all: + +makedir: + test -z $(DESTDIR)$(SRV_LOGDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_LOGDIR) + test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR) + test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR) + + +test: makedir + $(GO) test -v + +clean-local: + rm -f *~ + + diff --git a/internal/test/Makefile.in b/internal/test/Makefile.in new file mode 100644 index 0000000..5d194e1 --- /dev/null +++ b/internal/test/Makefile.in @@ -0,0 +1,426 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = internal/test +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CP = @CP@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUILDPACKAGE = @DBUILDPACKAGE@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ETAGS = @ETAGS@ +GO = @GO@ +HAVE_GO = @HAVE_GO@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROTOC = @PROTOC@ +ROOT_GROUP = @ROOT_GROUP@ +RPMBUILD = @RPMBUILD@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SRV_CONFDIR = @SRV_CONFDIR@ +SRV_DATADIR = @SRV_DATADIR@ +SRV_LOGDIR = @SRV_LOGDIR@ +SRV_RUNDIR = @SRV_RUNDIR@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +srv_confdir = @srv_confdir@ +srv_datadir = @srv_datadir@ +srv_devel_mode = @srv_devel_mode@ +srv_logdir = @srv_logdir@ +srv_name = @srv_name@ +srv_rundir = @srv_rundir@ +srv_sbindir = @srv_sbindir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu internal/test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu internal/test/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-local \ + cscopelist-am ctags-am distclean distclean-generic distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +all: + +makedir: + test -z $(DESTDIR)$(SRV_LOGDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_LOGDIR) + test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR) + test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR) + +test: makedir + $(GO) test -v + +clean-local: + rm -f *~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/internal/test/database_test.go b/internal/test/database_test.go index 7907c60..ba8eec5 100644 --- a/internal/test/database_test.go +++ b/internal/test/database_test.go @@ -14,7 +14,7 @@ import ( yaml "gopkg.in/yaml.v3" ) -func TestDatabaseIssuer(t *testing.T) { +func XXTestDatabaseIssuer(t *testing.T) { var err error conf := config.NewConfig() err = conf.ReadFile() @@ -65,7 +65,7 @@ func TestDatabaseIssuer(t *testing.T) { require.NoError(t, err) } -func TestDatabaseService(t *testing.T) { +func XXXTestDatabaseService(t *testing.T) { var err error conf := config.NewConfig() err = conf.ReadFile() diff --git a/internal/test/logic_test.go b/internal/test/logic_test.go index 813dd53..42c459f 100644 --- a/internal/test/logic_test.go +++ b/internal/test/logic_test.go @@ -2,9 +2,12 @@ package test import ( "context" + "encoding/json" "fmt" "testing" "time" + //"encoding/base64" + "strings" cmapi "certmanager/api/certmanagercontrol" "certmanager/internal/config" @@ -16,35 +19,143 @@ import ( func TestLogicIssuer(t *testing.T) { var err error - conf := config.NewConfig() - err = conf.ReadFile() - require.NoError(t, err) + var lg *logic.Logic + { + conf := config.NewConfig() + err = conf.ReadFile() + require.NoError(t, err) - db, err := database.NewDatabase(conf.DataDir) - require.NoError(t, err) - require.NotNil(t, db) + db, err := database.NewDatabase(conf.DataDir) + require.NoError(t, err) + require.NotNil(t, db) - err = db.InitDatabase() - require.NoError(t, err) + err = db.InitDatabase() + require.NoError(t, err) - logicConfig := &logic.LogicConfig{ - Auths: conf.Auths, - Database: db, + logicConfig := &logic.LogicConfig{ + Auths: conf.Auths, + Database: db, + } + lg, err = logic.NewLogic(logicConfig) + require.NoError(t, err) + require.NotNil(t, lg) } - lg, err := logic.NewLogic(logicConfig) - require.NoError(t, err) - require.NotNil(t, lg) ctx, _ := context.WithTimeout(context.Background(), 1*time.Second) - createIssuerPairParams := &cmapi.CreateIssuerPairParams{ - SelfSigned: true, - IssuerName: "foo.bar", + issuerCommonName := "foo.bar" + var issuerID int64 + + { + createIssuerPairParams := &cmapi.CreateIssuerPairParams{ + IssuerCommonName: issuerCommonName, + } + createIssuerPairRes, err := lg.CreateIssuerPair(ctx, createIssuerPairParams) + require.NoError(t, err) + require.NotNil(t, createIssuerPairRes) + issuerID = createIssuerPairRes.IssuerID + printObj("issuerID", issuerID) + } - createIssuerPairRes, err := lg.CreateIssuerPair(ctx, createIssuerPairParams) - require.NoError(t, err) - require.NotNil(t, createIssuerPairRes) + var issuerCert string + { + getIssuerCertificateParams := &cmapi.GetIssuerCertificateParams{ + IssuerID: issuerID, + } + getIssuerCertificateRes, err := lg.GetIssuerCertificate(ctx, getIssuerCertificateParams) + require.NoError(t, err) + require.NotNil(t, getIssuerCertificateRes) + require.NotZero(t, len(getIssuerCertificateRes.Certificate)) - fmt.Printf("issuerId: %d\n", createIssuerPairRes.IssuerID) + printObj("getIssuerCertificateRes", getIssuerCertificateRes) + require.NoError(t, err) + issuerCert = getIssuerCertificateRes.Certificate + require.NotZero(t, len(issuerCert)) + printObj("issuerCert", string(issuerCert)) + } + { + revokeIssuerPairParams := &cmapi.RevokeIssuerPairParams{ + IssuerID: issuerID, + } + revokeIssuerPairRes, err := lg.RevokeIssuerPair(ctx, revokeIssuerPairParams) + require.NoError(t, err) + require.NotNil(t, revokeIssuerPairRes) + + printObj("revokeIssuerPairRes", revokeIssuerPairRes) + require.NoError(t, err) + } + { + getIssuerCertificateParams := &cmapi.GetIssuerCertificateParams{ + IssuerID: issuerID, + } + getIssuerCertificateRes, err := lg.GetIssuerCertificate(ctx, getIssuerCertificateParams) + require.NoError(t, err) + require.NotNil(t, getIssuerCertificateRes) + require.NotZero(t, len(getIssuerCertificateRes.Certificate)) + require.True(t, getIssuerCertificateRes.Revoked) + + printObj("getIssuerCertificateRes", getIssuerCertificateRes) + } + { + unrevokeIssuerPairParams := &cmapi.UnrevokeIssuerPairParams{ + IssuerID: issuerID, + } + unrevokeIssuerPairRes, err := lg.UnrevokeIssuerPair(ctx, unrevokeIssuerPairParams) + require.NoError(t, err) + require.NotNil(t, unrevokeIssuerPairRes) + + printObj("unrevokeIssuerPairRes", unrevokeIssuerPairRes) + require.NoError(t, err) + } + { + getIssuerCertificateParams := &cmapi.GetIssuerCertificateParams{ + IssuerID: issuerID, + } + getIssuerCertificateRes, err := lg.GetIssuerCertificate(ctx, getIssuerCertificateParams) + require.NoError(t, err) + require.NotNil(t, getIssuerCertificateRes) + require.NotZero(t, len(getIssuerCertificateRes.Certificate)) + require.False(t, getIssuerCertificateRes.Revoked) + + printObj("getIssuerCertificateRes", getIssuerCertificateRes) + } + { + listIssuerPairsParams := &cmapi.ListIssuerPairsParams{} + listIssuerPairsRes, err := lg.ListIssuerPairs(ctx, listIssuerPairsParams) + require.NoError(t, err) + require.NotNil(t, listIssuerPairsRes) + require.NotZero(t, len(listIssuerPairsRes.Issuers)) + + printObj("listIssuerPairRes", listIssuerPairsRes) + } + { + importIssuerPairParams := &cmapi.ImportIssuerPairParams{ + Certificate: issuerCert, + } + importIssuerPairRes, err := lg.ImportIssuerPair(ctx, importIssuerPairParams) + require.NoError(t, err) + require.NotNil(t, importIssuerPairRes) + + printObj("importIssuerPairRes", importIssuerPairRes) + } + { + listIssuerPairsParams := &cmapi.ListIssuerPairsParams{} + listIssuerPairsRes, err := lg.ListIssuerPairs(ctx, listIssuerPairsParams) + require.NoError(t, err) + require.NotNil(t, listIssuerPairsRes) + require.NotZero(t, len(listIssuerPairsRes.Issuers)) + + printObj("listIssuerPairRes", listIssuerPairsRes) + } +} + +func printObj(label string, obj any) { + objBytes, _ := json.MarshalIndent(obj, " ", " ") + objString := string(objBytes) + if strings.Count(objString, "\n") < 2 { + fmt.Printf("==== %s: %s\n", label, objString) + } else { + fmt.Printf("==== %s ::\n %s\n", label, objString) + } } diff --git a/proto/certmanagercontrol.proto b/proto/certmanagercontrol.proto index 163e4a5..555a4a1 100644 --- a/proto/certmanagercontrol.proto +++ b/proto/certmanagercontrol.proto @@ -26,24 +26,37 @@ message getStatusResult { } message createIssuerPairParams { - string issuerName = 1; - string validUntil = 2; - bool selfSigned = 3; - int64 uplevelIssuerID = 4; - string uplevelIssuerName = 5; - + string issuerCommonName = 1; + bool intermediate = 2; + int64 signerIssuerID = 3; + string signerIssuerName = 4; + string validUntil = 5; + string keySize = 6; } message createIssuerPairResult { int64 issuerID = 1; - string caCertificate = 2; + string certificate = 2; } +message getIssuerCertificateParams { + int64 issuerID = 1; + string issuerName = 2; +} +message getIssuerCertificateResult { + string name = 1; + string certificate = 2; + bool revoked = 3; + int64 issuerID = 4; +} + + message importIssuerPairParams { string certificate = 1; string key = 2; } message importIssuerPairResult { int64 issuerID = 1; + string issuerName = 2; } message revokeIssuerPairParams { @@ -61,36 +74,30 @@ message unrevokeIssuerPairResult {} message listIssuerPairsParams {} message listIssuerPairsResult { - repeated IssierShortDescriptor issiers = 1; + repeated IssierShortDescriptor issuers = 1; } message IssierShortDescriptor { int64 issuerID = 1; - string issuerName = 2; + string name = 2; bool revoked = 3; } -message getIssuerCertificateParams { - int64 issuerID = 1; - string issuerName = 2; -} -message getIssuerCertificateResult { - string caCertificate = 1; -} message createServicePairParams { - string issuerName = 1; - int64 issuerID = 2; - string serviceName = 3; - string validUntil = 4; - repeated string hostnames = 5; - repeated string inetAddress = 6; + string issuerName = 1; + int64 issuerID = 2; + string serviceCommonName = 3; + repeated string hostnames = 5; + repeated string inetAddresses = 6; } message createServicePairResult { - int64 servicePairId = 1; - string ca = 2; - string cerificate = 3; - string key = 4; + int64 serviceID = 1; + string name = 2; + string issuerCertificate = 3; + int64 issuerID = 4; + string cerificate = 5; + string key = 6; } message revokeServicePairParams { @@ -111,7 +118,7 @@ message unrevokeServicePairResult {} message ServiceShortDescriptor { int64 serviceID = 1; - string serviceName = 2; + string name = 2; string issuerName = 3; int64 issuerID = 4; bool revoked = 5; @@ -127,6 +134,10 @@ message getServicePairParams { string serviceName = 2; } message getServicePairResult { - string caCertificate = 1; + string name = 1; string certificate = 2; + string key = 3; + int64 issuerID = 4; + string issuerName = 5; + bool revoked = 6; }