config

package
v0.3.31 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ClientCertificatesNotFoundError = Error("could not find client certificates")
View Source
const EmbeddedConfigDisabledError = Error("embedded config is disabled")
View Source
const HomeDirectoryError = Error("could not resolve user's home directory")
View Source
const MissingTLSConfigError = Error("missing required mTLS configuration")
View Source
const UnsupportedOSError = Error("running on unsupported operating system")

Variables

View Source
var (
	EmbeddedConfigs    embed.FS
	EmbeddedConfigFile string // To be set by ldflags at compile time
)

Functions

func BaseWebURL

func BaseWebURL() string

BaseWebURL allows the ConsoleMe URL to be overridden for cases where the API and UI are accessed via different URLs

func InitConfig

func InitConfig(filename string) error

initConfig reads in configs by precedence, with later configs overriding earlier:

  • embedded
  • /etc/weep/weep.yaml
  • ~/.weep/weep.yaml
  • ./weep.yaml

If a config file is specified via CLI arg, it will be read exclusively and not merged with other configuration.

func MergeExtraConfigFile added in v0.3.17

func MergeExtraConfigFile(extraConfigFile string) error

func MtlsEnabled

func MtlsEnabled() bool

func ReadEmbeddedConfig

func ReadEmbeddedConfig() error

ReadEmbeddedConfig attempts to read the embedded mTLS config and create a tls.Config

func SetUser

func SetUser(user string) error

SetUser saves the provided username to ~/.weep/weep.yaml

Types

type ChallengeSettings

type ChallengeSettings struct {
	User string `mapstructure:"user"`
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type MetaDataConfig

type MetaDataConfig struct {
	Routes []MetaDataPath `mapstructure:"routes"`
}

type MetaDataPath

type MetaDataPath struct {
	Path string `mapstructure:"path"`
	Data string `mapstructure:"data"`
}

type MtlsSettings

type MtlsSettings struct {
	Cert     string   `mapstructure:"cert"`
	Key      string   `mapstructure:"key"`
	CATrust  string   `mapstructure:"catrust"`
	Insecure bool     `mapstructure:"insecure"`
	Darwin   []string `mapstructure:"darwin"`
	Linux    []string `mapstructure:"linux"`
	Windows  []string `mapstructure:"windows"`
}

type WeepConfig

type WeepConfig struct {
	MetaData             MetaDataConfig    `mapstructure:"metadata"`
	ConsoleMeUrl         string            `mapstructure:"consoleme_url"`
	MtlsSettings         MtlsSettings      `mapstructure:"mtls_settings"`
	ChallengeSettings    ChallengeSettings `mapstructure:"challenge_settings"`
	AuthenticationMethod string            `mapstructure:"authentication_method"`
}
var (
	Config WeepConfig
)

Jump to

Keyboard shortcuts

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