bouncer/internal/config/layers.go

47 lines
1.2 KiB
Go
Raw Normal View History

package config
import "time"
type LayersConfig struct {
Queue QueueLayerConfig `yaml:"queue"`
Authn AuthnLayerConfig `yaml:"authn"`
}
func NewDefaultLayersConfig() LayersConfig {
return LayersConfig{
Queue: QueueLayerConfig{
TemplateDir: "./layers/queue/templates",
DefaultKeepAlive: NewInterpolatedDuration(time.Minute),
},
Authn: AuthnLayerConfig{
TemplateDir: "./layers/authn/templates",
OIDC: AuthnOIDCLayerConfig{
HTTPClient: AuthnOIDCHTTPClientConfig{
TransportConfig: NewDefaultTransportConfig(),
Timeout: NewInterpolatedDuration(10 * time.Second),
},
},
2023-07-06 03:19:45 +02:00
},
}
}
type QueueLayerConfig struct {
TemplateDir InterpolatedString `yaml:"templateDir"`
DefaultKeepAlive *InterpolatedDuration `yaml:"defaultKeepAlive"`
}
2023-07-06 03:19:45 +02:00
type AuthnLayerConfig struct {
Debug InterpolatedBool `yaml:"debug"`
TemplateDir InterpolatedString `yaml:"templateDir"`
OIDC AuthnOIDCLayerConfig `yaml:"oidc"`
}
type AuthnOIDCLayerConfig struct {
HTTPClient AuthnOIDCHTTPClientConfig `yaml:"httpClient"`
}
type AuthnOIDCHTTPClientConfig struct {
TransportConfig
Timeout *InterpolatedDuration `yaml:"timeout"`
2023-07-06 03:19:45 +02:00
}