config: allow blank identity providers when loading sessions for service account support (#3709)

This commit is contained in:
Caleb Doxsey 2022-10-27 08:32:06 -06:00 committed by GitHub
parent 1b596115e9
commit 6a9d6e45e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View file

@ -125,4 +125,20 @@ func TestSessionStore_LoadSessionState(t *testing.T) {
assert.Error(t, err)
assert.Nil(t, s)
})
t.Run("blank idp", func(t *testing.T) {
rawJWS := makeJWS(t, &sessions.State{
Issuer: "authenticate.example.com",
ID: "example",
})
r, err := http.NewRequest(http.MethodGet, "https://p2.example.com", nil)
require.NoError(t, err)
r.Header.Set(httputil.HeaderPomeriumAuthorization, rawJWS)
s, err := store.LoadSessionState(r)
assert.NoError(t, err)
assert.Empty(t, cmp.Diff(&sessions.State{
Issuer: "authenticate.example.com",
ID: "example",
}, s))
})
}