bouncer/internal/config/admin_server.go
William Petit aab5452fa2
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: sentry integration
ref #3
2023-07-05 12:05:30 -06:00

32 lines
782 B
Go

package config
type AdminServerConfig struct {
HTTP HTTPConfig `yaml:"http"`
CORS CORSConfig `yaml:"cors"`
Auth AuthConfig `yaml:"auth"`
Metrics MetricsConfig `yaml:"metrics"`
Sentry SentryConfig `yaml:"sentry"`
}
func NewDefaultAdminServerConfig() AdminServerConfig {
return AdminServerConfig{
HTTP: NewHTTPConfig("127.0.0.1", 8081),
CORS: NewDefaultCORSConfig(),
Auth: NewDefaultAuthConfig(),
Metrics: NewDefaultMetricsConfig(),
Sentry: NewDefaultSentryConfig(),
}
}
type AuthConfig struct {
Issuer InterpolatedString `yaml:"issuer"`
PrivateKey InterpolatedString `yaml:"privateKey"`
}
func NewDefaultAuthConfig() AuthConfig {
return AuthConfig{
Issuer: "http://127.0.0.1:8081",
PrivateKey: "admin-key.json",
}
}