Add config options for auth proxy

Adds two new environment variables and unit tests to validate
positive and default use-cases.

auth_proxy_url
auth_proxy_pass_body

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2019-06-05 12:41:40 +01:00
parent 5b2a037e7e
commit a66097a9f9
2 changed files with 53 additions and 0 deletions

View File

@ -137,6 +137,9 @@ func (ReadConfig) Read(hasEnv HasEnv) GatewayConfig {
}
}
cfg.AuthProxyURL = hasEnv.Getenv("auth_proxy_url")
cfg.AuthProxyPassBody = parseBoolValue(hasEnv.Getenv("auth_proxy_pass_body"))
return cfg
}
@ -182,9 +185,17 @@ type GatewayConfig struct {
// Enable the gateway to scale any service from 0 replicas to its configured "min replicas"
ScaleFromZero bool
// MaxIdleConns with a default value of 1024, can be used for tuning HTTP proxy performance
MaxIdleConns int
// MaxIdleConnsPerHost with a default value of 1024, can be used for tuning HTTP proxy performance
MaxIdleConnsPerHost int
// AuthProxyURL specifies URL for an authenticating proxy, disabled when blank, enabled when valid URL i.e. http://basic-auth.openfaas:8080/validate
AuthProxyURL string
// AuthProxyPassBody pass body to validation proxy
AuthProxyPassBody bool
}
// UseNATS Use NATSor not