ContextHandler: add all configured auth header to context (#62775)

* ContextHandler: Always store list of possible auth headers in context
and remove individual calls
This commit is contained in:
Karl Persson
2023-02-02 16:25:46 +01:00
committed by GitHub
parent 19ed9181e1
commit ce5e067d28
5 changed files with 37 additions and 42 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ func TestMiddlewareJWTAuth(t *testing.T) {
assert.Equal(t, myUsername, sc.context.Login)
list := contexthandler.AuthHTTPHeaderListFromContext(sc.context.Req.Context())
require.NotNil(t, list)
require.EqualValues(t, []string{sc.cfg.JWTAuthHeaderName}, list.Items)
require.EqualValues(t, []string{"Authorization", sc.cfg.JWTAuthHeaderName}, list.Items)
}, configure, configureUsernameClaim)
middlewareScenario(t, "Valid token with bearer in authorization header", func(t *testing.T, sc *scenarioContext) {