2 * ============LICENSE_START=======================================================
3 * oom-certservice-k8s-external-provider
4 * ================================================================================
5 * Copyright (C) 2020 Nokia. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
25 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27 "onap.org/oom-certservice/k8s-external-provider/src/cmpv2api"
31 SecretName = "issuer-cert-secret"
32 Url = "https://oom-cert-service:8443/v1/certificate/"
33 HealthEndpoint = "actuator/health"
34 CertEndpoint = "v1/certificate"
36 KeySecretKey = "cmpv2Issuer-key.pem"
37 CertSecretKey = "cmpv2Issuer-cert.pem"
38 CacertSecretKey = "cacert.pem"
40 IssuerObjectName = "fakeIssuer"
45 func GetValidIssuerWithSecret() (cmpv2api.CMPv2Issuer, v1.Secret) {
46 issuer := cmpv2api.CMPv2Issuer{
48 TypeMeta: metav1.TypeMeta{
49 APIVersion: APIVersion,
52 ObjectMeta: metav1.ObjectMeta{
53 Name: IssuerObjectName,
56 Spec: GetValidCMPv2IssuerSpec(),
60 Data: map[string][]byte{
61 KeySecretKey: KeyBytes,
62 CertSecretKey: CertBytes,
63 CacertSecretKey: CacertBytes,
65 ObjectMeta: metav1.ObjectMeta{
70 secret.Name = SecretName
74 func GetValidCMPv2IssuerSpec() cmpv2api.CMPv2IssuerSpec {
75 issuerSpec := cmpv2api.CMPv2IssuerSpec{
77 HealthEndpoint: HealthEndpoint,
78 CertEndpoint: CertEndpoint,
80 CertSecretRef: cmpv2api.SecretKeySelector{
83 CertRef: CertSecretKey,
84 CacertRef: CacertSecretKey,