1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-10 22:51:31 +02:00

Use comma separated multiple values for header (#799)

* Use comma separated value for multiple claims

* Fix lint error

* Fix more tests

* Fix one more test

* Always flatten the headers

* Ensure we test the real multi-groups

* Only update map when necessary

* Update CHANGELOG

* Move to the right location of change log

* Fix blank line
This commit is contained in:
Lida Li
2021-01-22 00:48:34 -08:00
committed by GitHub
parent 8087de7a03
commit b541805dc1
4 changed files with 19 additions and 7 deletions

View File

@@ -55,11 +55,11 @@ var _ = Describe("Headers Suite", func() {
Entry("with no configured headers", headersTableInput{
headers: []options.Header{},
initialHeaders: http.Header{
"foo": []string{"bar", "baz"},
"Foo": []string{"bar", "baz"},
},
session: &sessionsapi.SessionState{},
expectedHeaders: http.Header{
"foo": []string{"bar", "baz"},
"Foo": []string{"bar,baz"},
},
expectedErr: "",
}),
@@ -77,13 +77,13 @@ var _ = Describe("Headers Suite", func() {
},
},
initialHeaders: http.Header{
"foo": []string{"bar", "baz"},
"Foo": []string{"bar", "baz"},
},
session: &sessionsapi.SessionState{
IDToken: "IDToken-1234",
},
expectedHeaders: http.Header{
"foo": []string{"bar", "baz"},
"Foo": []string{"bar,baz"},
"Claim": []string{"IDToken-1234"},
},
expectedErr: "",
@@ -133,7 +133,7 @@ var _ = Describe("Headers Suite", func() {
IDToken: "IDToken-1234",
},
expectedHeaders: http.Header{
"Claim": []string{"bar", "baz", "IDToken-1234"},
"Claim": []string{"bar,baz,IDToken-1234"},
},
expectedErr: "",
}),
@@ -176,7 +176,7 @@ var _ = Describe("Headers Suite", func() {
},
session: nil,
expectedHeaders: http.Header{
"Claim": []string{"bar", "baz"},
"Claim": []string{"bar,baz"},
},
expectedErr: "",
}),