config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagSet added in v1.0.0

func FlagSet() *flag.FlagSet

func Validate added in v1.0.0

func Validate(conf *Config) error

Types

type Config

type Config struct {
	ConfigFile string   `koanf:"config"`
	Log        *Log     `koanf:"log"`
	Http       *Http    `koanf:"http"`
	OpenVpn    *OpenVpn `koanf:"openvpn"`
	Oauth2     *OAuth2  `koanf:"oauth2"`
}

type Http added in v1.0.0

type Http struct {
	Listen               string `koanf:"listen"`
	CertFile             string `koanf:"cert"`
	KeyFile              string `koanf:"key"`
	Tls                  bool   `koanf:"tls"`
	BaseUrl              string `koanf:"baseurl"`
	Secret               string `koanf:"secret"`
	CallbackTemplate     *template.Template
	CallbackTemplatePath string `koanf:"callback_template_path"`
}

type Log added in v1.0.0

type Log struct {
	Format string `koanf:"format"`
	Level  string `koanf:"level"`
}

type OAuth2 added in v1.0.0

type OAuth2 struct {
	Issuer    string           `koanf:"issuer"`
	Provider  string           `koanf:"provider"`
	Endpoints *OAuth2Endpoints `koanf:"endpoint"`
	Client    *OAuth2Client    `koanf:"client"`
	Scopes    []string         `koanf:"scopes"`
	Pkce      bool             `koanf:"pkce"`
	Validate  *OAuth2Validate  `koanf:"validate"`
}

type OAuth2Client added in v1.0.0

type OAuth2Client struct {
	Id     string `koanf:"id"`
	Secret string `koanf:"secret"`
}

type OAuth2Endpoints added in v1.2.0

type OAuth2Endpoints struct {
	Discovery string `koanf:"discovery"`
	Auth      string `koanf:"auth"`
	Token     string `koanf:"token"`
}

type OAuth2Validate added in v1.0.0

type OAuth2Validate struct {
	Groups     []string `koanf:"groups"`
	Roles      []string `koanf:"roles"`
	IpAddr     bool     `koanf:"ipaddr"`
	Issuer     bool     `koanf:"issuer"`
	CommonName string   `koanf:"common_name"`
}

type OpenVpn added in v1.0.0

type OpenVpn struct {
	Addr     string         `koanf:"addr"`
	Password string         `koanf:"password"`
	Bypass   *OpenVpnBypass `koanf:"bypass"`
}

type OpenVpnBypass added in v1.1.0

type OpenVpnBypass struct {
	CommonNames []string `koanf:"cn"`
}

Jump to

Keyboard shortcuts

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