Extract email for active directory users that don't have access to exchange (#3053)

This commit is contained in:
JBodkin-Amphora 2022-03-04 18:18:39 +00:00 committed by GitHub
parent bec4a29f19
commit 8567b56b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -62,6 +62,7 @@ func newMockAPI(t *testing.T, srv *httptest.Server) http.Handler {
"members@delta": []M{
{"@odata.type": "#microsoft.graph.user", "id": "user-2"},
{"@odata.type": "#microsoft.graph.user", "id": "user-3"},
{"@odata.type": "#microsoft.graph.user", "id": "user-4"},
},
},
},
@ -73,6 +74,7 @@ func newMockAPI(t *testing.T, srv *httptest.Server) http.Handler {
{"id": "user-1", "displayName": "User 1", "mail": "user1@example.com"},
{"id": "user-2", "displayName": "User 2", "mail": "user2@example.com"},
{"id": "user-3", "displayName": "User 3", "userPrincipalName": "user3_example.com#EXT#@user3example.onmicrosoft.com"},
{"id": "user-4", "displayName": "User 4", "userPrincipalName": "user4@example.com"},
},
})
})
@ -186,6 +188,12 @@ func TestProvider_UserGroups(t *testing.T) {
DisplayName: "User 3",
Email: "user3@example.com",
},
{
Id: "user-4",
GroupIds: []string{"test"},
DisplayName: "User 4",
Email: "user4@example.com",
},
}, users)
testutil.AssertProtoJSONEqual(t, `[
{ "id": "admin", "name": "Admin Group" },