-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first pass at identifying enterprise owner users
Signed-off-by: Daniel Brauer <[email protected]>
- Loading branch information
Showing
5 changed files
with
346 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,88 @@ | ||
GITHUB_USER_DATA = [ | ||
{ | ||
'hasTwoFactorEnabled': None, | ||
'node': { | ||
'url': 'https://example.com/hjsimpson', | ||
'login': 'hjsimpson', | ||
'name': 'Homer Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Springfield Nuclear Power Plant', | ||
}, | ||
'role': 'MEMBER', | ||
}, { | ||
'hasTwoFactorEnabled': None, | ||
'node': { | ||
'url': 'https://example.com/mbsimpson', | ||
'login': 'mbsimpson', | ||
'name': 'Marge Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Simpson Residence', | ||
}, | ||
'role': 'ADMIN', | ||
}, | ||
] | ||
|
||
GITHUB_ORG_DATA = { | ||
'url': 'https://example.com/my_org', | ||
'login': 'my_org', | ||
} | ||
|
||
|
||
GITHUB_USER_DATA = ( | ||
[ | ||
{ | ||
'hasTwoFactorEnabled': None, | ||
'node': { | ||
'url': 'https://example.com/hjsimpson', | ||
'login': 'hjsimpson', | ||
'name': 'Homer Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Springfield Nuclear Power Plant', | ||
}, | ||
'role': 'MEMBER', | ||
}, { | ||
'hasTwoFactorEnabled': None, | ||
'node': { | ||
'url': 'https://example.com/lmsimpson', | ||
'login': 'lmsimpson', | ||
'name': 'Lisa Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Simpson Residence', | ||
}, | ||
'role': 'MEMBER', | ||
}, { | ||
'hasTwoFactorEnabled': True, | ||
'node': { | ||
'url': 'https://example.com/mbsimpson', | ||
'login': 'mbsimpson', | ||
'name': 'Marge Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Simpson Residence', | ||
}, | ||
'role': 'ADMIN', | ||
}, | ||
], | ||
GITHUB_ORG_DATA, | ||
) | ||
|
||
# Subtle differences between owner data and user data: | ||
# 1. owner data does not include a `hasTwoFactorEnabled` field (it in unavailable in the GraphQL query for these owners) | ||
# 2. an `organizationRole` field instead of a `role` field. In owner data, membership within an org is not assumed, so | ||
# there is an 'UNAFFILIATED' value for owners of an org who are not also members of it. (Otherwise the 'OWNER' | ||
# organizationRole matches the 'ADMIN' role in the user data, and the 'DIRECT_MEMBER' organizationRole matches | ||
# the 'MEMBER' role.) | ||
GITHUB_ENTERPRISE_OWNER_DATA = ( | ||
[ | ||
{ | ||
'node': { | ||
'url': 'https://example.com/kbroflovski', | ||
'login': 'kbroflovski', | ||
'name': 'Kyle Broflovski', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'South Park Elementary', | ||
}, | ||
'organizationRole': 'UNAFFILIATED', | ||
}, { | ||
'node': { | ||
'url': 'https://example.com/mbsimpson', | ||
'login': 'mbsimpson', | ||
'name': 'Marge Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Simpson Residence', | ||
}, | ||
'organizationRole': 'OWNER', | ||
}, { | ||
'node': { | ||
'url': 'https://example.com/lmsimpson', | ||
'login': 'lmsimpson', | ||
'name': 'Lisa Simpson', | ||
'isSiteAdmin': False, | ||
'email': '[email protected]', | ||
'company': 'Simpson Residence', | ||
}, | ||
'organizationRole': 'DIRECT_MEMBER', | ||
}, | ||
], | ||
GITHUB_ORG_DATA, | ||
) |
Oops, something went wrong.