config: use config.Config instead of config.Options everywhere

This commit is contained in:
Caleb Doxsey 2022-08-26 15:39:50 -06:00
parent 5f51510e91
commit 1b80e8a6c2
40 changed files with 484 additions and 412 deletions

View file

@ -49,15 +49,13 @@ func TestMiddleware(t *testing.T) {
srv2 := httptest.NewServer(h.Middleware(next))
defer srv2.Close()
cfg := &config.Config{
Options: &config.Options{
SharedKey: cryptutil.NewBase64Key(),
Policies: []config.Policy{{
To: config.WeightedURLs{{URL: *u}},
KubernetesServiceAccountToken: "ABCD",
}},
},
}
cfg := config.New(&config.Options{
SharedKey: cryptutil.NewBase64Key(),
Policies: []config.Policy{{
To: config.WeightedURLs{{URL: *u}},
KubernetesServiceAccountToken: "ABCD",
}},
})
h.Update(context.Background(), cfg)
policyID, _ := cfg.Options.Policies[0].RouteID()