config

package
v0.0.0-...-c2f928c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Sec         Security           `json:"security"`
	DB          Database           `json:"database"`
	Log         LogConfig          `json:"logging"`
	OIDC        OAuthConfig        `json:"oidc"`
	AppCookies  ApplicationCookies `json:"appCookies"`
	Environment string             `json:"environment"`
	Cors        CorsSettings       `json:"cors"`
}

AppConfig holds the application configuration

func Read

func Read(r io.Reader) (*AppConfig, error)

Read returns application configuration values

type ApplicationCookies

type ApplicationCookies struct {
	Domain string `json:"domain"`
	Path   string `json:"path"`
	Secure bool   `json:"secure"`
	Prefix string `json:"prefix"`
}

ApplicationCookies defines values for cookies

type Claim

type Claim struct {
	Name  string   `json:"name"`
	URL   string   `json:"url"`
	Roles []string `json:"roles"`
}

Claim defines the required claims

type CorsSettings

type CorsSettings struct {
	AllowedOrigins   []string `json:"origins"`
	AllowedMethods   []string `json:"methods"`
	AllowedHeaders   []string `json:"headers"`
	AllowCredentials bool     `json:"credentials"`
	MaxAge           int      `json:"maxAge"`
}

CorsSettings specifies the used settings

type Database

type Database struct {
	ConnStr string `json:"connectionString"`
}

Database defines the connection string

type LogConfig

type LogConfig struct {
	FilePath    string `json:"filePath"`
	RequestPath string `json:"requestPath"`
	LogLevel    string `json:"logLevel"`
}

LogConfig is used to define settings for the logging process

type OAuthConfig

type OAuthConfig struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	RedirectURL  string `json:"redirectURL"`
	Provider     string `json:"provider"`
}

OAuthConfig is used to configure OAuth OpenID Connect

type Security

type Security struct {
	JwtIssuer     string `json:"jwtIssuer"`
	JwtSecret     string `json:"jwtSecret"`
	Expiry        int    `json:"expiry"`
	CookieName    string `json:"cookieName"`
	CookieDomain  string `json:"cookieDomain"`
	CookiePath    string `json:"cookiePath"`
	CookieSecure  bool   `json:"cookieSecure"`
	Claim         Claim  `json:"claim"`
	CacheDuration string `json:"cacheDuration"`
	LoginRedirect string `json:"loginRedirect"`
}

Security settings for the application

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL