config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoIDPConfigured = errors.New("at least one IDP must be configured")

Functions

This section is empty.

Types

type Config

type Config struct {
	Proxy struct {
		EntityID                    string     `env:"ENTITY_ID"                      envDefault:"http://localhost:8080"`
		PrivateKeyPath              string     `env:"PRIVATE_KEY_PATH,required"`
		CertificatePath             string     `env:"CERTIFICATE_PATH,required"`
		RequireSignedLogoutRequests bool       `env:"REQUIRE_SIGNED_LOGOUT_REQUESTS" envDefault:"false"`
		AllowedSP                   []SPConfig `envPrefix:"ALLOWED_SP_"`
	} `envPrefix:"PROXY_"`

	IDP []IDPConfig `envPrefix:"IDP_"`

	Server struct {
		ListenAddress string `env:"LISTEN_ADDRESS" envDefault:":8080"`
	} `envPrefix:"SERVER_"`

	Metadata struct {
		MaxRetries   int           `env:"MAX_RETRIES"   envDefault:"5"`
		InitialDelay time.Duration `env:"INITIAL_DELAY" envDefault:"1s"`
		MaxDelay     time.Duration `env:"MAX_DELAY"     envDefault:"30s"`
	} `envPrefix:"METADATA_"`

	SLO struct {
		ContextTimeout time.Duration `env:"CONTEXT_TIMEOUT" envDefault:"5m"`
	} `envPrefix:"SLO_"`
}

Config holds all the configuration parameters for the SAML proxy.

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads configuration from environment variables.

type IDPConfig

type IDPConfig struct {
	ID              string `env:"ID,required"`
	EntityID        string `env:"ENTITY_ID"`
	SSOURL          string `env:"SSO_URL"`
	CertificatePath string `env:"CERTIFICATE_PATH"`
	MetadataURL     string `env:"METADATA_URL"`
}

IDPConfig holds the configuration for a single Identity Provider.

type SPConfig

type SPConfig struct {
	EntityID                    string `env:"ENTITY_ID"`
	AcsURL                      string `env:"ACS_URL"`
	MetadataURL                 string `env:"METADATA_URL"`
	RequireSignedLogoutRequests bool   `env:"REQUIRE_SIGNED_LOGOUT_REQUESTS" envDefault:"false"`
}

Jump to

Keyboard shortcuts

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