diff --git a/Makefile.am b/Makefile.am index 494d9ef..7050152 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,9 @@ certmanagerd$(EXEEXT): $(certmanagerd_SOURCES) $(EXTRA_certmanagerd_SOURCES) certmanagerctl_SOURCES = cmd/certmanagerctl/main.go \ - cmd/certmanagerctl/certman.go + cmd/certmanagerctl/servicecli.go \ + cmd/certmanagerctl/issuercli.go + certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES) diff --git a/Makefile.in b/Makefile.in index 7541c0d..07b4f32 100644 --- a/Makefile.in +++ b/Makefile.in @@ -298,7 +298,8 @@ BUILD = $(shell date -u '+%Y-%m-%d-%H%M') GOFLAGS = -v -ldflags='-s -w -X helmet/certmanager/internal/config.buildVersion=$(BUILD)' certmanagerd_SOURCES = cmd/certmanagerd/main.go certmanagerctl_SOURCES = cmd/certmanagerctl/main.go \ - cmd/certmanagerctl/certman.go + cmd/certmanagerctl/servicecli.go \ + cmd/certmanagerctl/issuercli.go EXTRA_certmanagerd_SOURCES = EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES) @@ -798,6 +799,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS certmanagerd$(EXEEXT): $(certmanagerd_SOURCES) $(EXTRA_certmanagerd_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerd$(EXEEXT) $(certmanagerd_SOURCES) + certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES) env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES) grpc: diff --git a/api/certmanagercontrol/certmanagercontrol.pb.go b/api/certmanagercontrol/certmanagercontrol.pb.go index 111f894..c82e05a 100644 --- a/api/certmanagercontrol/certmanagercontrol.pb.go +++ b/api/certmanagercontrol/certmanagercontrol.pb.go @@ -921,8 +921,9 @@ type CreateServicePairResult struct { ServiceName string `protobuf:"bytes,2,opt,name=serviceName,proto3" json:"serviceName,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"` - Certificate string `protobuf:"bytes,5,opt,name=certificate,proto3" json:"certificate,omitempty"` - Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + IssuerName string `protobuf:"bytes,5,opt,name=issuerName,proto3" json:"issuerName,omitempty"` + Certificate string `protobuf:"bytes,6,opt,name=certificate,proto3" json:"certificate,omitempty"` + Key string `protobuf:"bytes,7,opt,name=key,proto3" json:"key,omitempty"` } func (x *CreateServicePairResult) Reset() { @@ -985,6 +986,13 @@ func (x *CreateServicePairResult) GetIssuerID() int64 { return 0 } +func (x *CreateServicePairResult) GetIssuerName() string { + if x != nil { + return x.IssuerName + } + return "" +} + func (x *CreateServicePairResult) GetCertificate() string { if x != nil { return x.Certificate @@ -1441,12 +1449,13 @@ type GetServicePairResult struct { 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"` - 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"` + 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"` + IssuerCertificate string `protobuf:"bytes,7,opt,name=issuerCertificate,proto3" json:"issuerCertificate,omitempty"` } func (x *GetServicePairResult) Reset() { @@ -1523,6 +1532,13 @@ func (x *GetServicePairResult) GetRevoked() bool { return false } +func (x *GetServicePairResult) GetIssuerCertificate() string { + if x != nil { + return x.IssuerCertificate + } + return "" +} + var File_certmanagercontrol_proto protoreflect.FileDescriptor var file_certmanagercontrol_proto_rawDesc = []byte{ @@ -1622,7 +1638,7 @@ var file_certmanagercontrol_proto_rawDesc = []byte{ 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, 0xd7, 0x01, 0x0a, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x73, 0x73, 0x65, 0x73, 0x22, 0xf7, 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, 0x20, @@ -1632,10 +1648,12 @@ var file_certmanagercontrol_proto_rawDesc = []byte{ 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, 0x20, 0x0a, 0x0b, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 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, 0x20, 0x0a, 0x0b, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x06, 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, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x9b, + 0x6b, 0x65, 0x79, 0x18, 0x07, 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, @@ -1682,7 +1700,7 @@ var file_certmanagercontrol_proto_rawDesc = []byte{ 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, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xe2, 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, @@ -1694,85 +1712,95 @@ var file_certmanagercontrol_proto_rawDesc = []byte{ 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, + 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x32, 0xb4, 0x0a, 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, 0x69, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, + 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, 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, + 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, 0x72, 0x65, 0x76, - 0x6f, 0x6b, 0x65, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, + 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, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, + 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, 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, + 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, 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, + 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, 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, - 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, + 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, 0x75, 0x0a, 0x13, 0x75, 0x6e, + 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, + 0x72, 0x12, 0x2d, 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, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x61, 0x69, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x2d, 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, 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, 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 ( @@ -1828,21 +1856,23 @@ var file_certmanagercontrol_proto_depIdxs = []int32{ 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 - 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 - 25, // 23: certmanagercontrol.Control.getServicePair:output_type -> certmanagercontrol.getServicePairResult - 13, // [13:24] is the sub-list for method output_type - 2, // [2:13] is the sub-list for method input_type + 19, // 11: certmanagercontrol.Control.unrevokeServicePair:input_type -> certmanagercontrol.unrevokeServicePairParams + 22, // 12: certmanagercontrol.Control.listServicePairs:input_type -> certmanagercontrol.listServicePairsParams + 24, // 13: certmanagercontrol.Control.getServicePair:input_type -> certmanagercontrol.getServicePairParams + 1, // 14: certmanagercontrol.Control.getStatus:output_type -> certmanagercontrol.getStatusResult + 3, // 15: certmanagercontrol.Control.createIssuerPair:output_type -> certmanagercontrol.createIssuerPairResult + 7, // 16: certmanagercontrol.Control.importIssuerPair:output_type -> certmanagercontrol.importIssuerPairResult + 9, // 17: certmanagercontrol.Control.revokeIssuerPair:output_type -> certmanagercontrol.revokeIssuerPairResult + 11, // 18: certmanagercontrol.Control.unrevokeIssuerPair:output_type -> certmanagercontrol.unrevokeIssuerPairResult + 13, // 19: certmanagercontrol.Control.listIssuerPairs:output_type -> certmanagercontrol.listIssuerPairsResult + 5, // 20: certmanagercontrol.Control.getIssuerCertificate:output_type -> certmanagercontrol.getIssuerCertificateResult + 16, // 21: certmanagercontrol.Control.createServicePair:output_type -> certmanagercontrol.createServicePairResult + 18, // 22: certmanagercontrol.Control.revokeServicePair:output_type -> certmanagercontrol.revokeServicePairResult + 20, // 23: certmanagercontrol.Control.unrevokeServicePair:output_type -> certmanagercontrol.unrevokeServicePairResult + 23, // 24: certmanagercontrol.Control.listServicePairs:output_type -> certmanagercontrol.listServicePairsResult + 25, // 25: certmanagercontrol.Control.getServicePair:output_type -> certmanagercontrol.getServicePairResult + 14, // [14:26] is the sub-list for method output_type + 2, // [2:14] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name diff --git a/api/certmanagercontrol/certmanagercontrol_grpc.pb.go b/api/certmanagercontrol/certmanagercontrol_grpc.pb.go index cf3c446..0df8015 100644 --- a/api/certmanagercontrol/certmanagercontrol_grpc.pb.go +++ b/api/certmanagercontrol/certmanagercontrol_grpc.pb.go @@ -28,6 +28,7 @@ const ( Control_GetIssuerCertificate_FullMethodName = "/certmanagercontrol.Control/getIssuerCertificate" Control_CreateServicePair_FullMethodName = "/certmanagercontrol.Control/createServicePair" Control_RevokeServicePair_FullMethodName = "/certmanagercontrol.Control/revokeServicePair" + Control_UnrevokeServicePair_FullMethodName = "/certmanagercontrol.Control/unrevokeServicePair" Control_ListServicePairs_FullMethodName = "/certmanagercontrol.Control/listServicePairs" Control_GetServicePair_FullMethodName = "/certmanagercontrol.Control/getServicePair" ) @@ -45,6 +46,7 @@ type ControlClient interface { GetIssuerCertificate(ctx context.Context, in *GetIssuerCertificateParams, opts ...grpc.CallOption) (*GetIssuerCertificateResult, error) CreateServicePair(ctx context.Context, in *CreateServicePairParams, opts ...grpc.CallOption) (*CreateServicePairResult, error) RevokeServicePair(ctx context.Context, in *RevokeServicePairParams, opts ...grpc.CallOption) (*RevokeServicePairResult, error) + UnrevokeServicePair(ctx context.Context, in *UnrevokeServicePairParams, opts ...grpc.CallOption) (*UnrevokeServicePairResult, error) ListServicePairs(ctx context.Context, in *ListServicePairsParams, opts ...grpc.CallOption) (*ListServicePairsResult, error) GetServicePair(ctx context.Context, in *GetServicePairParams, opts ...grpc.CallOption) (*GetServicePairResult, error) } @@ -138,6 +140,15 @@ func (c *controlClient) RevokeServicePair(ctx context.Context, in *RevokeService return out, nil } +func (c *controlClient) UnrevokeServicePair(ctx context.Context, in *UnrevokeServicePairParams, opts ...grpc.CallOption) (*UnrevokeServicePairResult, error) { + out := new(UnrevokeServicePairResult) + err := c.cc.Invoke(ctx, Control_UnrevokeServicePair_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *controlClient) ListServicePairs(ctx context.Context, in *ListServicePairsParams, opts ...grpc.CallOption) (*ListServicePairsResult, error) { out := new(ListServicePairsResult) err := c.cc.Invoke(ctx, Control_ListServicePairs_FullMethodName, in, out, opts...) @@ -169,6 +180,7 @@ type ControlServer interface { GetIssuerCertificate(context.Context, *GetIssuerCertificateParams) (*GetIssuerCertificateResult, error) CreateServicePair(context.Context, *CreateServicePairParams) (*CreateServicePairResult, error) RevokeServicePair(context.Context, *RevokeServicePairParams) (*RevokeServicePairResult, error) + UnrevokeServicePair(context.Context, *UnrevokeServicePairParams) (*UnrevokeServicePairResult, error) ListServicePairs(context.Context, *ListServicePairsParams) (*ListServicePairsResult, error) GetServicePair(context.Context, *GetServicePairParams) (*GetServicePairResult, error) mustEmbedUnimplementedControlServer() @@ -205,6 +217,9 @@ func (UnimplementedControlServer) CreateServicePair(context.Context, *CreateServ func (UnimplementedControlServer) RevokeServicePair(context.Context, *RevokeServicePairParams) (*RevokeServicePairResult, error) { return nil, status.Errorf(codes.Unimplemented, "method RevokeServicePair not implemented") } +func (UnimplementedControlServer) UnrevokeServicePair(context.Context, *UnrevokeServicePairParams) (*UnrevokeServicePairResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnrevokeServicePair not implemented") +} func (UnimplementedControlServer) ListServicePairs(context.Context, *ListServicePairsParams) (*ListServicePairsResult, error) { return nil, status.Errorf(codes.Unimplemented, "method ListServicePairs not implemented") } @@ -386,6 +401,24 @@ func _Control_RevokeServicePair_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _Control_UnrevokeServicePair_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnrevokeServicePairParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ControlServer).UnrevokeServicePair(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Control_UnrevokeServicePair_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ControlServer).UnrevokeServicePair(ctx, req.(*UnrevokeServicePairParams)) + } + return interceptor(ctx, in, info, handler) +} + func _Control_ListServicePairs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListServicePairsParams) if err := dec(in); err != nil { @@ -465,6 +498,10 @@ var Control_ServiceDesc = grpc.ServiceDesc{ MethodName: "revokeServicePair", Handler: _Control_RevokeServicePair_Handler, }, + { + MethodName: "unrevokeServicePair", + Handler: _Control_UnrevokeServicePair_Handler, + }, { MethodName: "listServicePairs", Handler: _Control_ListServicePairs_Handler, diff --git a/cmd/certmanagerctl/issuercli.go b/cmd/certmanagerctl/issuercli.go index 6e6ed75..f87a9cb 100644 --- a/cmd/certmanagerctl/issuercli.go +++ b/cmd/certmanagerctl/issuercli.go @@ -24,6 +24,12 @@ func (util *Util) CreateIssuerPair(ctx context.Context) (*cmapi.CreateIssuerPair if err != nil { return res, err } + certPEM, err := base64.StdEncoding.DecodeString(res.Certificate) + if err != nil { + return res, err + } + res.Certificate = string(certPEM) + return res, err } diff --git a/cmd/certmanagerctl/main.go b/cmd/certmanagerctl/main.go index d73fa52..d4b8268 100644 --- a/cmd/certmanagerctl/main.go +++ b/cmd/certmanagerctl/main.go @@ -36,6 +36,7 @@ const ( getIssuerCertificateCmd = "getIssuerCertificate" createServicePairCmd = "createServicePair" revokeServicePairCmd = "revokeServicePair" + unrevokeServicePairCmd = "unrevokeServicePair" listServicePairsCmd = "listServicePairs" getServicePairCmd = "getServicePair" ) @@ -56,20 +57,19 @@ type Util struct { access client.Access cont *cmapi.ControlClient - caFilenamesList string - certFilename string - hostnameList string - ipAdressesList string - issuerCommonName string - issuerID int64 - issuerName string - keyFilename string - - signerID int64 - signerName string - - serviceID int64 - serviceName string + caFilenamesList string + certFilename string + hostnameList string + ipAdressesList string + issuerCommonName string + issuerID int64 + issuerName string + keyFilename string + signerID int64 + signerName string + serviceCommonName string + serviceID int64 + serviceName string } func NewUtil() *Util { @@ -260,6 +260,13 @@ func (util *Util) GetOpt() error { case createServicePairCmd: flagSet := flag.NewFlagSet(createServicePairCmd, flag.ExitOnError) + flagSet.StringVar(&util.issuerCommonName, "cn", util.issuerCommonName, "new service canonic name") + flagSet.StringVar(&util.issuerName, "issuerName", util.issuerName, "issuer name") + flagSet.Int64Var(&util.issuerID, "issuerID", util.issuerID, "issuer ID") + + flagSet.StringVar(&util.ipAdressesList, "addresses", util.ipAdressesList, "comma separated IP address list") + flagSet.StringVar(&util.hostnameList, "hostnames", util.hostnameList, "comma separated hostname list") + flagSet.Usage = func() { fmt.Printf("\n") fmt.Printf("Usage: %s [global options] %s [command options]\n", exeName, subCmd) @@ -274,6 +281,26 @@ func (util *Util) GetOpt() error { case revokeServicePairCmd: flagSet := flag.NewFlagSet(revokeServicePairCmd, flag.ExitOnError) + flagSet.StringVar(&util.serviceName, "serviceName", util.serviceName, "service name") + flagSet.Int64Var(&util.serviceID, "serviceID", util.serviceID, "service ID") + + flagSet.Usage = func() { + fmt.Printf("\n") + fmt.Printf("Usage: %s [global options] %s [command options]\n", exeName, subCmd) + fmt.Printf("\n") + fmt.Printf("The command options: none\n") + flagSet.PrintDefaults() + fmt.Printf("\n") + } + flagSet.Parse(subArgs) + util.subCmd = subCmd + + case unrevokeServicePairCmd: + flagSet := flag.NewFlagSet(unrevokeServicePairCmd, flag.ExitOnError) + + flagSet.StringVar(&util.serviceName, "serviceName", util.serviceName, "service name") + flagSet.Int64Var(&util.serviceID, "serviceID", util.serviceID, "service ID") + flagSet.Usage = func() { fmt.Printf("\n") fmt.Printf("Usage: %s [global options] %s [command options]\n", exeName, subCmd) @@ -302,6 +329,9 @@ func (util *Util) GetOpt() error { case getServicePairCmd: flagSet := flag.NewFlagSet(getServicePairCmd, flag.ExitOnError) + flagSet.StringVar(&util.serviceName, "serviceName", util.serviceName, "service name") + flagSet.Int64Var(&util.serviceID, "serviceID", util.serviceID, "service ID") + flagSet.Usage = func() { fmt.Printf("\n") fmt.Printf("Usage: %s [global options] %s [command options]\n", exeName, subCmd) @@ -312,7 +342,6 @@ func (util *Util) GetOpt() error { } flagSet.Parse(subArgs) util.subCmd = subCmd - default: help() return errors.New("Unknown command") @@ -356,12 +385,13 @@ func (util *Util) Exec() error { case createServicePairCmd: res, err = util.CreateServicePair(ctx) case revokeServicePairCmd: - res, err = util.CreateServicePair(ctx) + res, err = util.RevokeServicePair(ctx) + case unrevokeServicePairCmd: + res, err = util.UnrevokeServicePair(ctx) case listServicePairsCmd: res, err = util.ListServicePairs(ctx) case getServicePairCmd: res, err = util.GetServicePair(ctx) - default: err = errors.New("Unknown cli command") } diff --git a/cmd/certmanagerctl/servicecli.go b/cmd/certmanagerctl/servicecli.go index 6964761..35e65e6 100644 --- a/cmd/certmanagerctl/servicecli.go +++ b/cmd/certmanagerctl/servicecli.go @@ -2,6 +2,8 @@ package main import ( "context" + "encoding/base64" + "strings" cmapi "certmanager/api/certmanagercontrol" "certmanager/pkg/client" @@ -14,11 +16,35 @@ func (util *Util) CreateServicePair(ctx context.Context) (*cmapi.CreateServicePa if err != nil { return res, err } - params := &cmapi.CreateServicePairParams{} + inetAddresses := strings.Split(util.ipAdressesList, ",") + hostnames := strings.Split(util.hostnameList, ",") + + params := &cmapi.CreateServicePairParams{ + IssuerName: util.issuerName, + IssuerID: util.issuerID, + ServiceCommonName: util.serviceCommonName, + InetAddresses: inetAddresses, + Hostnames: hostnames, + } res, err = cli.CreateServicePair(ctx, params) if err != nil { return res, err } + certPEM, err := base64.StdEncoding.DecodeString(res.Certificate) + if err != nil { + return res, err + } + res.Certificate = string(certPEM) + keyPEM, err := base64.StdEncoding.DecodeString(res.Key) + if err != nil { + return res, err + } + res.Key = string(keyPEM) + caPEM, err := base64.StdEncoding.DecodeString(res.IssuerCertificate) + if err != nil { + return res, err + } + res.IssuerCertificate = string(caPEM) return res, err } @@ -29,7 +55,10 @@ func (util *Util) RevokeServicePair(ctx context.Context) (*cmapi.RevokeServicePa if err != nil { return res, err } - params := &cmapi.RevokeServicePairParams{} + params := &cmapi.RevokeServicePairParams{ + ServiceName: util.serviceName, + ServiceID: util.serviceID, + } res, err = cli.RevokeServicePair(ctx, params) if err != nil { return res, err @@ -37,6 +66,24 @@ func (util *Util) RevokeServicePair(ctx context.Context) (*cmapi.RevokeServicePa return res, err } +func (util *Util) UnrevokeServicePair(ctx context.Context) (*cmapi.UnrevokeServicePairResult, error) { + var err error + res := &cmapi.UnrevokeServicePairResult{} + cli, err := client.NewClient(&util.access) + if err != nil { + return res, err + } + params := &cmapi.UnrevokeServicePairParams{ + ServiceName: util.serviceName, + ServiceID: util.serviceID, + } + res, err = cli.UnrevokeServicePair(ctx, params) + if err != nil { + return res, err + } + return res, err +} + func (util *Util) ListServicePairs(ctx context.Context) (*cmapi.ListServicePairsResult, error) { var err error res := &cmapi.ListServicePairsResult{} @@ -59,10 +106,28 @@ func (util *Util) GetServicePair(ctx context.Context) (*cmapi.GetServicePairResu if err != nil { return res, err } - params := &cmapi.GetServicePairParams{} + params := &cmapi.GetServicePairParams{ + ServiceID: util.serviceID, + ServiceName: util.serviceName, + } res, err = cli.GetServicePair(ctx, params) if err != nil { return res, err } + certPEM, err := base64.StdEncoding.DecodeString(res.Certificate) + if err != nil { + return res, err + } + res.Certificate = string(certPEM) + keyPEM, err := base64.StdEncoding.DecodeString(res.Key) + if err != nil { + return res, err + } + res.Key = string(keyPEM) + caPEM, err := base64.StdEncoding.DecodeString(res.IssuerCertificate) + if err != nil { + return res, err + } + res.IssuerCertificate = string(caPEM) return res, err } diff --git a/internal/database/database.go b/internal/database/database.go index ebb3c3b..ee19964 100644 --- a/internal/database/database.go +++ b/internal/database/database.go @@ -10,7 +10,7 @@ import ( ) const schema = ` - DROP TABLE IF EXISTS issuer; + --- DROP TABLE IF EXISTS issuer; CREATE TABLE IF NOT EXISTS issuer ( id INT NOT NULL, name TEXT NOT NULL, @@ -21,10 +21,11 @@ const schema = ` CREATE INDEX IF NOT EXISTS issuer_index ON issuer(id, name); - DROP TABLE IF EXISTS service; + --- DROP TABLE IF EXISTS service; CREATE TABLE IF NOT EXISTS service ( id INT NOT NULL, issuer_id INT NOT NULL, + issuer_name TEXT NOT NULL, name TEXT NOT NULL, cert TEXT NOT NULL, key TEXT NOT NULL, diff --git a/internal/database/service.go b/internal/database/service.go index b8f805b..4b285f7 100644 --- a/internal/database/service.go +++ b/internal/database/service.go @@ -13,10 +13,10 @@ func (db *Database) InsertService(ctx context.Context, service *descriptor.Servi var err error var res int64 service.ID = auxid.GenID() - request := `INSERT INTO service(id, issuer_id, name, cert, key, revoked) - VALUES ($1, $2, $3, $4, $5, $6)` + request := `INSERT INTO service(id, issuer_id, name, cert, key, revoked, issuer_name) + VALUES ($1, $2, $3, $4, $5, $6, $7)` _, err = db.db.Exec(request, service.ID, service.IssuerID, service.Name, service.Cert, - service.Key, service.Revoked) + service.Key, service.Revoked, service.IssuerName) if err != nil { return res, err } @@ -36,7 +36,7 @@ func (db *Database) UpdateServiceByID(ctx context.Context, serviceID int64, serv func (db *Database) ListServices(ctx context.Context) ([]descriptor.Service, error) { var err error - request := `SELECT id, name, revoked FROM service` + request := `SELECT * FROM service` res := make([]descriptor.Service, 0) err = db.db.Select(&res, request) if err != nil { @@ -49,7 +49,7 @@ func (db *Database) GetServiceByID(ctx context.Context, serviceID int64) (bool, var err error var res *descriptor.Service var exists bool - request := `SELECT id, name, cert, key, revoked FROM service WHERE id = $1 LiMIT 1` + request := `SELECT id, name, cert, key, revoked, issuer_id, issuer_name FROM service WHERE id = $1 LIMIT 1` dbRes := make([]descriptor.Service, 0) err = db.db.Select(&dbRes, request, serviceID) if err != nil { @@ -67,7 +67,7 @@ func (db *Database) GetServiceByName(ctx context.Context, serviceName string) (b var err error var res *descriptor.Service var exists bool - request := `SELECT id, name, cert, key, revoked FROM service WHERE name = $1 LIMIT 1` + request := `SELECT id, name, cert, key, revoked, issuer_id, issuer_name FROM service WHERE name = $1 LIMIT 1` dbRes := make([]descriptor.Service, 0) err = db.db.Select(&dbRes, request, serviceName) if err != nil { @@ -81,7 +81,7 @@ func (db *Database) GetServiceByName(ctx context.Context, serviceName string) (b return exists, res, err } -func (db *Database) DeleteServiceByID(ctx context.Context, serviceID int64) error { +func (db *Database) XXXDeleteServiceByID(ctx context.Context, serviceID int64) error { var err error request := `DELETE FROM service WHERE id = $1` _, err = db.db.Exec(request, serviceID) @@ -91,7 +91,7 @@ func (db *Database) DeleteServiceByID(ctx context.Context, serviceID int64) erro return err } -func (db *Database) DeleteServiceByName(ctx context.Context, serviceName string) error { +func (db *Database) XXXDeleteServiceByName(ctx context.Context, serviceName string) error { var err error request := `DELETE FROM service WHERE name = $1` _, err = db.db.Exec(request, serviceName) diff --git a/internal/logic/service.go b/internal/logic/service.go index c342f7d..ceaccb2 100644 --- a/internal/logic/service.go +++ b/internal/logic/service.go @@ -19,7 +19,7 @@ func (lg *Logic) CreateServicePair(ctx context.Context, params *cmapi.CreateServ case params.IssuerID != 0: issuerExists, issuerDescr, err = lg.db.GetIssuerByID(ctx, params.IssuerID) if !issuerExists { - err := fmt.Errorf("No signer with id was found", params.IssuerID) + err := fmt.Errorf("No signer with id %d was found", params.IssuerID) if err != nil { return res, err } @@ -33,7 +33,7 @@ func (lg *Logic) CreateServicePair(ctx context.Context, params *cmapi.CreateServ } } default: - err := fmt.Errorf("Issuer ID or name is not specified") + err := fmt.Errorf("Issuer id or name is not specified") if err != nil { return res, err } @@ -79,6 +79,7 @@ func (lg *Logic) CreateServicePair(ctx context.Context, params *cmapi.CreateServ res.Certificate = createSericePairRes.Cert res.Key = createSericePairRes.Key res.IssuerID = issuerDescr.ID + res.IssuerName = issuerDescr.Name res.IssuerCertificate = issuerDescr.Cert return res, err } @@ -92,7 +93,7 @@ func (lg *Logic) GetServicePair(ctx context.Context, params *cmapi.GetServicePai 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") + err := fmt.Errorf("No service was found for id %d", params.ServiceID) if err != nil { return res, err } @@ -100,7 +101,7 @@ func (lg *Logic) GetServicePair(ctx context.Context, params *cmapi.GetServicePai 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") + err := fmt.Errorf("No service was found for name %s", params.ServiceName) if err != nil { return res, err } @@ -117,11 +118,21 @@ func (lg *Logic) GetServicePair(ctx context.Context, params *cmapi.GetServicePai return res, err } } + + issuerExists, issuerDescr, err := lg.db.GetIssuerByID(ctx, serviceDescr.IssuerID) + if !issuerExists { + err := fmt.Errorf("No issuer for serice was found") + 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 + res.IssuerCertificate = issuerDescr.Cert return res, err } diff --git a/proto/certmanagercontrol.proto b/proto/certmanagercontrol.proto index c59fb0f..7665fcf 100644 --- a/proto/certmanagercontrol.proto +++ b/proto/certmanagercontrol.proto @@ -16,6 +16,7 @@ service Control { rpc createServicePair(createServicePairParams) returns (createServicePairResult) {}; rpc revokeServicePair(revokeServicePairParams) returns (revokeServicePairResult) {}; + rpc unrevokeServicePair(unrevokeServicePairParams) returns (unrevokeServicePairResult) {}; rpc listServicePairs(listServicePairsParams) returns (listServicePairsResult) {}; rpc getServicePair(getServicePairParams) returns (getServicePairResult) {}; } @@ -69,7 +70,6 @@ message revokeIssuerPairResult {} message unrevokeIssuerPairParams { int64 issuerID = 1; string issuerName = 2; - } message unrevokeIssuerPairResult {} @@ -97,8 +97,9 @@ message createServicePairResult { string serviceName = 2; string issuerCertificate = 3; int64 issuerID = 4; - string certificate = 5; - string key = 6; + string issuerName = 5; + string certificate = 6; + string key = 7; } message revokeServicePairParams { @@ -141,4 +142,6 @@ message getServicePairResult { int64 issuerID = 4; string issuerName = 5; bool revoked = 6; + string issuerCertificate = 7; + }