authorize: use impersonate email/groups in JWT (#1364)

This commit is contained in:
Caleb Doxsey 2020-09-02 13:50:46 -06:00 committed by GitHub
parent 4fb90fabe8
commit 0a2638e5dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -247,6 +247,22 @@ func TestEvaluator_JWTPayload(t *testing.T) {
"groups": []string{"group1", "group2", "admin", "test"},
},
},
{
"with impersonate",
&Request{
HTTP: RequestHTTP{URL: "https://example.com"},
Session: RequestSession{
ImpersonateEmail: "user@example.com",
ImpersonateGroups: []string{"admin", "test"},
},
},
map[string]interface{}{
"iss": "authn.example.com",
"aud": "example.com",
"email": "user@example.com",
"groups": []string{"admin", "test"},
},
},
}
for _, tc := range tests {