directory.Group entry for groups (#1118)

* store directory groups separate from directory users

* fix group lookup, azure display name

* remove fields restriction

* fix test

* also support email

* use Email as name for google'

* remove changed file

* show groups on dashboard

* fix test

* re-add accidentally removed code
This commit is contained in:
Caleb Doxsey 2020-07-22 11:28:53 -06:00 committed by GitHub
parent 489cdd8b63
commit 1ad243dfd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 525 additions and 209 deletions

View file

@ -93,14 +93,20 @@ func Test(t *testing.T) {
PersonalAccessToken: "xyz",
}),
)
users, err := p.UserGroups(context.Background())
groups, users, err := p.UserGroups(context.Background())
assert.NoError(t, err)
testutil.AssertProtoJSONEqual(t, `[
{ "id": "github/user1", "groups": ["1", "2", "3", "team1", "team2", "team3"] },
{ "id": "github/user2", "groups": ["1", "3", "team1", "team3"] },
{ "id": "github/user3", "groups": ["3", "team3"] },
{ "id": "github/user4", "groups": ["4", "team4"] }
{ "id": "github/user1", "groupIds": ["1", "2", "3"] },
{ "id": "github/user2", "groupIds": ["1", "3"] },
{ "id": "github/user3", "groupIds": ["3"] },
{ "id": "github/user4", "groupIds": ["4"] }
]`, users)
testutil.AssertProtoJSONEqual(t, `[
{ "id": "1", "name": "team1" },
{ "id": "2", "name": "team2" },
{ "id": "3", "name": "team3" },
{ "id": "4", "name": "team4" }
]`, groups)
}
func mustParseURL(rawurl string) *url.URL {