Skip to content

Add new GraphQL queries to list organization memberships for a user and list SCIM accounts for an EMU #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions graphql/queries/emu-list-scim-accounts.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This GraphQL query can be used to generate a list of enterprise members and their SCIM account details in a GitHub Enterprise Cloud with Managed Users (EMU) enterprise account.
#
# Please ensure that your Personal Access Token (PAT) has the "read:enterprise" scope to access enterprise-level data.
# Replace `ENTEPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter.
#
# Note: the output will include suspended users (identified with their obfuscated account name), but it will not include personal user accounts that are not part of the EMU (Enterprise Managed Users) system.

query ListAllEnterpriseUsers {
# Replace `ENTERPRISE_SLUG` with the slug of your enterprise. To get more than 10 members, you can adjust the "first" parameter.
#
# Note: the output will include suspended users (identified with their obfuscated account name), but it will not include personal user accounts that are not part of the EMU (Enterprise Managed Users) system.

query ListAllEnterpriseUsers {
enterprise(slug: "ENTERPRISE_SLUG") {
ownerInfo {
samlIdentityProvider {
externalIdentities(first: 10) {
nodes {
user {
login
name
}
scimIdentity {
username
groups
}
}
}
}
}
}
}
15 changes: 15 additions & 0 deletions graphql/queries/user-org-membership.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This GraphQL query can be used to generate a list of organizations a user belongs to on GitHub.com
# replace GITHUB_LOGIN with the username that you would like to view
#
# Note: the organizations listed are only ones that the calling user is a member of. If the calling member is not part of any organizations that the searched user belong to, it will not be shown here.

query GetUserOrganizations {
user(login: "GITHUB_LOGIN") {
organizations(first: 100) {
nodes {
organization_name: name
organization_slug: login
}
}
}
}
Loading