loader

package
v2.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 19 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACMEConfig

type ACMEConfig struct {
	CacheFolder   string   `json:"cachefolder,omitempty" toml:"cachefolder"`
	Email         string   `json:"email,omitempty" toml:"email"`
	HostWhitelist []string `json:"hostwhitelist,omitempty" toml:"hostwhitelist"`
}

type ACMELoader

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

func NewACMELoader

func NewACMELoader(_ chan *tls.Certificate, conf *ACMEConfig) (*ACMELoader, error)

func (*ACMELoader) Close

func (al *ACMELoader) Close() error

func (ACMELoader) GetCA

func (al ACMELoader) GetCA() (*x509.CertPool, error)

func (*ACMELoader) GetTLSConfig

func (al *ACMELoader) GetTLSConfig() (*tls.Config, error)

func (*ACMELoader) Run

func (al *ACMELoader) Run() error

type CertCreateStruct

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

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

type Config

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"`
	Dev   *DevConfig       `json:"dev,omitempty" toml:"dev"`
	ACME  *ACMEConfig      `json:"acme,omitempty" toml:"acme"`
	//CA             []configtrust.Certificate `json:"ca,omitempty" toml:"ca"`
	//UseSystemPool  bool                `json:"usesystempool,omitempty" toml:"usesystempool"`
	InitialTimeout configutil.Duration `json:"initialtimeout,omitempty" toml:"initialtimeout"`
	TLSMinVersion  string              `json:"tlsminversion,omitempty" toml:"tlsminversion"`
	TLSMaxVersion  string              `json:"tlsmaxversion,omitempty" toml:"tlsmaxversion"`
}

type DevConfig

type DevConfig struct {
	Interval      configutil.Duration `json:"interval,omitempty" toml:"interval"`
	UseSystemPool bool                `json:"usesystempool,omitempty" toml:"usesystempool"`
}

type EnvConfig

type EnvConfig struct {
	Cert          string                    `json:"cert,omitempty" toml:"cert"`
	Key           string                    `json:"key,omitempty" toml:"key"`
	Interval      configutil.Duration       `json:"interval,omitempty" toml:"interval"`
	CA            []configtrust.Certificate `json:"ca,omitempty" toml:"ca"`
	UseSystemPool bool                      `json:"usesystempool,omitempty" toml:"usesystempool"`
}

type EnvLoader

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

func NewEnvLoader

func NewEnvLoader(certChannel chan *tls.Certificate, conf *EnvConfig, logger zLogger.ZLogger) (*EnvLoader, error)

func (*EnvLoader) Close

func (f *EnvLoader) Close() error

func (*EnvLoader) GetCA

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

func (*EnvLoader) GetTLSConfig

func (f *EnvLoader) GetTLSConfig() (*tls.Config, error)

func (*EnvLoader) Run

func (f *EnvLoader) Run() error

type FileConfig

type FileConfig struct {
	Cert          string                    `json:"cert,omitempty" toml:"cert"`
	Key           string                    `json:"key,omitempty" toml:"key"`
	Interval      configutil.Duration       `json:"interval,omitempty" toml:"interval"`
	CA            []configtrust.Certificate `json:"ca,omitempty" toml:"ca"`
	UseSystemPool bool                      `json:"usesystempool,omitempty" toml:"usesystempool"`
}

type FileLoader

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

func NewFileLoader

func NewFileLoader(certChannel chan *tls.Certificate, conf *FileConfig, logger zLogger.ZLogger) (*FileLoader, error)

func (*FileLoader) Close

func (f *FileLoader) Close() error

func (*FileLoader) GetCA

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

func (*FileLoader) GetTLSConfig

func (f *FileLoader) GetTLSConfig() (*tls.Config, error)

func (*FileLoader) Run

func (f *FileLoader) Run() error

type Loader

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

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, conf *DevConfig, logger zLogger.ZLogger) (Loader, error)

type MiniVaultConfig

type MiniVaultConfig struct {
	BaseURL       string               `json:"baseurl,omitempty" toml:"baseurl"`
	ParentToken   configutil.EnvString `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"`
	TokenTTL      configutil.Duration  `json:"tokenttl,omitempty" toml:"tokenttl"`
	CertType      string               `json:"certtype,omitempty" toml:"certtype"`
	URIs          []string             `json:"uris,omitempty" toml:"uris"`
	DNSs          []string             `json:"dnss,omitempty" toml:"dnss"`
	IPs           []string             `json:"ips,omitempty" toml:"ips"`
	CertInterval  configutil.Duration  `json:"certinterval,omitempty" toml:"certinterval"`
	CertTTL       configutil.Duration  `json:"certttl,omitempty" toml:"certttl"`
	//Certificates  []configtrust.Certificate `json:"certificates,omitempty" toml:"certificates"`
	CA            []configtrust.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(
	certChannel chan *tls.Certificate,
	conf *MiniVaultConfig,
	logger zLogger.ZLogger,
) (*MiniVaultLoader, error)

func (*MiniVaultLoader) Close

func (f *MiniVaultLoader) Close() error

func (*MiniVaultLoader) GetCA

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

func (*MiniVaultLoader) GetTLSConfig

func (f *MiniVaultLoader) GetTLSConfig() (*tls.Config, error)

func (*MiniVaultLoader) Run

func (f *MiniVaultLoader) Run() error

type TokenCreateStruct

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"`
	MaxTTL    string            `json:"maxttl" example:"3h"`
	Renewable bool              `json:"renewable" example:"false"`
}

Jump to

Keyboard shortcuts

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