config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SignerProxy     SignerProxyConfig     `yaml:"signer_proxy"`
	VerifierProxies []VerifierProxyConfig `yaml:"verifier_proxies"`
}

Config is the global configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig is a configuration that can be used as a fallback value.

func Load

func Load(path string) (config *Config, err error)

Load is a shortcut to open a file, read it, and generate a Config. It supports relative and absolute paths. Given "", it returns DefaultConfig.

type DefaultVerifierProxyConfig

type DefaultVerifierProxyConfig VerifierProxyConfig

type RegistrableComponentConfig

type RegistrableComponentConfig struct {
	Type    string                 `yaml:"type"`
	Options map[string]interface{} `yaml:"options"`
}

type SignerConfig

type SignerConfig struct {
	SignerParams `yaml:",inline"`
	PrivateKey   RegistrableComponentConfig `yaml:"private_key"`
}

type SignerParams

type SignerParams struct {
	Issuer         string        `yaml:"issuer"`
	ExpirationTime time.Duration `yaml:"expiration_time"`
	MaxSkew        time.Duration `yaml:"max_skew"`
	NonceLength    int           `yaml:"nonce_length"`
}

type SignerProxyConfig

type SignerProxyConfig struct {
	Enabled             bool          `yaml:"enabled"`
	ListenAddr          string        `yaml:"listen_addr"`
	ShutdownTimeout     time.Duration `yaml:"shutdown_timeout"`
	CAKeyFile           string        `yaml:"ca_key_file"`
	CACrtFile           string        `yaml:"ca_crt_file"`
	TrustedCertificates []string      `yaml:"trusted_certificates"`
	Signer              SignerConfig  `yaml:"signer"`
}

type URL

type URL struct {
	*url.URL
}

URL is a custom URL type that allows validation at configuration load time.

func (URL) MarshalYAML

func (u URL) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface for URLs.

func (*URL) UnmarshalYAML

func (u *URL) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for URLs.

type VerifierConfig

type VerifierConfig struct {
	Upstream        URL                          `yaml:"upstream"`
	Audience        URL                          `yaml:"audience"`
	MaxSkew         time.Duration                `yaml:"max_skew"`
	MaxTTL          time.Duration                `yaml:"max_ttl"`
	KeyServer       RegistrableComponentConfig   `yaml:"key_server"`
	NonceStorage    RegistrableComponentConfig   `yaml:"nonce_storage"`
	ClaimsVerifiers []RegistrableComponentConfig `yaml:"claims_verifiers"`
}

type VerifierProxyConfig

type VerifierProxyConfig struct {
	Enabled         bool           `yaml:"enabled"`
	ListenAddr      string         `yaml:"listen_addr"`
	ShutdownTimeout time.Duration  `yaml:"shutdown_timeout"`
	CrtFile         string         `yaml:"crt_file"`
	KeyFile         string         `yaml:"key_file"`
	Verifier        VerifierConfig `yaml:"verifier"`
}

func (*VerifierProxyConfig) UnmarshalYAML

func (cfg *VerifierProxyConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for URLs.

Jump to

Keyboard shortcuts

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