Add "fake ssl termination" capability to the hydra client

Replicating de "--fake-ssl-termination" option of the official hydra
client
This commit is contained in:
2020-05-21 13:12:17 +02:00
parent 389eb3885b
commit 44338f06e3
4 changed files with 37 additions and 9 deletions

View File

@ -60,6 +60,11 @@ type SMTPConfig struct {
type HydraConfig struct {
BaseURL string `yaml:"baseURL" env:"HYDRA_BASE_URL"`
// Fake upstream SSL termination adding the "X-Forwarded-Proto: https" to the OIDC client
// HTTP request headers.
// Required by ory/hydra in some networks topologies
FakeSSLTermination bool `yaml:"fakeSSLTermination" env:"HYDRA_FAKE_SSL_TERMINATION"`
HTTPClientTimeout time.Duration `yaml:"httpClientTimeout" env:"HYDRA_HTTP_CLIENT_TIMEOUT"`
}
func NewDumpDefault() *Config {
@ -90,7 +95,9 @@ func NewDefault() *Config {
SenderName: "noreply",
},
Hydra: HydraConfig{
BaseURL: "http://localhost:4445/",
BaseURL: "http://localhost:4445/",
FakeSSLTermination: false,
HTTPClientTimeout: time.Second * 30, //nolint: gomnb
},
}
}