initializer

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HSMClient is the name of container that contain the HSM client library
	HSMClient = "hsm-client"
	// CertGen is the name of container that runs the command to generate the certificate for the CA
	CertGen = "certgen"
)

Variables

This section is empty.

Functions

func LoadConfigFromFile

func LoadConfigFromFile(file string) (*v1.ServerConfig, error)

Types

type CA

type CA struct {
	CN            string
	Config        CAConfig
	Viper         *viper.Viper
	Type          config.Type
	SqliteDir     string
	UsingHSMProxy bool
	// contains filtered or unexported fields
}

func NewCA

func NewCA(config CAConfig, caType config.Type, sqliteDir string, hsmProxy bool, cn string) *CA

func (*CA) ConfigToBytes

func (ca *CA) ConfigToBytes() ([]byte, error)

func (*CA) GetHomeDir

func (ca *CA) GetHomeDir() string

func (*CA) GetServerConfig

func (ca *CA) GetServerConfig() *v1.ServerConfig

func (*CA) GetType

func (ca *CA) GetType() config.Type

func (*CA) HealthCheck

func (ca *CA) HealthCheck(parentURL, certPath string) error

func (*CA) Init

func (ca *CA) Init() (err error)

func (*CA) IsBeingUpdated

func (ca *CA) IsBeingUpdated()

func (*CA) IsHSMEnabled

func (ca *CA) IsHSMEnabled() bool

func (*CA) IsPostgresReachable

func (ca *CA) IsPostgresReachable(db lib.CAConfigDB) bool

func (*CA) OverrideServerConfig

func (ca *CA) OverrideServerConfig(newConfig *v1.ServerConfig) (err error)

func (*CA) ParseCABlock

func (ca *CA) ParseCABlock() (map[string][]byte, error)

func (*CA) ParseCrypto

func (ca *CA) ParseCrypto() (map[string][]byte, error)

func (*CA) ParseEnrollmentCACrypto

func (ca *CA) ParseEnrollmentCACrypto() (map[string][]byte, error)

func (*CA) ParseTLSCACrypto

func (ca *CA) ParseTLSCACrypto() (map[string][]byte, error)

func (*CA) RemoveHomeDir

func (ca *CA) RemoveHomeDir() error

func (*CA) SetMountPaths

func (ca *CA) SetMountPaths()

func (*CA) SetPKCS11Defaults

func (ca *CA) SetPKCS11Defaults(serverConfig *v1.ServerConfig)

func (*CA) ViperUnmarshal

func (ca *CA) ViperUnmarshal(configFile string) (*lib.ServerConfig, error)

ViperUnmarshal as this is what fabric-ca uses when it reads it's configuration file

func (*CA) WriteConfig

func (ca *CA) WriteConfig() (err error)

type CAConfig

type CAConfig interface {
	GetServerConfig() *v1.ServerConfig
	ParseCABlock() (map[string][]byte, error)
	ParseDBBlock() (map[string][]byte, error)
	ParseTLSBlock() (map[string][]byte, error)
	ParseOperationsBlock() (map[string][]byte, error)
	ParseIntermediateBlock() (map[string][]byte, error)
	SetServerConfig(*v1.ServerConfig)
	SetMountPaths(config.Type)
	GetHomeDir() string
	SetUpdate(bool)
	UsingPKCS11() bool
}

type Config

type Config struct {
	SharedPath              string `json:"sharedPath"`
	CADefaultConfigPath     string `json:"cadefaultconfigpath"`
	TLSCADefaultConfigPath  string `json:"tlscadefaultconfigpath"`
	CAOverrideConfigPath    string `json:"caoverrideconfigpath"`
	TLSCAOverrideConfigPath string `json:"tlscaoverrideconfigpath"`
	DeploymentFile          string
	PVCFile                 string
	ServiceFile             string
	RoleFile                string
	ServiceAccountFile      string
	RoleBindingFile         string
	ConfigMapFile           string
	IngressFile             string
	Ingressv1beta1File      string
	RouteFile               string
}

type ConfigOptions

type ConfigOptions struct {
	DefaultPath  string `json:"defaultpath"`
	OverridePath string `json:"overridepath"`
}

type HSM

type HSM struct {
	Config   *config.HSMConfig
	Timeouts HSMInitJobTimeouts
	Client   controller.Client
	Scheme   *runtime.Scheme
}

HSM implements the ability to initialize HSM CA

func (*HSM) Create

func (h *HSM) Create(instance *current.IBPCA, overrides *v1.ServerConfig, ca IBPCA) (*Response, error)

Create creates the crypto and config materical to initialize an HSM based CA

type HSMDaemon

type HSMDaemon struct {
	Config   *config.HSMConfig
	Scheme   *runtime.Scheme
	Timeouts HSMInitJobTimeouts
	Client   controller.Client
}

HSMDaemon implements the ability to initialize HSM Daemon based CA

func (*HSMDaemon) Create

func (h *HSMDaemon) Create(instance *current.IBPCA, overrides *v1.ServerConfig, ca IBPCA) (*Response, error)

Create creates the crypto and config materical to initialize an HSM based CA

type HSMInitJobTimeouts

type HSMInitJobTimeouts struct {
	JobStart      common.Duration `json:"jobStart" yaml:"jobStart"`
	JobCompletion common.Duration `json:"jobCompletion" yaml:"jobCompletion"`
}

HSMInitJobTimeouts defines timeouts properties

type IBPCA

type IBPCA interface {
	OverrideServerConfig(newConfig *v1.ServerConfig) (err error)
	ViperUnmarshal(configFile string) (*lib.ServerConfig, error)
	ParseCrypto() (map[string][]byte, error)
	ParseCABlock() (map[string][]byte, error)
	GetServerConfig() *v1.ServerConfig
	WriteConfig() (err error)
	RemoveHomeDir() error
	IsBeingUpdated()
	ConfigToBytes() ([]byte, error)
	GetHomeDir() string
	Init() (err error)
	SetMountPaths()
	GetType() config.Type
}

type Initializer

type Initializer struct {
	Timeouts HSMInitJobTimeouts
	Client   k8sclient.Client
	Scheme   *runtime.Scheme
}

func (*Initializer) Create

func (i *Initializer) Create(instance *current.IBPCA, overrides *v1.ServerConfig, ca IBPCA) (*Response, error)

func (*Initializer) Update

func (i *Initializer) Update(instance *current.IBPCA, overrides *v1.ServerConfig, ca IBPCA) (*Response, error)

type Response

type Response struct {
	Config    *v1.ServerConfig
	CryptoMap map[string][]byte
}

type SW

type SW struct{}

func (*SW) Create

func (sw *SW) Create(instance *current.IBPCA, overrides *v1.ServerConfig, ca IBPCA) (*Response, error)

Directories

Path Synopsis
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