common

package
v1.0.7-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCrypto

func CheckCrypto(cryptoValidator CryptoValidator, instance v1.Object, checkClientAuth bool) error

func CheckIfCertsDifferent

func CheckIfCertsDifferent(current map[string][]byte, updated []string) (bool, error)

Check for equality between two list of certificates. Order of certificates in the lists is ignored, if the two lists contain the same exact certificates this returns true

func ConvertCertsToBytes

func ConvertCertsToBytes(certs []string) ([][]byte, error)

func GetAdminCertsFromSecret

func GetAdminCertsFromSecret(client k8sclient.Client, instance v1.Object) map[string][]byte

func GetAdminCertsFromSpec

func GetAdminCertsFromSpec(spec *current.SecretSpec) []string

func GetCommonEnrollers

func GetCommonEnrollers(cryptos *config.Cryptos, enrollmentSpec *current.EnrollmentSpec, storagePath string) error

NOTE: Modifies cryptos object passed as param

func GetConfigFromConfigMap

func GetConfigFromConfigMap(client k8sclient.Client, instance v1.Object) (*corev1.ConfigMap, error)

func GetMSPCrypto

func GetMSPCrypto(cryptos *config.Cryptos, mspSpec *current.MSPSpec) error

NOTE: Modifies cryptos object passed as param

Types

type CryptoValidator

type CryptoValidator interface {
	CheckEcertCrypto(v1.Object, string) error
	CheckTLSCrypto(v1.Object, string) error
	CheckClientAuthCrypto(v1.Object, string) error
	SetHSMEnabled(bool)
}

type Instance

type Instance interface {
	metav1.Object
	runtime.Object
	EnrollerImage() string
	GetPullSecrets() []corev1.LocalObjectReference
	IsHSMEnabled() bool
	UsingHSMProxy() bool
	GetConfigOverride() (interface{}, error)
}

type SecretType

type SecretType string
var (
	ECERT SecretType = "ecert"
	TLS   SecretType = "tls"
)

Directories

Path Synopsis
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL