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

@ -3,7 +3,6 @@ package main
import (
"log"
"net/http"
"time"
"gitlab.com/wpetit/goweb/cqrs"
"gitlab.com/wpetit/goweb/template/html"
@ -104,7 +103,14 @@ func getServiceContainer(conf *config.Config) (*service.Container, error) {
// Create and expose config service provider
ctn.Provide(config.ServiceName, config.ServiceProvider(conf))
ctn.Provide(hydra.ServiceName, hydra.ServiceProvider(conf.Hydra.BaseURL, 30*time.Second))
ctn.Provide(
hydra.ServiceName,
hydra.ServiceProvider(
conf.Hydra.BaseURL,
conf.Hydra.FakeSSLTermination,
conf.Hydra.HTTPClientTimeout,
),
)
ctn.Provide(mail.ServiceName, mail.ServiceProvider(
mail.WithServer(conf.SMTP.Host, conf.SMTP.Port),