config

package
v0.0.0-...-8419e78 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: BSD-3-Clause Imports: 7 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 {
	Maintenance  bool                `default:"false"`
	BindAddr     string              `split_words:"true" default:":443"`
	Mode         string              `default:"release"`
	LogLevel     logger.LevelDecoder `split_words:"true" default:"info"`
	ConsoleLog   bool                `split_words:"true" default:"false"`
	AllowOrigins []string            `split_words:"true" default:"https://yubikey.local"`
	WebAuthn     WebAuthnConfig      `split_words:"true"`
	TLS          TLSConfig
	// contains filtered or unexported fields
}

func New

func New() (conf Config, err error)

func (Config) GetLogLevel

func (c Config) GetLogLevel() zerolog.Level

func (Config) IsZero

func (c Config) IsZero() bool

Returns true if the config has not been correctly processed from the environment.

func (Config) Validate

func (c Config) Validate() (err error)

Custom validations are added here, particularly validations that require one or more fields to be processed before the validation occurs. NOTE: ensure that all nested config validation methods are called here.

type TLSConfig

type TLSConfig struct {
	UseTLS   bool   `split_words:"true" default:"false"`
	CertFile string `split_words:"true" default:"tmp/server.crt"`
	KeyFile  string `split_words:"true" default:"tmp/server.key"`
}

func (TLSConfig) Config

func (c TLSConfig) Config() *tls.Config

type WebAuthnConfig

type WebAuthnConfig struct {
	RPID        string   `default:"yubikey.local"`
	DisplayName string   `split_words:"true" default:"Yubikey Authn Debugger"`
	Origins     []string `default:"https://yubikey.local"`
}

func (WebAuthnConfig) Config

func (c WebAuthnConfig) Config() *webauthn.Config

Jump to

Keyboard shortcuts

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