You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-05-22 10:15:21 +02:00
Make the Upstreams mux configurable
This commit changes Upstreams from []Upstream to a struct{}
moving the previous []Upstream into .Configs and adjusts all uses of it.
This commit is contained in:
@@ -470,10 +470,11 @@ sub:
|
||||
It("should load a full example AlphaOptions", func() {
|
||||
config := []byte(`
|
||||
upstreams:
|
||||
- id: httpbin
|
||||
path: /
|
||||
uri: http://httpbin
|
||||
flushInterval: 500ms
|
||||
configs:
|
||||
- id: httpbin
|
||||
path: /
|
||||
uri: http://httpbin
|
||||
flushInterval: 500ms
|
||||
injectRequestHeaders:
|
||||
- name: X-Forwarded-User
|
||||
values:
|
||||
@@ -502,12 +503,14 @@ injectResponseHeaders:
|
||||
flushInterval := Duration(500 * time.Millisecond)
|
||||
|
||||
Expect(into).To(Equal(&AlphaOptions{
|
||||
Upstreams: []Upstream{
|
||||
{
|
||||
ID: "httpbin",
|
||||
Path: "/",
|
||||
URI: "http://httpbin",
|
||||
FlushInterval: &flushInterval,
|
||||
Upstreams: Upstreams{
|
||||
Configs: []Upstream{
|
||||
{
|
||||
ID: "httpbin",
|
||||
Path: "/",
|
||||
URI: "http://httpbin",
|
||||
FlushInterval: &flushInterval,
|
||||
},
|
||||
},
|
||||
},
|
||||
InjectRequestHeaders: []Header{
|
||||
|
||||
Reference in New Issue
Block a user