git.iko.soy/typeable/oauth2-proxy
on master help sign in
Fix basic auth legacy header conversion
commit482cd32a17ede5e70eb2665b2e47baeab98d8501 authorJoel Speed <joel.speed@hotmail.co.uk> dateThu 19 Nov 2020, 20:06 (6 years ago) parenteb07005
3 files changed+7−3
CHANGELOG.md+1 pkg/apis/options/legacy_options.go+2−1 pkg/apis/options/legacy_options_test.go+4−2
CHANGELOG.md+1
@@ -43,6 +43,7 @@
4343
4444## Changes since v6.1.1
4545
46+- [#925](https://github.com/oauth2-proxy/oauth2-rpoxy/pull/925) Fix basic auth legacy header conversion (@JoelSpeed)
4647- [#916](https://github.com/oauth2-proxy/oauth2-rpoxy/pull/916) Add AlphaOptions struct to prepare for alpha config loading (@JoelSpeed)
4748- [#923](https://github.com/oauth2-proxy/oauth2-proxy/pull/923) Support TLS 1.3 (@aajisaka)
4849- [#918](https://github.com/oauth2-proxy/oauth2-proxy/pull/918) Fix log header output (@JoelSpeed)
pkg/apis/options/legacy_options.go+2−1
@@ -232,7 +232,8 @@ func getBasicAuthHeader(preferEmailToUser bool, basicAuthPassword string) Header
232232 Values: []HeaderValue{
233233 {
234234 ClaimSource: &ClaimSource{
235− Claim: claim,
235+ Claim: claim,
236+ Prefix: "Basic ",
236237 BasicAuthPassword: &SecretSource{
237238 Value: []byte(base64.StdEncoding.EncodeToString([]byte(basicAuthPassword))),
238239 },
pkg/apis/options/legacy_options_test.go+4−2
@@ -329,7 +329,8 @@ var _ = Describe("Legacy Options", func() {
329329 Values: []HeaderValue{
330330 {
331331 ClaimSource: &ClaimSource{
332− Claim: "user",
332+ Claim: "user",
333+ Prefix: "Basic ",
333334 BasicAuthPassword: &SecretSource{
334335 Value: []byte(base64.StdEncoding.EncodeToString([]byte(basicAuthSecret))),
335336 },
@@ -368,7 +369,8 @@ var _ = Describe("Legacy Options", func() {
368369 Values: []HeaderValue{
369370 {
370371 ClaimSource: &ClaimSource{
371− Claim: "email",
372+ Claim: "email",
373+ Prefix: "Basic ",
372374 BasicAuthPassword: &SecretSource{
373375 Value: []byte(base64.StdEncoding.EncodeToString([]byte(basicAuthSecret))),
374376 },