config: multiple endpoints for authorize and databroker (#1957)

* wip

* update docs

* remove dead code
This commit is contained in:
Caleb Doxsey 2021-03-03 09:53:19 -07:00 committed by GitHub
parent 0f0a50be40
commit 664358dfad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 440 additions and 405 deletions

View file

@ -3,7 +3,6 @@ package databroker
import (
"io/ioutil"
"log"
"net/url"
"os"
"testing"
@ -23,9 +22,9 @@ func TestNew(t *testing.T) {
opts config.Options
wantErr bool
}{
{"good", config.Options{SharedKey: cryptutil.NewBase64Key(), DataBrokerURL: &url.URL{Scheme: "http", Host: "example"}}, false},
{"bad shared secret", config.Options{SharedKey: string([]byte(cryptutil.NewBase64Key())[:31]), DataBrokerURL: &url.URL{Scheme: "http", Host: "example"}}, true},
{"bad databroker url", config.Options{SharedKey: cryptutil.NewBase64Key(), DataBrokerURL: &url.URL{}}, true},
{"good", config.Options{SharedKey: cryptutil.NewBase64Key(), DataBrokerURLString: "http://example"}, false},
{"bad shared secret", config.Options{SharedKey: string([]byte(cryptutil.NewBase64Key())[:31]), DataBrokerURLString: "http://example"}, true},
{"bad databroker url", config.Options{SharedKey: cryptutil.NewBase64Key(), DataBrokerURLString: "BAD"}, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {