Documentation ¶
Index ¶
- Constants
- func OidcKeySet() []*rsa.PublicKey
- func Validate(conf *Application, logFunc func(format string, v ...interface{})) error
- type Application
- type CorsConfig
- type DatabaseConfig
- type DatabaseType
- type FixedTokenConfig
- type LogStyle
- type LoggingConfig
- type OpenIdConnectConfig
- type SecurityConfig
- type ServerConfig
- type ServiceConfig
Constants ¶
View Source
const ( Mysql DatabaseType = "mysql" Inmemory DatabaseType = "inmemory" Plain LogStyle = "plain" ECS LogStyle = "ecs" // default )
Variables ¶
This section is empty.
Functions ¶
func OidcKeySet ¶
func Validate ¶
func Validate(conf *Application, logFunc func(format string, v ...interface{})) error
Types ¶
type Application ¶
type Application struct { Service ServiceConfig `yaml:"service"` Server ServerConfig `yaml:"server"` Database DatabaseConfig `yaml:"database"` Security SecurityConfig `yaml:"security"` Logging LoggingConfig `yaml:"logging"` }
Application is the root configuration type that holds all other subconfiguration types
func GetApplicationConfig ¶
func GetApplicationConfig() (*Application, error)
func UnmarshalFromYamlConfiguration ¶
func UnmarshalFromYamlConfiguration(file io.Reader) (*Application, error)
UnmarshalFromYamlConfiguration decodes yaml data from an `io.Reader` interface.
type CorsConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Use DatabaseType `yaml:"use"` Username string `yaml:"username"` Password string `yaml:"password"` Database string `yaml:"database"` Parameters []string `yaml:"parameters"` }
DatabaseConfig configures which db to use (mysql, inmemory) and how to connect to it (needed for mysql only)
type DatabaseType ¶
type DatabaseType string
type FixedTokenConfig ¶
type FixedTokenConfig struct {
Api string `yaml:"api"` // shared-secret for server-to-server backend authentication
}
type LoggingConfig ¶
LoggingConfig configures logging
type OpenIdConnectConfig ¶
type OpenIdConnectConfig struct { IdTokenCookieName string `yaml:"id_token_cookie_name"` // optional, but must both be set, then tokens are read from cookies AccessTokenCookieName string `yaml:"access_token_cookie_name"` // optional, but must both be set, then tokens are read from cookies TokenPublicKeysPEM []string `yaml:"token_public_keys_PEM"` // a list of public RSA keys in PEM format, see https://github.com/Jumpy-Squirrel/jwks2pem for obtaining PEM from openid keyset endpoint AdminGroup string `yaml:"admin_group"` // the group claim that supplies admin rights AuthService string `yaml:"auth_service"` // base url, usually http://localhost:nnnn, will skip userinfo checks if unset Audience string `yaml:"audience"` Issuer string `yaml:"issuer"` }
type SecurityConfig ¶
type SecurityConfig struct { Fixed FixedTokenConfig `yaml:"fixed_token"` Oidc OpenIdConnectConfig `yaml:"oidc"` Cors CorsConfig `yaml:"cors"` RequireLogin bool `yaml:"require_login_for_reg"` }
SecurityConfig configures everything related to security
type ServerConfig ¶
type ServerConfig struct { BaseAddress string `yaml:"address"` Port int `yaml:"port"` ReadTimeout int `yaml:"read_timeout_seconds"` WriteTimeout int `yaml:"write_timeout_seconds"` IdleTimeout int `yaml:"idle_timeout_seconds"` }
ServerConfig contains all values for http releated configuration
type ServiceConfig ¶
type ServiceConfig struct { Name string `yaml:"name"` AttendeeService string `yaml:"attendee_service"` ProviderAdapter string `yaml:"provider_adapter"` TransactionIDPrefix string `yaml:"transaction_id_prefix"` AllowedCurrencies []string `yaml:"allowed_currencies"` DefaultPaymentComment map[string]string `yaml:"payment_default_comment"` PublicSepaLinkURL string `yaml:"public_sepa_link_url"` }
ServiceConfig contains configuration values for service related tasks. E.g. URL to payment provider adapter
Click to show internal directories.
Click to hide internal directories.