Documentation ¶
Index ¶
- Constants
- Variables
- func AddAutoBcc() string
- func AuthServiceBaseUrl() string
- func CorsAllowOrigin() string
- func DatabaseMysqlConnectString() string
- func EmailFrom() string
- func EmailFromPassword() string
- func EnableTestingMigrateDatabase()
- func FixedApiToken() string
- func IsCorsDisabled() bool
- func LoadTestingConfigurationFromPathOrAbort(configFilenameForTests string)
- func LoggingSeverity() string
- func MailDevMails() []string
- func MailDevMode() bool
- func MailLogOnly() bool
- func MessageIdDomain() string
- func MigrateDatabase() bool
- func OidcAccessTokenCookieName() string
- func OidcAdminGroup() string
- func OidcAllowedAudience() string
- func OidcAllowedIssuer() string
- func OidcIdTokenCookieName() string
- func OidcKeySet() []*rsa.PublicKey
- func ParseCommandLineFlags()
- func ServerAddr() string
- func ServerIdleTimeout() time.Duration
- func ServerReadTimeout() time.Duration
- func ServerWriteTimeout() time.Duration
- func SmtpHost() string
- func SmtpPort() int
- func StartupLoadConfiguration() error
- func UseEcsLogging() bool
- type Application
- type CorsConfig
- type DatabaseConfig
- type DatabaseType
- type FixedTokenConfig
- type LogStyle
- type LoggingConfig
- type MailConfig
- type OpenIdConnectConfig
- type SecurityConfig
- type ServerConfig
Constants ¶
View Source
const ( Inmemory DatabaseType = "inmemory" Mysql DatabaseType = "mysql" Plain LogStyle = "plain" ECS LogStyle = "ecs" // default )
Variables ¶
View Source
var ( ErrorConfigArgumentMissing = errors.New("configuration file argument missing. Please specify using -config argument. Aborting") ErrorConfigFile = errors.New("failed to read or parse configuration file. Aborting") )
Functions ¶
func AddAutoBcc ¶
func AddAutoBcc() string
func AuthServiceBaseUrl ¶
func AuthServiceBaseUrl() string
func CorsAllowOrigin ¶
func CorsAllowOrigin() string
func DatabaseMysqlConnectString ¶
func DatabaseMysqlConnectString() string
func EmailFromPassword ¶
func EmailFromPassword() string
func EnableTestingMigrateDatabase ¶
func EnableTestingMigrateDatabase()
EnableTestingMigrateDatabase is for tests
func FixedApiToken ¶
func FixedApiToken() string
func IsCorsDisabled ¶
func IsCorsDisabled() bool
func LoadTestingConfigurationFromPathOrAbort ¶
func LoadTestingConfigurationFromPathOrAbort(configFilenameForTests string)
LoadTestingConfigurationFromPathOrAbort is for tests to set a hardcoded yaml configuration
func LoggingSeverity ¶
func LoggingSeverity() string
func MailDevMails ¶
func MailDevMails() []string
func MailDevMode ¶
func MailDevMode() bool
func MailLogOnly ¶
func MailLogOnly() bool
func MessageIdDomain ¶ added in v0.1.2
func MessageIdDomain() string
func MigrateDatabase ¶
func MigrateDatabase() bool
func OidcAccessTokenCookieName ¶
func OidcAccessTokenCookieName() string
func OidcAdminGroup ¶
func OidcAdminGroup() string
func OidcAllowedAudience ¶
func OidcAllowedAudience() string
func OidcAllowedIssuer ¶
func OidcAllowedIssuer() string
func OidcIdTokenCookieName ¶
func OidcIdTokenCookieName() string
func OidcKeySet ¶
func ParseCommandLineFlags ¶
func ParseCommandLineFlags()
ParseCommandLineFlags is exposed separately so you can skip it for tests
func ServerAddr ¶
func ServerAddr() string
func ServerIdleTimeout ¶
func ServerReadTimeout ¶
func ServerWriteTimeout ¶
func StartupLoadConfiguration ¶
func StartupLoadConfiguration() error
func UseEcsLogging ¶
func UseEcsLogging() bool
Types ¶
type Application ¶
type Application struct { Server ServerConfig `yaml:"server"` Mail MailConfig `yaml:"mail"` Database DatabaseConfig `yaml:"database"` Security SecurityConfig `yaml:"security"` Logging LoggingConfig `yaml:"logging"` }
Application is the root configuration type
func Configuration ¶
func Configuration() *Application
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 FixedTokenConfig ¶
type FixedTokenConfig struct {
Api string `yaml:"api"` // shared-secret for server-to-server backend authentication
}
type LoggingConfig ¶
LoggingConfig configures logging
type MailConfig ¶
type MailConfig struct { LogOnly bool `yaml:"log_only"` DevMode bool `yaml:"dev_mode"` DevMails []string `yaml:"dev_mails"` AddAutoBcc string `yaml:"add_auto_bcc"` From string `yaml:"from"` FromPass string `yaml:"from_password"` Host string `yaml:"smtp_host"` Port string `yaml:"smtp_port"` MessageIdDomain string `yaml:"message_id_domain"` }
MailConfig contains values for the mail server
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"` }
SecurityConfig configures everything related to security
type ServerConfig ¶
type ServerConfig struct { Address string `yaml:"address"` Port string `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 configuration
Click to show internal directories.
Click to hide internal directories.