aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceK8sExternalProvider/src
diff options
context:
space:
mode:
authorRemigiusz Janeczek <remigiusz.janeczek@nokia.com>2020-10-22 09:18:12 +0200
committerRemigiusz Janeczek <remigiusz.janeczek@nokia.com>2020-10-22 16:00:36 +0000
commitee23e5f54f96807b1f1fff0b45238a247d3dd8e0 (patch)
treeec390b860e0c10810bd778a1b68dbfc8ab12c64a /certServiceK8sExternalProvider/src
parentaa23960c5d444dea307e0934b446f12ab0256689 (diff)
[OOM-K8S-CERT-EXTERNAL-PROVIDER] Add client for CertService API
Issue-ID: OOM-2559 Signed-off-by: Remigiusz Janeczek <remigiusz.janeczek@nokia.com> Change-Id: I3bf6c36b9eec7a661202b18eb7765e332ccfbc07
Diffstat (limited to 'certServiceK8sExternalProvider/src')
-rw-r--r--certServiceK8sExternalProvider/src/certserviceclient/cert_service_client.go73
-rw-r--r--certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory.go74
-rw-r--r--certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory_test.go95
-rw-r--r--certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_test.go101
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go29
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner.go39
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory.go15
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory_test.go29
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_test.go54
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_signed.pem (renamed from certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_signed.pem)0
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_trusted.pem (renamed from certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_trusted.pem)0
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate.pem (renamed from certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate.pem)0
-rw-r--r--certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate_request.pem (renamed from certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate_request.pem)0
-rw-r--r--certServiceK8sExternalProvider/src/testdata/constants.go12
14 files changed, 460 insertions, 61 deletions
diff --git a/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client.go b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client.go
new file mode 100644
index 00000000..870a3eda
--- /dev/null
+++ b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client.go
@@ -0,0 +1,73 @@
+/*
+ * ============LICENSE_START=======================================================
+ * oom-certservice-k8s-external-provider
+ * ================================================================================
+ * Copyright (C) 2020 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package certserviceclient
+
+import (
+ "encoding/base64"
+ "encoding/json"
+ "net/http"
+)
+
+const (
+ CsrHeaderName = "CSR"
+ PkHeaderName = "PK"
+)
+
+type CertServiceClient interface {
+ GetCertificates(csr []byte, key []byte) (*CertificatesResponse, error)
+}
+
+type CertServiceClientImpl struct {
+ certificationUrl string
+ httpClient HTTPClient
+}
+
+type HTTPClient interface {
+ Do(req *http.Request) (*http.Response, error)
+}
+
+type CertificatesResponse struct {
+ CertificateChain []string `json:"certificateChain"`
+ TrustedCertificates []string `json:"trustedCertificates"`
+}
+
+func (client *CertServiceClientImpl) GetCertificates(csr []byte, key []byte) (*CertificatesResponse, error) {
+
+ request, err := http.NewRequest("GET", client.certificationUrl, nil)
+ if err != nil {
+ return nil, err
+ }
+
+ request.Header.Add(CsrHeaderName, base64.StdEncoding.EncodeToString(csr))
+ request.Header.Add(PkHeaderName, base64.StdEncoding.EncodeToString(key))
+ response, err := client.httpClient.Do(request)
+ if err != nil {
+ return nil, err
+ }
+
+ var certificatesResponse CertificatesResponse
+ err = json.NewDecoder(response.Body).Decode(&certificatesResponse)
+ if err != nil {
+ return nil, err
+ }
+
+ return &certificatesResponse, err
+}
diff --git a/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory.go b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory.go
new file mode 100644
index 00000000..198f2294
--- /dev/null
+++ b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory.go
@@ -0,0 +1,74 @@
+/*
+ * ============LICENSE_START=======================================================
+ * oom-certservice-k8s-external-provider
+ * ================================================================================
+ * Copyright (C) 2020 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package certserviceclient
+
+import (
+ "crypto/tls"
+ "crypto/x509"
+ "fmt"
+ "net/http"
+ "net/url"
+ "path"
+)
+
+func CreateCertServiceClient(baseUrl string, caName string, keyPemBase64 []byte, certPemBase64 []byte, cacertPemBase64 []byte) (*CertServiceClientImpl, error) {
+ cert, err := tls.X509KeyPair(certPemBase64, keyPemBase64)
+ if err != nil {
+ return nil, err
+ }
+ x509.NewCertPool()
+ caCertPool := x509.NewCertPool()
+ ok := caCertPool.AppendCertsFromPEM(cacertPemBase64)
+ if !ok {
+ return nil, fmt.Errorf("couldn't certs from cacert")
+ }
+ httpClient := &http.Client{
+ Transport: &http.Transport{
+ TLSClientConfig: &tls.Config{
+ RootCAs: caCertPool,
+ Certificates: []tls.Certificate{cert},
+ },
+ },
+ }
+ certificationUrl, err := parseUrl(baseUrl, caName)
+ if err != nil {
+ return nil, err
+ }
+ client := CertServiceClientImpl{
+ certificationUrl: certificationUrl.String(),
+ httpClient: httpClient,
+ }
+
+ return &client, nil
+}
+
+func parseUrl(baseUrl string, caName string) (*url.URL, error) {
+ parsedUrl, err := url.Parse(baseUrl)
+ if err != nil {
+ return nil, err
+ }
+ if caName == "" {
+ return nil, fmt.Errorf("caName cannot be empty")
+ }
+
+ parsedUrl.Path = path.Join(parsedUrl.Path, caName)
+ return parsedUrl, nil
+}
diff --git a/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory_test.go b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory_test.go
new file mode 100644
index 00000000..50a6d796
--- /dev/null
+++ b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_factory_test.go
@@ -0,0 +1,95 @@
+/*
+ * ============LICENSE_START=======================================================
+ * oom-certservice-k8s-external-provider
+ * ================================================================================
+ * Copyright (C) 2020 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package certserviceclient
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "onap.org/oom-certservice/k8s-external-provider/src/testdata"
+)
+
+const (
+ validUrl = "https://oom-cert-service:8443/v1/certificate/"
+ validUrl2 = "https://oom-cert-service:8443/v1/certificate"
+ invalidUrl = "https://oom-cert service:8443/v1/certificate"
+ caName = "RA"
+ expectedCertificationUrl = "https://oom-cert-service:8443/v1/certificate/RA"
+)
+
+func Test_shouldCreateCertServiceClient(t *testing.T) {
+ shouldCreateCertServiceClientWithExpectedUrl(t, expectedCertificationUrl, validUrl)
+ shouldCreateCertServiceClientWithExpectedUrl(t, expectedCertificationUrl, validUrl2)
+}
+
+func shouldCreateCertServiceClientWithExpectedUrl(t *testing.T, expectedCertificationUrl string, baseUrl string) {
+ client, err := CreateCertServiceClient(baseUrl, caName, testdata.KeyBytes, testdata.CertBytes, testdata.CacertBytes)
+
+ assert.NotNil(t, client)
+ assert.Nil(t, err)
+ assert.Equal(t, expectedCertificationUrl, client.certificationUrl)
+}
+
+func Test_shouldReturnError_whenUrlInvalid(t *testing.T) {
+ client, err := CreateCertServiceClient(invalidUrl, caName, testdata.KeyBytes, testdata.CertBytes, testdata.CacertBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenCanameEmpty(t *testing.T) {
+ client, err := CreateCertServiceClient(validUrl, "", testdata.KeyBytes, testdata.CertBytes, testdata.CacertBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenKeyNotMatchingCert(t *testing.T) {
+ client, err := CreateCertServiceClient(validUrl, caName, testdata.NotMatchingKeyBytes, testdata.CertBytes, testdata.CacertBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenKeyInvalid(t *testing.T) {
+ //Cert used as key
+ client, err := CreateCertServiceClient(validUrl, caName, testdata.CertBytes, testdata.CertBytes, testdata.CacertBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenCertInvalid(t *testing.T) {
+ //Cacert used as cert
+ client, err := CreateCertServiceClient(validUrl, caName, testdata.KeyBytes, testdata.CacertBytes, testdata.CacertBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenCacertInvalid(t *testing.T) {
+ //Key used as cacert
+ client, err := CreateCertServiceClient(validUrl, caName, testdata.KeyBytes, testdata.CertBytes, testdata.KeyBytes)
+
+ assert.Nil(t, client)
+ assert.Error(t, err)
+}
diff --git a/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_test.go b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_test.go
new file mode 100644
index 00000000..1e15d43e
--- /dev/null
+++ b/certServiceK8sExternalProvider/src/certserviceclient/cert_service_client_test.go
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START=======================================================
+ * oom-certservice-k8s-external-provider
+ * ================================================================================
+ * Copyright (C) 2020 Nokia. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package certserviceclient
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "onap.org/oom-certservice/k8s-external-provider/src/testdata"
+)
+
+const (
+ certificationUrl = "https://oom-cert-service:8443/v1/certificate/RA"
+)
+
+
+func Test_shouldParseCertificateResponseCorrectly(t *testing.T) {
+ responseJson := `{"certificateChain": ["cert-0", "cert-1"], "trustedCertificates": ["trusted-cert-0", "trusted-cert-1"]}`
+ responseJsonReader := ioutil.NopCloser(bytes.NewReader([]byte(responseJson)))
+ client := CertServiceClientImpl{
+ certificationUrl: certificationUrl,
+ httpClient: &httpClientMock{
+ DoFunc: func(req *http.Request) (response *http.Response, e error) {
+ mockedResponse := &http.Response{
+ Body: responseJsonReader,
+ }
+ return mockedResponse, nil
+ },
+ },
+ }
+ response, _ := client.GetCertificates(testdata.CsrBytes, testdata.PkBytes)
+ assert.ElementsMatch(t, []string{"cert-0", "cert-1"}, response.CertificateChain)
+ assert.ElementsMatch(t, []string{"trusted-cert-0", "trusted-cert-1"}, response.TrustedCertificates)
+}
+
+func Test_shouldReturnError_whenResponseIsNotJson(t *testing.T) {
+ responseJson := `not a json`
+ responseJsonReader := ioutil.NopCloser(bytes.NewReader([]byte(responseJson)))
+ client := CertServiceClientImpl{
+ certificationUrl: certificationUrl,
+ httpClient: &httpClientMock{
+ DoFunc: func(req *http.Request) (response *http.Response, e error) {
+ mockedResponse := &http.Response{
+ Body: responseJsonReader,
+ }
+ return mockedResponse, nil
+ },
+ },
+ }
+ response, err := client.GetCertificates(testdata.CsrBytes, testdata.PkBytes)
+
+ assert.Nil(t, response)
+ assert.Error(t, err)
+}
+
+func Test_shouldReturnError_whenHttpClientReturnsError(t *testing.T) {
+ client := CertServiceClientImpl{
+ certificationUrl: certificationUrl,
+ httpClient: &httpClientMock{
+ DoFunc: func(req *http.Request) (response *http.Response, err error) {
+ return nil, fmt.Errorf("mock error")
+ },
+ },
+ }
+ response, err := client.GetCertificates(testdata.CsrBytes, testdata.PkBytes)
+
+ assert.Nil(t, response)
+ assert.Error(t, err)
+}
+
+
+type httpClientMock struct {
+ DoFunc func(*http.Request) (*http.Response, error)
+}
+
+func (client httpClientMock) Do(req *http.Request) (*http.Response, error) {
+ return client.DoFunc(req)
+}
diff --git a/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go b/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go
index 54b4b103..d526bbc8 100644
--- a/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go
+++ b/certServiceK8sExternalProvider/src/cmpv2controller/certificate_request_controller.go
@@ -44,6 +44,11 @@ import (
provisioners "onap.org/oom-certservice/k8s-external-provider/src/cmpv2provisioner"
)
+const (
+ privateKeySecretNameAnnotation = "cert-manager.io/private-key-secret-name"
+ privateKeySecretKey = "tls.key"
+)
+
// CertificateRequestController reconciles a CMPv2Issuer object.
type CertificateRequestController struct {
client.Client
@@ -104,14 +109,27 @@ func (controller *CertificateRequestController) Reconcile(k8sRequest ctrl.Reques
return ctrl.Result{}, err
}
- // 7. Sign CertificateRequest
- signedPEM, trustedCAs, err := provisioner.Sign(ctx, certificateRequest)
+ // 7. Get private key matching CertificateRequest
+ privateKeySecretName := certificateRequest.ObjectMeta.Annotations[privateKeySecretNameAnnotation]
+ privateKeySecretNamespaceName := types.NamespacedName{
+ Namespace: k8sRequest.Namespace,
+ Name: privateKeySecretName,
+ }
+ var privateKeySecret core.Secret
+ if err := controller.Client.Get(ctx, privateKeySecretNamespaceName, &privateKeySecret); err != nil {
+ controller.handleErrorGettingPrivateKey(ctx, log, err, certificateRequest, privateKeySecretNamespaceName)
+ return ctrl.Result{}, err
+ }
+ privateKeyBytes := privateKeySecret.Data[privateKeySecretKey]
+
+ // 8. Sign CertificateRequest
+ signedPEM, trustedCAs, err := provisioner.Sign(ctx, certificateRequest, privateKeyBytes)
if err != nil {
controller.handleErrorFailedToSignCertificate(ctx, log, err, certificateRequest)
return ctrl.Result{}, err
}
- // 8. Store signed certificates in CertificateRequest
+ // 9. Store signed certificates in CertificateRequest
certificateRequest.Status.Certificate = signedPEM
certificateRequest.Status.CA = trustedCAs
if err := controller.updateCertificateRequestWithSignedCerficates(ctx, certificateRequest); err != nil {
@@ -188,6 +206,11 @@ func (controller *CertificateRequestController) handleErrorGettingCMPv2Issuer(ct
_ = controller.setStatus(ctx, certificateRequest, cmmeta.ConditionFalse, cmapi.CertificateRequestReasonPending, "Failed to retrieve CMPv2Issuer resource %s: %v", issuerNamespaceName, err)
}
+func (controller *CertificateRequestController) handleErrorGettingPrivateKey(ctx context.Context, log logr.Logger, err error, certificateRequest *cmapi.CertificateRequest, pkSecretNamespacedName types.NamespacedName) {
+ log.Error(err, "Failed to retrieve private key secret for certificate request", "namespace", pkSecretNamespacedName.Namespace, "name", pkSecretNamespacedName.Name)
+ _ = controller.setStatus(ctx, certificateRequest, cmmeta.ConditionFalse, cmapi.CertificateRequestReasonPending, "Failed to retrieve private key secret: %v", err)
+}
+
func (controller *CertificateRequestController) handleErrorFailedToSignCertificate(ctx context.Context, log logr.Logger, err error, certificateRequest *cmapi.CertificateRequest) {
log.Error(err, "Failed to sign certificate request")
_ = controller.setStatus(ctx, certificateRequest, cmmeta.ConditionFalse, cmapi.CertificateRequestReasonFailed, "Failed to sign certificate request: %v", err)
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner.go b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner.go
index e48b527d..67d719cc 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner.go
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner.go
@@ -38,33 +38,29 @@ import (
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
+ "onap.org/oom-certservice/k8s-external-provider/src/certserviceclient"
"onap.org/oom-certservice/k8s-external-provider/src/cmpv2api"
)
var collection = new(sync.Map)
type CertServiceCA struct {
- name string
- url string
- caName string
- key []byte
- cert []byte
- cacert []byte
+ name string
+ url string
+ caName string
+ certServiceClient certserviceclient.CertServiceClient
}
-func New(cmpv2Issuer *cmpv2api.CMPv2Issuer, key []byte, cert []byte, cacert []byte) (*CertServiceCA, error) {
+func New(cmpv2Issuer *cmpv2api.CMPv2Issuer, certServiceClient certserviceclient.CertServiceClient) (*CertServiceCA, error) {
ca := CertServiceCA{}
ca.name = cmpv2Issuer.Name
ca.url = cmpv2Issuer.Spec.URL
ca.caName = cmpv2Issuer.Spec.CaName
- ca.key = key
- ca.cert = cert
- ca.cacert = cacert
+ ca.certServiceClient = certServiceClient
log := ctrl.Log.WithName("cmpv2-provisioner")
- log.Info("Configuring CA: ", "name", ca.name, "url", ca.url, "caName", ca.caName, "key", ca.key,
- "cert", ca.cert, "cacert", ca.cacert)
+ log.Info("Configuring CA: ", "name", ca.name, "url", ca.url, "caName", ca.caName)
return &ca, nil
}
@@ -82,22 +78,27 @@ func Store(namespacedName types.NamespacedName, provisioner *CertServiceCA) {
collection.Store(namespacedName, provisioner)
}
-func (ca *CertServiceCA) Sign(ctx context.Context, certificateRequest *certmanager.CertificateRequest) ([]byte, []byte, error) {
+func (ca *CertServiceCA) Sign(ctx context.Context, certificateRequest *certmanager.CertificateRequest, privateKeyBytes []byte) ([]byte, []byte, error) {
log := ctrl.Log.WithName("certservice-provisioner")
log.Info("Signing certificate: ", "cert-name", certificateRequest.Name)
- key, _ := base64.RawStdEncoding.DecodeString(string(ca.key))
- log.Info("CA: ", "name", ca.name, "url", ca.url, "key", key)
+ log.Info("CA: ", "name", ca.name, "url", ca.url)
- crPEM := certificateRequest.Spec.Request
- csrBase64 := crPEM
- log.Info("Csr PEM: ", "bytes", csrBase64)
+ csrBytes := certificateRequest.Spec.Request
+ log.Info("Csr PEM: ", "bytes", csrBytes)
- csr, err := decodeCSR(crPEM)
+ csr, err := decodeCSR(csrBytes)
if err != nil {
return nil, nil, err
}
+ response, err := ca.certServiceClient.GetCertificates(csrBytes, privateKeyBytes)
+ if err != nil {
+ return nil, nil, err
+ }
+ log.Info("Certificate Chain", "cert-chain", response.CertificateChain)
+ log.Info("Trusted Certificates", "trust-certs", response.TrustedCertificates)
+
cert := x509.Certificate{}
cert.Raw = csr.Raw
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory.go b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory.go
index 4a3898e7..125c1bc6 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory.go
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory.go
@@ -25,24 +25,31 @@ import (
v1 "k8s.io/api/core/v1"
+ "onap.org/oom-certservice/k8s-external-provider/src/certserviceclient"
"onap.org/oom-certservice/k8s-external-provider/src/cmpv2api"
)
func CreateProvisioner(issuer *cmpv2api.CMPv2Issuer, secret v1.Secret) (*CertServiceCA, error) {
secretKeys := issuer.Spec.CertSecretRef
- key, err := readValueFromSecret(secret, secretKeys.KeyRef)
+ keyBase64, err := readValueFromSecret(secret, secretKeys.KeyRef)
if err != nil {
return nil, err
}
- cert, err := readValueFromSecret(secret, secretKeys.CertRef)
+ certBase64, err := readValueFromSecret(secret, secretKeys.CertRef)
if err != nil {
return nil, err
}
- cacert, err := readValueFromSecret(secret, secretKeys.CacertRef)
+ cacertBase64, err := readValueFromSecret(secret, secretKeys.CacertRef)
if err != nil {
return nil, err
}
- return New(issuer, key, cert, cacert)
+
+ certServiceClient, err := certserviceclient.CreateCertServiceClient(issuer.Spec.URL, issuer.Spec.CaName, keyBase64, certBase64, cacertBase64)
+ if err != nil {
+ return nil, err
+ }
+
+ return New(issuer, certServiceClient)
}
func readValueFromSecret(secret v1.Secret, secretKey string) ([]byte, error) {
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory_test.go b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory_test.go
index 6ef33098..1e215d3f 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory_test.go
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_factory_test.go
@@ -21,6 +21,7 @@
package cmpv2provisioner
import (
+ "encoding/base64"
"fmt"
"testing"
@@ -28,6 +29,7 @@ import (
v1 "k8s.io/api/core/v1"
"onap.org/oom-certservice/k8s-external-provider/src/cmpv2api"
+ "onap.org/oom-certservice/k8s-external-provider/src/testdata"
)
const (
@@ -39,12 +41,6 @@ const (
cacertSecretKey = "cacert.pem"
)
-var (
- keySecretValue = []byte("keyData")
- certSecretValue = []byte("certData")
- cacertSecretValue = []byte("cacertData")
-)
-
func Test_shouldCreateProvisioner(t *testing.T) {
issuer, secret := getValidIssuerAndSecret()
@@ -53,9 +49,6 @@ func Test_shouldCreateProvisioner(t *testing.T) {
assert.NotNil(t, provisioner)
assert.Equal(t, url, provisioner.url)
assert.Equal(t, caName, provisioner.caName)
- assert.Equal(t, keySecretValue, provisioner.key)
- assert.Equal(t, certSecretValue, provisioner.cert)
- assert.Equal(t, cacertSecretValue, provisioner.cacert)
}
func Test_shouldReturnError_whenSecretMissingKeyRef(t *testing.T) {
@@ -94,6 +87,18 @@ func Test_shouldReturnError_whenSecretMissingCacertRef(t *testing.T) {
}
}
+
+func Test_shouldReturnError_whenCreationOfCertServiceClientReturnsError(t *testing.T) {
+ issuer, secret := getValidIssuerAndSecret()
+ invalidKeySecretValue, _ := base64.StdEncoding.DecodeString("")
+ secret.Data[keySecretKey] = invalidKeySecretValue
+
+ provisioner, err := CreateProvisioner(&issuer, secret)
+
+ assert.Nil(t, provisioner)
+ assert.Error(t, err)
+}
+
func getValidIssuerAndSecret() (cmpv2api.CMPv2Issuer, v1.Secret) {
issuer := cmpv2api.CMPv2Issuer{
Spec: cmpv2api.CMPv2IssuerSpec{
@@ -110,9 +115,9 @@ func getValidIssuerAndSecret() (cmpv2api.CMPv2Issuer, v1.Secret) {
secret := v1.Secret{
Data: map[string][]byte{
- keySecretKey: keySecretValue,
- certSecretKey: certSecretValue,
- cacertSecretKey: cacertSecretValue,
+ keySecretKey: testdata.KeyBytes,
+ certSecretKey: testdata.CertBytes,
+ cacertSecretKey: testdata.CacertBytes,
},
}
secret.Name = secretName
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_test.go b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_test.go
index f3ab5cb0..39e399b8 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_test.go
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/cmpv2_provisioner_test.go
@@ -33,31 +33,26 @@ import (
apimach "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
+ "onap.org/oom-certservice/k8s-external-provider/src/certserviceclient"
"onap.org/oom-certservice/k8s-external-provider/src/cmpv2api"
)
const ISSUER_NAME = "cmpv2-issuer"
const ISSUER_URL = "issuer/url"
-const KEY = "onapwro-key"
-const CERT = "onapwro-cert"
-const CACERT = "onapwro-cacert"
const ISSUER_NAMESPACE = "onap"
func Test_shouldCreateCorrectCertServiceCA(t *testing.T) {
- issuer, key, cert, cacert := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL, KEY, CERT, CACERT)
- provisioner, err := New(&issuer, key, cert, cacert)
+ issuer := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL)
+ provisioner, err := New(&issuer, &certServiceClientMock{})
assert.Nil(t, err)
- assert.Equal(t, string(provisioner.key), string(key), "Unexpected provisioner key.")
- assert.Equal(t, string(provisioner.cert), string(cert), "Unexpected provisioner cert.")
- assert.Equal(t, string(provisioner.cacert), string(cacert), "Unexpected provisioner cacert.")
assert.Equal(t, provisioner.name, issuer.Name, "Unexpected provisioner name.")
assert.Equal(t, provisioner.url, issuer.Spec.URL, "Unexpected provisioner url.")
}
func Test_shouldSuccessfullyLoadPreviouslyStoredProvisioner(t *testing.T) {
- issuer, key, cert, cacert := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL, KEY, CERT, CACERT)
- provisioner, err := New(&issuer, key, cert, cacert)
+ issuer := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL)
+ provisioner, err := New(&issuer, &certServiceClientMock{})
assert.Nil(t, err)
@@ -67,19 +62,24 @@ func Test_shouldSuccessfullyLoadPreviouslyStoredProvisioner(t *testing.T) {
provisioner, ok := Load(issuerNamespaceName)
verifyThatConditionIsTrue(ok, "Provisioner could not be loaded.", t)
- assert.Equal(t, string(provisioner.key), string(key), "Unexpected provisioner key.")
- assert.Equal(t, string(provisioner.cert), string(cert), "Unexpected provisioner cert.")
- assert.Equal(t, string(provisioner.cacert), string(cacert), "Unexpected provisioner cacert.")
assert.Equal(t, provisioner.name, issuer.Name, "Unexpected provisioner name.")
assert.Equal(t, provisioner.url, issuer.Spec.URL, "Unexpected provisioner url.")
}
func Test_shouldReturnCorrectSignedPemsWhenParametersAreCorrect(t *testing.T) {
- const EXPECTED_SIGNED_FILENAME = "test_resources/expected_signed.pem"
- const EXPECTED_TRUSTED_FILENAME = "test_resources/expected_trusted.pem"
-
- issuer, key, cert, cacert := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL, KEY, CERT, CACERT)
- provisioner, err := New(&issuer, key, cert, cacert)
+ const EXPECTED_SIGNED_FILENAME = "testdata/expected_signed.pem"
+ const EXPECTED_TRUSTED_FILENAME = "testdata/expected_trusted.pem"
+
+ issuer := createIssuerAndCerts(ISSUER_NAME, ISSUER_URL)
+ provisioner, err := New(&issuer, &certServiceClientMock{
+ getCertificatesFunc: func(csr []byte, pk []byte) (response *certserviceclient.CertificatesResponse, e error) {
+ mockResponse:= &certserviceclient.CertificatesResponse{
+ CertificateChain: []string{"cert-0", "cert-1"},
+ TrustedCertificates: []string{"trusted-cert-0", "trusted-cert-1"},
+ } //TODO: mock real certServiceClient response
+ return mockResponse, nil
+ },
+ })
issuerNamespaceName := createIssuerNamespaceName(ISSUER_NAMESPACE, ISSUER_NAME)
Store(issuerNamespaceName, provisioner)
@@ -91,7 +91,7 @@ func Test_shouldReturnCorrectSignedPemsWhenParametersAreCorrect(t *testing.T) {
ctx := context.Background()
request := createCertificateRequest()
- signedPEM, trustedCAs, err := provisioner.Sign(ctx, request)
+ signedPEM, trustedCAs, err := provisioner.Sign(ctx, request, nil)
assert.Nil(t, err)
@@ -112,11 +112,11 @@ func createIssuerNamespaceName(namespace string, name string) types.NamespacedNa
}
}
-func createIssuerAndCerts(name string, url string, key string, cert string, cacert string) (cmpv2api.CMPv2Issuer, []byte, []byte, []byte) {
+func createIssuerAndCerts(name string, url string) cmpv2api.CMPv2Issuer {
issuer := cmpv2api.CMPv2Issuer{}
issuer.Name = name
issuer.Spec.URL = url
- return issuer, []byte(key), []byte(cert), []byte(cacert)
+ return issuer
}
func readFile(filename string) []byte {
@@ -133,8 +133,8 @@ func createCertificateRequest() *cmapi.CertificateRequest {
const ISSUER_GROUP = "certmanager.onap.org"
const CONDITION_TYPE = "Ready"
- const SPEC_REQUEST_FILENAME = "test_resources/test_certificate_request.pem"
- const STATUS_CERTIFICATE_FILENAME = "test_resources/test_certificate.pem"
+ const SPEC_REQUEST_FILENAME = "testdata/test_certificate_request.pem"
+ const STATUS_CERTIFICATE_FILENAME = "testdata/test_certificate.pem"
duration := new(apimach.Duration)
d, _ := time.ParseDuration(CERTIFICATE_DURATION)
@@ -159,3 +159,11 @@ func createCertificateRequest() *cmapi.CertificateRequest {
func areSlicesEqual(slice1 []byte, slice2 []byte) bool {
return bytes.Compare(slice1, slice2) == 0
}
+
+type certServiceClientMock struct {
+ getCertificatesFunc func(csr []byte, key []byte) (*certserviceclient.CertificatesResponse, error)
+}
+
+func (client *certServiceClientMock) GetCertificates(csr []byte, key []byte) (*certserviceclient.CertificatesResponse, error) {
+ return client.getCertificatesFunc(csr, key)
+}
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_signed.pem b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_signed.pem
index 2d0e84d4..2d0e84d4 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_signed.pem
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_signed.pem
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_trusted.pem b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_trusted.pem
index 2d0e84d4..2d0e84d4 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/expected_trusted.pem
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/expected_trusted.pem
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate.pem b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate.pem
index 7f306269..7f306269 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate.pem
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate.pem
diff --git a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate_request.pem b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate_request.pem
index 3becbf10..3becbf10 100644
--- a/certServiceK8sExternalProvider/src/cmpv2provisioner/test_resources/test_certificate_request.pem
+++ b/certServiceK8sExternalProvider/src/cmpv2provisioner/testdata/test_certificate_request.pem
diff --git a/certServiceK8sExternalProvider/src/testdata/constants.go b/certServiceK8sExternalProvider/src/testdata/constants.go
new file mode 100644
index 00000000..d2097bae
--- /dev/null
+++ b/certServiceK8sExternalProvider/src/testdata/constants.go
@@ -0,0 +1,12 @@
+package testdata
+
+import "encoding/base64"
+
+var (
+ KeyBytes, _ = base64.StdEncoding.DecodeString("QmFnIEF0dHJpYnV0ZXMKICAgIGZyaWVuZGx5TmFtZTogb29tLWNlcnQtc2VydmljZQogICAgbG9jYWxLZXlJRDogNTQgNjkgNkQgNjUgMjAgMzEgMzYgMzAgMzIgMzggMzMgMzkgMzIgMzIgMzAgMzcgMzkgMzUgCktleSBBdHRyaWJ1dGVzOiA8Tm8gQXR0cmlidXRlcz4KLS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ3IwcWpSamNIb3lNY20KREJYanRlcm45V0pYWHlDQUlOREJ6SFV0MHR6WFFHbmlpSU9URXhldGdYdUl2KytoNEVrZ25SalVKNmVzSktFKwo3VHZnd21VS1hqc3ljY3pNWUhHMUE5bk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