// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// 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.

package shootsecrets_test

import (
	"context"
	"fmt"

	gardencorev1alpha1helper "github.com/gardener/gardener/pkg/apis/core/v1alpha1/helper"
	"github.com/gardener/gardener/pkg/utils"
	"github.com/gardener/gardener/pkg/utils/infodata"
	"github.com/gardener/gardener/pkg/utils/secrets"

	mockclient "github.com/gardener/gardener/pkg/mock/controller-runtime/client"
	"github.com/golang/mock/gomock"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"

	. "github.com/gardener/gardener/pkg/operation/shootsecrets"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("SecretsManager", func() {
	type ExpectedNameType struct {
		Name string
		Type infodata.TypeVersion
	}

	var (
		staticTokenConfig            *secrets.StaticTokenSecretConfig
		apiServerBasicAuthConfig     *secrets.BasicAuthSecretConfig
		wantedCertificateAuthorities map[string]*secrets.CertificateSecretConfig
		secretsConfigGenerator       func(basicAuthAPIServer *secrets.BasicAuth, staticToken *secrets.StaticToken, certificateAuthorities map[string]*secrets.Certificate) ([]secrets.ConfigInterface, error)

		caName   = "ca1"
		certName = "cert1"
		cacert   = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCekNDQWUrZ0F3SUJBZ0lKQUpMN2JKT01pajd2TUEwR0NTcUdTSWIzRFFFQkJRVUFNQm94R0RBV0JnTlYKQkFNTUQzZDNkeTVsZUdGdGNH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HRsQldYVGdsRFVvZ2d4bVcxVzcxRjBJalRkWQprLzFhWXJwMlRCQ3hSVWlXM0FnZE1qWHJPZjc1TEErS0ZsOTMvdmlGYzRCeExmT2V6eEhtV1F1blZKb0Y5NzNSCnBSQnpKUUtCZ0V3WHM2dVVVRTdBRVN1dTh2aS8zeG1heWVDL3pjOXZod1dpTkNoOTNtZVNlL1YvYmFWYVNCSjgKRG9aVVBVTnc3MzNLUlU5TWpUNzM4L0hKczZsN2Z5U1FXMHozSkRLTDduUTVjb1RDR09zWlNHalNIVEdzUU01bgpLSWREdGEyYm5Vb1hUTU01S0h4OW9KQ0tYYy9mZTdGY3ZsanVRd3hESzk1RkNRVFYwclFoCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg=="

		checkIfInfoDataUpsertedSuccessfully = func(resourceDataList gardencorev1alpha1helper.GardenerResourceDataList, expectedResources ...ExpectedNameType) {
			Expect(len(resourceDataList)).To(Equal(len(expectedResources)))
			for _, expectedResource := range expectedResources {
				resourceData := resourceDataList.Get(expectedResource.Name)
				Expect(resourceData).NotTo(BeNil())
				Expect(resourceData.Type).To(BeEquivalentTo(expectedResource.Type))
				Expect(resourceData.Data.Raw).ToNot(BeNil())
			}
		}
	)

	BeforeEach(func() {
		staticTokenConfig = &secrets.StaticTokenSecretConfig{
			Name: "static-token",
			Tokens: map[string]secrets.TokenConfig{
				"fooID": {
					Username: "foo",
					UserID:   "fooID",
					Groups:   []string{"group1", "group2"},
				},
			},
		}

		apiServerBasicAuthConfig = &secrets.BasicAuthSecretConfig{
			Name:           "basic-auth",
			Format:         secrets.BasicAuthFormatCSV,
			Username:       "admin",
			PasswordLength: 32,
		}

		wantedCertificateAuthorities = map[string]*secrets.CertificateSecretConfig{
			caName: {
				Name:       caName,
				CommonName: caName,
				CertType:   secrets.CACert,
			},
		}

		secretsConfigGenerator = func(basicAuthAPIServer *secrets.BasicAuth, staticToken *secrets.StaticToken, certificateAuthorities map[string]*secrets.Certificate) ([]secrets.ConfigInterface, error) {
			return []secrets.ConfigInterface{
				&secrets.ControlPlaneSecretConfig{
					CertificateSecretConfig: &secrets.CertificateSecretConfig{
						Name:       certName,
						CommonName: certName,
						CertType:   secrets.ServerCert,
						SigningCA:  certificateAuthorities[caName],
					},
				},
			}, nil
		}
	})

	Describe("#Generate", func() {
		It("should generate secrets infodata and save it into the gardener resource data list", func() {
			secretsManager := NewSecretsManager(gardencorev1alpha1helper.GardenerResourceDataList{}, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			secretsManager.WithAPIServerBasicAuthConfig(apiServerBasicAuthConfig)
			err := secretsManager.Generate()
			Expect(err).NotTo(HaveOccurred())

			checkIfInfoDataUpsertedSuccessfully(secretsManager.GardenerResourceDataList,
				ExpectedNameType{apiServerBasicAuthConfig.Name, secrets.BasicAuthDataType},
				ExpectedNameType{staticTokenConfig.Name, secrets.StaticTokenDataType},
				ExpectedNameType{caName, secrets.CertificateDataType},
				ExpectedNameType{certName, secrets.CertificateDataType},
			)
		})

		It("should not generate basic auth secret if the basic auth secret config is not added to the SecretsManager", func() {
			secretsManager := NewSecretsManager(gardencorev1alpha1helper.GardenerResourceDataList{}, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			err := secretsManager.Generate()
			Expect(err).NotTo(HaveOccurred())

			basicAuthResourceData := secretsManager.GardenerResourceDataList.Get(apiServerBasicAuthConfig.Name)
			Expect(basicAuthResourceData).To(BeNil())
		})

		It("should not overwrite secrets if they already exist in the gardener resource data list", func() {
			resourceDataList := gardencorev1alpha1helper.GardenerResourceDataList{
				{
					Name: caName,
					Type: string(secrets.CertificateDataType),
					Data: runtime.RawExtension{Raw: []byte(fmt.Sprintf(`{"privateKey":"%s","certificate":"%s"}`, cakey, cacert))},
				},
			}

			secretsManager := NewSecretsManager(resourceDataList, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			secretsManager.WithAPIServerBasicAuthConfig(apiServerBasicAuthConfig)
			err := secretsManager.Generate()
			Expect(err).NotTo(HaveOccurred())

			checkIfInfoDataUpsertedSuccessfully(secretsManager.GardenerResourceDataList,
				ExpectedNameType{apiServerBasicAuthConfig.Name, secrets.BasicAuthDataType},
				ExpectedNameType{staticTokenConfig.Name, secrets.StaticTokenDataType},
				ExpectedNameType{caName, secrets.CertificateDataType},
				ExpectedNameType{certName, secrets.CertificateDataType},
			)

			Expect(*secretsManager.GardenerResourceDataList.Get(caName)).To(Equal(resourceDataList[0]))
		})

		It("should append generated static token info data with new entries if config was modified", func() {
			resourceDataList := gardencorev1alpha1helper.GardenerResourceDataList{
				{
					Name: staticTokenConfig.Name,
					Type: string(secrets.StaticTokenDataType),
					Data: runtime.RawExtension{Raw: []byte(`{"tokens":{"fooID":"foo"}}`)},
				},
			}

			staticTokenConfig.Tokens["barID"] = secrets.TokenConfig{
				Username: "bar",
				UserID:   "barID",
				Groups:   []string{"barGroup1"},
			}
			secretsManager := NewSecretsManager(resourceDataList, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			err := secretsManager.Generate()
			Expect(err).NotTo(HaveOccurred())

			staticTokenResourceData := secretsManager.GardenerResourceDataList.Get(staticTokenConfig.Name)
			Expect(staticTokenResourceData).NotTo(BeNil())
			staticTokenInfoData, err := infodata.Unmarshal(staticTokenResourceData)
			Expect(err).NotTo(HaveOccurred())
			Expect(len(staticTokenInfoData.(*secrets.StaticTokenInfoData).Tokens)).To(Equal(2))
			Expect(staticTokenInfoData.(*secrets.StaticTokenInfoData).Tokens["barID"]).NotTo(Equal(""))
			Expect(staticTokenInfoData.(*secrets.StaticTokenInfoData).Tokens["fooID"]).To(Equal("foo"))
		})

		It("should remove outdated token entries from generated static token info data", func() {
			resourceDataList := gardencorev1alpha1helper.GardenerResourceDataList{
				{
					Name: staticTokenConfig.Name,
					Type: string(secrets.StaticTokenDataType),
					Data: runtime.RawExtension{Raw: []byte(`{"tokens":{"fooID":"foo","barID":"bar"}}`)},
				},
			}

			secretsManager := NewSecretsManager(resourceDataList, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			Expect(secretsManager.Generate()).To(Succeed())

			staticTokenResourceData := secretsManager.GardenerResourceDataList.Get(staticTokenConfig.Name)
			Expect(staticTokenResourceData).NotTo(BeNil())
			staticTokenInfoData, err := infodata.Unmarshal(staticTokenResourceData)
			Expect(err).NotTo(HaveOccurred())
			Expect(len(staticTokenInfoData.(*secrets.StaticTokenInfoData).Tokens)).To(Equal(1))
			Expect(staticTokenInfoData.(*secrets.StaticTokenInfoData).Tokens["fooID"]).To(Equal("foo"))
		})
	})

	Describe("#Deploy", func() {
		var (
			ctrl                     *gomock.Controller
			k8sClient                *mockclient.MockClient
			decodedCert              []byte
			decodedKey               []byte
			gardenerResourceDataList gardencorev1alpha1helper.GardenerResourceDataList
			expectedSecrets          map[string]*corev1.Secret

			controlplaneNS = "controlplane"
		)

		BeforeEach(func() {
			ctrl = gomock.NewController(GinkgoT())
			k8sClient = mockclient.NewMockClient(ctrl)

			decodedCert, _ = utils.DecodeBase64(cacert)
			decodedKey, _ = utils.DecodeBase64(cakey)

			gardenerResourceDataList = gardencorev1alpha1helper.GardenerResourceDataList{
				{
					Name: apiServerBasicAuthConfig.Name,
					Type: string(secrets.BasicAuthDataType),
					Data: runtime.RawExtension{Raw: []byte(`{"password":"pass"}`)},
				},
				{
					Name: staticTokenConfig.Name,
					Type: string(secrets.StaticTokenDataType),
					Data: runtime.RawExtension{Raw: []byte(`{"tokens":{"fooID":"foo"}}`)},
				},
				{
					Name: caName,
					Type: string(secrets.CertificateDataType),
					Data: runtime.RawExtension{Raw: []byte(fmt.Sprintf(`{"privateKey":"%s","certificate":"%s"}`, []byte(cakey), []byte(cacert)))},
				},
				{
					Name: certName,
					Type: string(secrets.CertificateDataType),
					Data: runtime.RawExtension{Raw: []byte(fmt.Sprintf(`{"privateKey":"%s","certificate":"%s"}`, []byte(cakey), []byte(cacert)))},
				},
			}

			expectedSecrets = map[string]*corev1.Secret{
				apiServerBasicAuthConfig.Name: {
					ObjectMeta: metav1.ObjectMeta{
						Name:      apiServerBasicAuthConfig.Name,
						Namespace: controlplaneNS,
					},
					Type: corev1.SecretTypeOpaque,
					Data: map[string][]byte{
						secrets.DataKeyCSV: []byte("pass,admin,admin,system:masters"),
					},
				},
				staticTokenConfig.Name: {
					ObjectMeta: metav1.ObjectMeta{
						Name:      staticTokenConfig.Name,
						Namespace: controlplaneNS,
					},
					Type: corev1.SecretTypeOpaque,
					Data: map[string][]byte{
						secrets.DataKeyStaticTokenCSV: []byte(`foo,foo,fooID,"group1,group2"`),
					},
				},
				caName: {
					ObjectMeta: metav1.ObjectMeta{
						Name:      caName,
						Namespace: controlplaneNS,
					},
					Type: corev1.SecretTypeOpaque,
					Data: map[string][]byte{
						secrets.DataKeyCertificateCA: decodedCert,
						secrets.DataKeyPrivateKeyCA:  decodedKey,
					},
				},
				certName: {
					ObjectMeta: metav1.ObjectMeta{
						Name:      certName,
						Namespace: controlplaneNS,
					},
					Type: corev1.SecretTypeOpaque,
					Data: map[string][]byte{
						secrets.DataKeyCertificateCA:    decodedCert,
						fmt.Sprintf("%s.key", certName): decodedKey,
						fmt.Sprintf("%s.crt", certName): decodedCert,
					},
				},
			}
		})

		AfterEach(func() {
			ctrl.Finish()
		})

		It("should deploy all required kubernetes secret objects", func() {
			calls := []*gomock.Call{}
			calls = append(calls, k8sClient.EXPECT().Create(context.TODO(), expectedSecrets[apiServerBasicAuthConfig.Name]))
			calls = append(calls, k8sClient.EXPECT().Create(context.TODO(), expectedSecrets[staticTokenConfig.Name]))
			for _, caConfig := range wantedCertificateAuthorities {
				calls = append(calls, k8sClient.EXPECT().Create(context.TODO(), expectedSecrets[caConfig.Name]))
			}

			secretConfigs, err := secretsConfigGenerator(nil, nil, nil)
			Expect(err).NotTo(HaveOccurred())
			for _, secretConfig := range secretConfigs {
				calls = append(calls, k8sClient.EXPECT().Create(context.TODO(), expectedSecrets[secretConfig.GetName()]))
			}

			gomock.InOrder(
				calls...,
			)

			secretsManager := NewSecretsManager(gardenerResourceDataList, staticTokenConfig, wantedCertificateAuthorities, secretsConfigGenerator)
			err = secretsManager.WithExistingSecrets(map[string]*corev1.Secret{}).WithAPIServerBasicAuthConfig(apiServerBasicAuthConfig).Deploy(context.TODO(), k8sClient, controlplaneNS)
			Expect(err).NotTo(HaveOccurred())

			Expect(expectedSecrets).To(Equal(secretsManager.DeployedSecrets))
		})

		It("should update static token secret with changes from the shootstate if it already exists", func() {
			staticTokenConfig.Tokens["barID"] = secrets.TokenConfig{
				Username: "bar",
				UserID:   "barID",
				Groups:   []string{"barGroup1"},
			}

			staticTokenExistingSecret := &corev1.Secret{
				ObjectMeta: metav1.ObjectMeta{
					Name:      staticTokenConfig.Name,
					Namespace: controlplaneNS,
				},
				Type: corev1.SecretTypeOpaque,
				Data: map[string][]byte{
					secrets.DataKeyStaticTokenCSV: []byte(`foo,foo,fooID,"group1,group2"`),
				},
			}

			staticTokenExpectedSecret := &corev1.Secret{
				ObjectMeta: metav1.ObjectMeta{
					Name:      staticTokenConfig.Name,
					Namespace: controlplaneNS,
				},
				Type: corev1.SecretTypeOpaque,
				Data: map[string][]byte{
					secrets.DataKeyStaticTokenCSV: []byte("bar,bar,barID,barGroup1\nfoo,foo,fooID,\"group1,group2\""),
				},
			}

			gardenerResourceDataList := gardencorev1alpha1helper.GardenerResourceDataList{
				{
					Name: staticTokenConfig.Name,
					Type: string(secrets.StaticTokenDataType),
					Data: runtime.RawExtension{Raw: []byte(`{"tokens":{"fooID":"foo", "barID":"bar"}}`)},
				},
			}

			k8sClient.EXPECT().Update(context.TODO(), staticTokenExpectedSecret)
			secretsManager := NewSecretsManager(gardenerResourceDataList, staticTokenConfig, nil, nil)
			err := secretsManager.WithExistingSecrets(map[string]*corev1.Secret{staticTokenConfig.Name: staticTokenExistingSecret}).Deploy(context.TODO(), k8sClient, controlplaneNS)
			Expect(err).NotTo(HaveOccurred())

			Expect(staticTokenExpectedSecret).To(Equal(secretsManager.DeployedSecrets[staticTokenConfig.Name]))
		})
	})
})
