config

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACSConfig added in v0.2.11

type ACSConfig struct {
	DeliveryMode   string `yaml:"deliveryMode"`
	CookieName     string `yaml:"cookieName"`
	CookieDomain   string `yaml:"cookieDomain"`
	CookieSameSite string `yaml:"cookieSameSite"`
	CookieSecure   bool   `yaml:"cookieSecure"`
	SessionTTL     int    `yaml:"sessionTTL"`
}

ACSConfig holds Assertion Consumer Service settings.

type Config

type Config struct {
	Port            int        `yaml:"port"`
	RedisAddr       string     `yaml:"redisAddr"`
	RedisHost       string     `yaml:"redisHost"`
	RedisPort       int        `yaml:"redisPort"`
	RedisDB         int        `yaml:"redisDb"`
	RedisPassword   string     `yaml:"redisPassword"`
	RedisURL        string     `yaml:"redisUrl"`
	JwtSecret       string     `yaml:"jwtSecret"`
	ApiKey          string     `yaml:"apiKey"`
	IssuerBaseURL   string     `yaml:"issuerBaseUrl"`
	DefaultAudience string     `yaml:"defaultAudience"`
	JwksPrivateKey  string     `yaml:"jwksPrivateKey"`
	JwksKeyID       string     `yaml:"jwksKeyId"`
	SAML            SAMLConfig `yaml:"saml"`
}

Config captures runtime parameters loaded from YAML or the environment.

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

LoadConfig reads a YAML file, expands environment variables, and returns Config defaults.

type DiscoverConfig added in v0.2.11

type DiscoverConfig struct {
	Enabled      bool   `yaml:"enabled"`
	ProtocolType string `yaml:"protocolType"`
	ServiceURL   string `yaml:"serviceURL"`
}

DiscoverConfig holds IdP discovery settings.

type IdPSectionConfig added in v0.2.11

type IdPSectionConfig struct {
	MetadataURL        string        `yaml:"metadataURL"`
	MetadataPath       string        `yaml:"metadataPath"`
	RefreshInterval    time.Duration `yaml:"-"`
	TrustedCertPaths   []string      `yaml:"trustedCertPaths"`
	SkipSignatureCheck bool          `yaml:"skipSignatureCheck"`
}

IdPSectionConfig holds Identity Provider settings.

func (*IdPSectionConfig) UnmarshalYAML added in v0.2.11

func (i *IdPSectionConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML converts refreshIntervalHours from integer hours into a time.Duration value.

type MetricsConfig added in v0.2.11

type MetricsConfig struct {
	Enabled   bool   `yaml:"enabled"`
	Namespace string `yaml:"namespace"`
}

MetricsConfig holds SAML metrics settings.

type SAMLConfig added in v0.2.11

type SAMLConfig struct {
	Enabled  bool             `yaml:"enabled"`
	SP       SPConfig         `yaml:"sp"`
	ACS      ACSConfig        `yaml:"acs"`
	IdP      IdPSectionConfig `yaml:"idp"`
	Discover DiscoverConfig   `yaml:"discover"`
	Metrics  MetricsConfig    `yaml:"metrics"`
}

SAMLConfig holds top-level SAML integration settings.

func (SAMLConfig) Validate added in v0.2.11

func (s SAMLConfig) Validate() error

Validate checks SAMLConfig invariants. When SAML is enabled the SP must provide signing key/cert paths, entityID, and acsURL.

type SPConfig added in v0.2.11

type SPConfig struct {
	EntityID                  string        `yaml:"entityID"`
	ACSURL                    string        `yaml:"acsURL"`
	SLOURL                    string        `yaml:"sloURL"`
	SigningKeyPath            string        `yaml:"signingKeyPath"`
	SigningCertPath           string        `yaml:"signingCertPath"`
	EncryptionKeyPath         string        `yaml:"encryptionKeyPath"`
	EncryptionCertPath        string        `yaml:"encryptionCertPath"`
	KeyBits                   int           `yaml:"keyBits"`
	ClockSkew                 time.Duration `yaml:"-"`
	RequestTTL                time.Duration `yaml:"-"`
	AllowedSigAlgs            []string      `yaml:"allowedSigAlgs"`
	AllowedDigestAlgs         []string      `yaml:"allowedDigestAlgs"`
	Canonicalization          string        `yaml:"canonicalization"`
	WatchFile                 bool          `yaml:"watchFile"`
	RequireAssertionSigned    bool          `yaml:"requireAssertionSigned"`
	RequireEncryptedAssertion bool          `yaml:"requireEncryptedAssertion"`
}

SPConfig holds SAML Service Provider parameters.

func (*SPConfig) UnmarshalYAML added in v0.2.11

func (s *SPConfig) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML converts clockSkewSeconds and requestTTLSeconds from integer seconds into time.Duration values.

Jump to

Keyboard shortcuts

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