config

package
v0.0.0-...-28aa561 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(ko *koanf.Koanf, data any) (err error)

Types

type Configuration

type Configuration struct {
	AutheliaURL *URL   `koanf:"authelia_url" json:"authelia_url,omitempty" yaml:"authelia_url,omitempty" toml:"authelia_url,omitempty"`
	Storage     string `koanf:"storage" json:"storage,omitempty" yaml:"storage,omitempty" toml:"storage,omitempty"`
	OAuth2      OAuth2 `koanf:"oauth2" json:"oauth2" yaml:"oauth2" toml:"oauth2"`
	Server      Server `koanf:"server" json:"server" yaml:"server" toml:"server"`
}

func Load

func Load(paths []string, flags *pflag.FlagSet, flagsPrefix string) (config *Configuration, err error)

Load the configuration.

func (*Configuration) Save

func (config *Configuration) Save(path string) (err error)

func (*Configuration) Validate

func (config *Configuration) Validate() (err error)

type OAuth2

type OAuth2 struct {
	DefaultClient string        `koanf:"default_client" json:"default_client,omitempty" yaml:"default_client,omitempty" toml:"default_client,omitempty"`
	Clients       OAuth2Clients `koanf:"clients" json:"clients" yaml:"clients" toml:"clients"`
}

func (*OAuth2) Validate

func (config *OAuth2) Validate() (err error)

type OAuth2Client

type OAuth2Client struct {
	ID                      string   `koanf:"id" json:"id" yaml:"id" toml:"id"`
	Secret                  string   `koanf:"secret" json:"secret" yaml:"secret" toml:"secret"`
	PAR                     bool     `koanf:"par" json:"par" yaml:"par" toml:"par"`
	Audience                []string `koanf:"audience" json:"audience" yaml:"audience" toml:"audience"`
	Scope                   []string `koanf:"scope" json:"scope" yaml:"scope" toml:"scope"`
	GrantType               string   `koanf:"grant_type" json:"grant_type" yaml:"grant_type" toml:"grant_type"`
	TokenEndpointAuthMethod string   `` /* 136-byte string literal not displayed */
	OfflineAccess           bool     `koanf:"offline_access" json:"offline_access" yaml:"offline_access" toml:"offline_access"`
}

func (*OAuth2Client) Validate

func (config *OAuth2Client) Validate() (err error)

type OAuth2Clients

type OAuth2Clients map[string]OAuth2Client

func (OAuth2Clients) Validate

func (config OAuth2Clients) Validate() (err error)

type Server

type Server struct {
	Port uint16 `koanf:"port" json:"port" yaml:"port" toml:"port"`
}

type URL

type URL url.URL

func NewURL

func NewURL(in *url.URL) *URL

func (*URL) MarshalText

func (u *URL) MarshalText() (text []byte, err error)

Jump to

Keyboard shortcuts

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