mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
azure: incremental sync (#1471)
* azure: incremental sync * identity manager: fix directory sync timing * on unauthorized, reset token * support querying the user api * update name * pull out constants
This commit is contained in:
parent
3e86d2f9bf
commit
697be04c6f
3 changed files with 309 additions and 132 deletions
|
@ -44,26 +44,34 @@ func newMockAPI(t *testing.T, srv *httptest.Server) http.Handler {
|
|||
next.ServeHTTP(w, r)
|
||||
})
|
||||
})
|
||||
r.Get("/groups", func(w http.ResponseWriter, r *http.Request) {
|
||||
r.Get("/groups/delta", func(w http.ResponseWriter, r *http.Request) {
|
||||
_ = json.NewEncoder(w).Encode(M{
|
||||
"value": []M{
|
||||
{"id": "admin", "displayName": "Admin Group"},
|
||||
{"id": "test", "displayName": "Test Group"},
|
||||
{
|
||||
"id": "admin",
|
||||
"displayName": "Admin Group",
|
||||
"members@delta": []M{
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-1"},
|
||||
},
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"displayName": "Test Group",
|
||||
"members@delta": []M{
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-2"},
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-3"},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
r.Get("/groups/{group_name}/members", func(w http.ResponseWriter, r *http.Request) {
|
||||
members := map[string][]M{
|
||||
"admin": {
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-1", "displayName": "User 1", "mail": "user1@example.com"},
|
||||
},
|
||||
"test": {
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-2", "displayName": "User 2", "mail": "user2@example.com"},
|
||||
{"@odata.type": "#microsoft.graph.user", "id": "user-3", "displayName": "User 3", "userPrincipalName": "user3_example.com#EXT#@user3example.onmicrosoft.com"},
|
||||
},
|
||||
}
|
||||
r.Get("/users/delta", func(w http.ResponseWriter, r *http.Request) {
|
||||
_ = json.NewEncoder(w).Encode(M{
|
||||
"value": members[chi.URLParam(r, "group_name")],
|
||||
"value": []M{
|
||||
{"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"},
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue