config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultForwardHeaders = map[string]oidfed.SliceOrSingleValue[model.Claim]{
	"X-Forwarded-User": {
		"preferred_username",
		"sub",
	},
	"X-Forwarded-Email":    {"email"},
	"X-Forwarded-Provider": {"iss"},
	"X-Forwarded-Subject":  {"sub"},
	"X-Forwarded-Groups": {
		"entitlements",
		"groups",
	},
	"X-Forwarded-Name": {"name"},
}
View Source
var DefaultMemCachedClaims = map[string]oidfed.SliceOrSingleValue[model.Claim]{
	"UserName": {
		"preferred_username",
		"sub",
	},
	"Groups":    {"groups"},
	"Email":     {"email"},
	"Name":      {"name"},
	"GivenName": {"given_name"},
	"Provider":  {"iss"},
	"Subject":   {"sub"},
}

Functions

func MustLoadConfig

func MustLoadConfig()

Types

type AuthRule

type AuthRule struct {
	Domain               string                                                                       `yaml:"domain"`
	DomainRegex          string                                                                       `yaml:"domain_regex"`
	DomainPattern        *regexp.Regexp                                                               `yaml:"-"`
	Path                 string                                                                       `yaml:"path"`
	PathRegex            string                                                                       `yaml:"path_regex"`
	PathPattern          *regexp.Regexp                                                               `yaml:"-"`
	Require              oidfed.SliceOrSingleValue[map[model.Claim]oidfed.SliceOrSingleValue[string]] `yaml:"require"`
	ForwardHeaders       map[string]oidfed.SliceOrSingleValue[model.Claim]                            `yaml:"forward_headers"`
	ForwardHeadersPrefix string                                                                       `yaml:"forward_headers_prefix"`
	RedirectStatusCode   int                                                                          `yaml:"redirect_status"`
}

type Config

type Config struct {
	Server         serverConf      `yaml:"server"`
	Logging        loggingConf     `yaml:"logging"`
	Federation     federationConf  `yaml:"federation"`
	Auth           authConf        `yaml:"auth"`
	SessionStorage sessionConf     `yaml:"sessions"`
	Signing        signingConf     `yaml:"signing"`
	DebugAuth      bool            `yaml:"debug_auth"`
	OPDiscovery    opDiscoveryConf `yaml:"op_discovery"`
}

Config holds the configuration for this application

func Get

func Get() *Config

Get returns the Config

type LoggerConf

type LoggerConf struct {
	Dir    string `yaml:"dir"`
	StdErr bool   `yaml:"stderr"`
}

LoggerConf holds configuration related to logging

Jump to

Keyboard shortcuts

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