mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 09:19:39 +02:00
config: return errors on invalid URLs, fix linting (#1829)
This commit is contained in:
parent
a8a703218f
commit
bec98051ae
12 changed files with 256 additions and 149 deletions
|
@ -158,9 +158,15 @@ func setupAuthenticate(src config.Source, controlPlane *controlplane.Server) err
|
|||
if err != nil {
|
||||
return fmt.Errorf("error creating authenticate service: %w", err)
|
||||
}
|
||||
|
||||
authenticateURL, err := src.GetConfig().Options.GetAuthenticateURL()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error getting authenticate URL: %w", err)
|
||||
}
|
||||
|
||||
src.OnConfigChange(svc.OnConfigChange)
|
||||
svc.OnConfigChange(src.GetConfig())
|
||||
host := urlutil.StripPort(src.GetConfig().Options.GetAuthenticateURL().Host)
|
||||
host := urlutil.StripPort(authenticateURL.Host)
|
||||
sr := controlPlane.HTTPRouter.Host(host).Subrouter()
|
||||
svc.Mount(sr)
|
||||
log.Info().Str("host", host).Msg("enabled authenticate service")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue