mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
config: multiple endpoints for authorize and databroker (#1957)
* wip * update docs * remove dead code
This commit is contained in:
parent
0f0a50be40
commit
664358dfad
24 changed files with 440 additions and 405 deletions
|
@ -137,9 +137,15 @@ func (src *ConfigSource) rebuild(firstTime bool) {
|
|||
}
|
||||
|
||||
func (src *ConfigSource) runUpdater(cfg *config.Config) {
|
||||
urls, err := cfg.Options.GetDataBrokerURLs()
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Send()
|
||||
return
|
||||
}
|
||||
|
||||
sharedKey, _ := base64.StdEncoding.DecodeString(cfg.Options.SharedKey)
|
||||
connectionOptions := &grpc.Options{
|
||||
Addr: cfg.Options.DataBrokerURL,
|
||||
Addrs: urls,
|
||||
OverrideCertificateName: cfg.Options.OverrideCertificateName,
|
||||
CA: cfg.Options.CA,
|
||||
CAFile: cfg.Options.CAFile,
|
||||
|
|
|
@ -3,7 +3,6 @@ package databroker
|
|||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -34,7 +33,7 @@ func TestConfigSource(t *testing.T) {
|
|||
cfgs := make(chan *config.Config, 10)
|
||||
|
||||
base := config.NewDefaultOptions()
|
||||
base.DataBrokerURL = mustParse("http://" + li.Addr().String())
|
||||
base.DataBrokerURLString = "http://" + li.Addr().String()
|
||||
base.InsecureServer = true
|
||||
base.GRPCInsecure = true
|
||||
|
||||
|
@ -78,11 +77,3 @@ func TestConfigSource(t *testing.T) {
|
|||
assert.Len(t, cfg.Options.AdditionalPolicies, 1)
|
||||
}
|
||||
}
|
||||
|
||||
func mustParse(raw string) *url.URL {
|
||||
u, err := url.Parse(raw)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue