loader

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertCreateStruct added in v2.0.1

type CertCreateStruct struct {
	Type     string   `json:"type" example:"client_cert"`
	URIs     []string `json:"uris" example:"uri1,uri2"`
	DNSNames []string `json:"dnnames" example:"dns1,dns2"`
	TTL      string   `json:"ttl" example:"1h"`
}

type CertResultMessage added in v2.0.1

type CertResultMessage struct {
	Cert string `json:"cert,omitempty"`
	Key  string `json:"key,omitempty"`
	CA   string `json:"ca,omitempty"`
}

type Config added in v2.0.1

type Config struct {
	Type          string                   `json:"type,omitempty" toml:"type"` // "ENV", "FILE", "SERVICE" OR "SELF"
	Interval      configutil.Duration      `json:"interval,omitempty" toml:"interval"`
	Vault         *MiniVaultConfig         `json:"minivault,omitempty" toml:"minivault"`
	File          *FileConfig              `json:"file,omitempty" toml:"file"`
	Env           *EnvConfig               `json:"env,omitempty" toml:"env"`
	CA            []configutil.Certificate `json:"ca,omitempty" toml:"ca"`
	UseSystemPool bool                     `json:"usesystempool,omitempty" toml:"usesystempool"`
}

type EnvConfig added in v2.0.1

type EnvConfig struct {
	Cert string `json:"cert,omitempty" toml:"cert"`
	Key  string `json:"key,omitempty" toml:"key"`
}

type EnvLoader

type EnvLoader struct {
	// contains filtered or unexported fields
}

func NewEnvLoader

func NewEnvLoader(certChannel chan *tls.Certificate, client bool, cert, key string, certPool *x509.CertPool, interval time.Duration, logger zLogger.ZLogger) (*EnvLoader, error)

func (*EnvLoader) Close

func (f *EnvLoader) Close() error

func (*EnvLoader) GetCA

func (f *EnvLoader) GetCA() *x509.CertPool

func (*EnvLoader) Run

func (f *EnvLoader) Run() error

type FileConfig added in v2.0.1

type FileConfig struct {
	Cert string `json:"cert,omitempty" toml:"cert"`
	Key  string `json:"key,omitempty" toml:"key"`
}

type FileLoader

type FileLoader struct {
	// contains filtered or unexported fields
}

func NewFileLoader

func NewFileLoader(certChannel chan *tls.Certificate, client bool, cert, key string, certPool *x509.CertPool, interval time.Duration, logger zLogger.ZLogger) (*FileLoader, error)

func (*FileLoader) Close

func (f *FileLoader) Close() error

func (*FileLoader) GetCA

func (f *FileLoader) GetCA() *x509.CertPool

func (*FileLoader) Run

func (f *FileLoader) Run() error

type Loader

type Loader interface {
	io.Closer
	Run() error
	GetCA() *x509.CertPool
}

func CreateClientLoader

func CreateClientLoader(conf *Config, logger zLogger.ZLogger, hosts ...string) (tlsConfig *tls.Config, l Loader, err error)

func CreateServerLoader

func CreateServerLoader(mutual bool, conf *Config, uris []string, logger zLogger.ZLogger) (tlsConfig *tls.Config, l Loader, err error)

func NewDevLoader

func NewDevLoader(certChannel chan *tls.Certificate, client bool, useSystemCertPool bool, interval time.Duration) (Loader, error)

type MiniVaultConfig added in v2.0.1

type MiniVaultConfig struct {
	BaseURL       string                   `json:"baseurl,omitempty" toml:"baseurl"`
	ParentToken   string                   `json:"parenttoken,omitempty" toml:"parenttoken"`
	TokenType     string                   `json:"tokentype,omitempty" toml:"tokentype"`
	TokenPolicies []string                 `json:"tokenpolicies,omitempty" toml:"tokenpolicies"`
	TokenInterval configutil.Duration      `json:"tokeninterval,omitempty" toml:"tokeninterval"`
	CertType      string                   `json:"certtype,omitempty" toml:"certtype"`
	URIs          []string                 `json:"uris,omitempty" toml:"uris"`
	DNSs          []string                 `json:"dnss,omitempty" toml:"dnss"`
	CertInterval  configutil.Duration      `json:"certinterval,omitempty" toml:"certinterval"`
	Certificates  []configutil.Certificate `json:"certificates,omitempty" toml:"certificates"`
	CA            []configutil.Certificate `json:"ca,omitempty" toml:"ca"`
	UseSystemPool bool                     `json:"usesystempool,omitempty" toml:"usesystempool"`
}

type MiniVaultLoader

type MiniVaultLoader struct {
	// contains filtered or unexported fields
}

func NewMiniVaultLoader

func NewMiniVaultLoader(baseURL, parentToken, tokenType string, tokenPolicies []string, tokenInterval time.Duration, certType string, uris, dnss []string, certInterval time.Duration, vaultCertPool *x509.CertPool, logger zLogger.ZLogger) (*MiniVaultLoader, error)

func (*MiniVaultLoader) Close

func (f *MiniVaultLoader) Close() error

func (*MiniVaultLoader) GetCA added in v2.0.1

func (f *MiniVaultLoader) GetCA() *x509.CertPool

func (*MiniVaultLoader) Run

func (f *MiniVaultLoader) Run() error

type TokenCreateStruct added in v2.0.1

type TokenCreateStruct struct {
	Type      string            `json:"type" example:"client_cert"`
	Policies  []string          `json:"Policies" example:"policy1,policy2"`
	Meta      map[string]string `json:"meta" example:"key1:value1,key2:value2"`
	TTL       string            `json:"ttl" example:"1h"`
	Renewable bool              `json:"renewable" example:"false"`
}

Jump to

Keyboard shortcuts

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