config

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config defines the configuration fields used in RA.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToX509PublicKeyAlgo

func StringToX509PublicKeyAlgo() mapstructure.DecodeHookFunc

StringToX509PublicKeyAlgo returns a DecodeHookFunc that converts string to x509.PublicKeyAlgorithm.

Types

type GensignConfig

type GensignConfig struct {
	// KeyIDVersion specifies the version of KeyID.
	KeyIDVersion uint16 `json:"keyid_version"`
	// SSHCAFailureDir stores the count of the failure requests to a CA.
	SSHCAFailureDir string `json:"sshca_failure_dir"`
	// SSHCAFailureRetry is the retry times limit.
	SSHCAFailureRetry int64 `json:"sshca_failure_retry"`
	// SSHCAFailureTimeout is the maximum time period to resend the request to CA (in second).
	SSHCAFailureTimeout int64 `json:"sshca_failure_timeout"`
	// HandlerConfig is the config mapping for all the csr handlers in following format:
	// "handlers": {
	//   "$HANDLER_NAME1": {
	//     "enable": true,
	//     "$KEY": $VALUE
	//   }
	//   "$HANDLER_NAME2": {
	//     "enable": true,
	//     "$KEY": $VALUE
	//   }
	// }
	HandlerConfig map[string]handlerConfMap `json:"handlers"`
	// SignerConfig is the mapping for signer configuration.
	SignerConfig map[string]interface{} `json:"signer"`
	// Timeout for gensign (in second).
	RequestTimeout time.Duration `json:"request_timeout"`
	// OTel is the configuration for connecting to OpenTelemetry collector.
	OTel OTelConfig `json:"otel"`
}

GensignConfig stores the configuration for gensign command.

func NewGensignConfig

func NewGensignConfig(path string) (*GensignConfig, error)

NewGensignConfig returns the gensign configuration loaded from the provided path.

func (*GensignConfig) ExtractHandlerConf

func (g *GensignConfig) ExtractHandlerConf(name string, handlerConf interface{}) error

ExtractHandlerConf extracts handler config from GensignConfig by the given name.

type OTelConfig added in v0.0.16

type OTelConfig struct {
	// Enabled indicates whether to enable OpenTelemetry.
	Enabled bool `json:"enabled"`
	// OTelCollectorEndpoint is the endpoint of the OpenTelemetry collector.
	OTELCollectorEndpoint string `json:"otel_collector_endpoint"`
	// ClientCertPath is the path to the client certificate.
	ClientCertPath string `json:"client_cert_path"`
	// ClientKeyPath is the path to the client key.
	ClientKeyPath string `json:"client_key_path"`
	// CACertPath is the path to the CA certificate.
	CACertPath string `json:"ca_cert_path"`
}

OTelConfig stores the configuration for connecting to OpenTelemetry collector.

Jump to

Keyboard shortcuts

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