46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
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),
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
type QueueLayerConfig struct {
|
|
TemplateDir InterpolatedString `yaml:"templateDir"`
|
|
DefaultKeepAlive *InterpolatedDuration `yaml:"defaultKeepAlive"`
|
|
}
|
|
|
|
type AuthnLayerConfig struct {
|
|
TemplateDir InterpolatedString `yaml:"templateDir"`
|
|
OIDC AuthnOIDCLayerConfig `yaml:"oidc"`
|
|
}
|
|
|
|
type AuthnOIDCLayerConfig struct {
|
|
HTTPClient AuthnOIDCHTTPClientConfig `yaml:"httpClient"`
|
|
}
|
|
|
|
type AuthnOIDCHTTPClientConfig struct {
|
|
TransportConfig
|
|
Timeout *InterpolatedDuration `yaml:"timeout"`
|
|
}
|