v1

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewV2Config added in v1.2.0

func NewV2Config(v1Cfg *Config) (*config_v2.Config, error)

NewV2Config translates v1 Config (composed of listeners and handlers) to a v2 Config (composed of Services).

Types

type Config

type Config struct {
	Listeners []Listener
	Handlers  []Handler
}

Config is the main configuration structure for Secretless. It lists and configures the protocol listeners and handlers.

func NewConfig

func NewConfig(buffer []byte) (*Config, error)

NewConfig takes the bytes of a file and returns a new Config.

func (Config) String

func (c Config) String() string

func (Config) Validate

func (c Config) Validate() error

Validate verifies the completeness and correctness of the Config.

type Handler

type Handler struct {
	Name         string
	Type         string
	ListenerName string `yaml:"listener"`
	Debug        bool
	Match        []string         `yaml:"match"`
	Patterns     []*regexp.Regexp `yaml:"-"`
	Credentials  []StoredSecret
}

Handler processes an inbound message and connects to a specified backend using Credentials which it fetches from a provider.

func (Handler) HasCredential

func (h Handler) HasCredential(credentialName string) bool

HasCredential indicates whether a Handler has the specified credential.

func (Handler) Validate

func (h Handler) Validate() (err error)

Validate verifies the completeness and correctness of the Handler.

type Listener

type Listener struct {
	Address     string
	CACertFiles []string `yaml:"caCertFiles"`
	Debug       bool
	Name        string
	Protocol    string
	Socket      string
}

Listener listens on a port on socket for inbound connections, which are handed off to Handlers.

func (Listener) LinkedHandlers

func (l Listener) LinkedHandlers(handlers []Handler) []Handler

LinkedHandlers filters the handlers passed to it, returning only those attached to this Listener

func (Listener) Validate

func (l Listener) Validate() error

Validate validates the Listener

type StoredSecret

type StoredSecret struct {
	// How client code will refer to the secret's actual value at runtime.
	// Specifically, the key to the secret's value in the map[string][]byte
	// returned by a Resolver.
	Name     string
	Provider string
	// The identifier within the context of a Provider.  Ie, how a provider
	// refers to this secret.  Eg, a database primary key.
	ID string
}

StoredSecret represents not the value of a "secret," but the abstract concept of "a secret stored somewhere".

Note that "Name" will be the key that maps to this secret's actual value in the map[string][]byte when the "StoredSecret" itself is looked up by a Resolver.

Jump to

Keyboard shortcuts

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