2023-06-13 03:57:13 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
type LayersConfig struct {
|
2024-05-17 17:29:26 +02:00
|
|
|
Queue QueueLayerConfig `yaml:"queue"`
|
|
|
|
Authn AuthnLayerConfig `yaml:"authn"`
|
2023-06-13 03:57:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewDefaultLayersConfig() LayersConfig {
|
|
|
|
return LayersConfig{
|
|
|
|
Queue: QueueLayerConfig{
|
|
|
|
TemplateDir: "./layers/queue/templates",
|
|
|
|
DefaultKeepAlive: NewInterpolatedDuration(time.Minute),
|
|
|
|
},
|
2024-05-17 17:29:26 +02:00
|
|
|
Authn: AuthnLayerConfig{
|
|
|
|
TemplateDir: "./layers/authn/templates",
|
2024-05-23 15:17:05 +02:00
|
|
|
OIDC: AuthnOIDCLayerConfig{
|
|
|
|
HTTPClient: AuthnOIDCHTTPClientConfig{
|
|
|
|
TransportConfig: NewDefaultTransportConfig(),
|
|
|
|
Timeout: NewInterpolatedDuration(10 * time.Second),
|
|
|
|
},
|
|
|
|
},
|
2023-07-06 03:19:45 +02:00
|
|
|
},
|
2023-06-13 03:57:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type QueueLayerConfig struct {
|
|
|
|
TemplateDir InterpolatedString `yaml:"templateDir"`
|
|
|
|
DefaultKeepAlive *InterpolatedDuration `yaml:"defaultKeepAlive"`
|
|
|
|
}
|
2023-07-06 03:19:45 +02:00
|
|
|
|
2024-05-17 17:29:26 +02:00
|
|
|
type AuthnLayerConfig struct {
|
2024-06-05 15:46:59 +02:00
|
|
|
Debug InterpolatedBool `yaml:"debug"`
|
2024-05-23 15:17:05 +02:00
|
|
|
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
|
|
|
}
|