Skip to content
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

Bob/6936 query for admin emails #6962

Merged
merged 10 commits into from
Nov 17, 2023
Merged

Bob/6936 query for admin emails #6962

merged 10 commits into from
Nov 17, 2023

Conversation

fzhao99
Copy link
Contributor

@fzhao99 fzhao99 commented Nov 15, 2023

BACKEND PULL REQUEST

Related Issue

Changes Proposed

  • Adds a mutation endpoint / service method that returns UUID's for admin users of an org when passed an org id.

Testing

  • Hit the endpoint with an org ID and check to see all admin UUID's are returned

This is the query that I setup in Postman in case it's helpful

query GetOrgAdminUserIds($orgId: ID!) {
	getOrgAdminUserIds(
		orgId: $orgId
	)
}
Screen.Recording.2023-11-15.at.4.18.01.PM.mov

deployed on dev3 and got the following return for Boban's org

### Admin Users: 
    "data": {
        "usersWithStatus": [
            { (Standard user)
                "id": "f58d6f89-3d1e-49df-9ed0-09f3cfbc19fa",
                "firstName": "Santa",
                "middleName": null,
                "lastName": "Claus",
                "email": "[email protected]",
                "status": "PROVISIONED",
                "__typename": "ApiUserWithStatus"
            },
            { (Admin)
                "id": "694d6c40-e524-4063-a60b-fa26175f4e0a",
                "firstName": "Dad",
                "middleName": null,
                "lastName": "inet",
                "email": "[email protected]",
                "status": "ACTIVE",
                "__typename": "ApiUserWithStatus"
            },
            { (Standard user)
                "id": "adcaf8c4-3ef2-4f4b-8f09-f303dd866ecc",
                "firstName": "Eve",
                "middleName": null,
                "lastName": "Riggs",
                "email": "[email protected]",
                "status": "ACTIVE",
                "__typename": "ApiUserWithStatus"
            },
            { (Admin)
                "id": "9b10a573-dc27-40e8-9550-60d219f5a5bb",
                "firstName": "Fletcher", 
                "middleName": null,
                "lastName": "Wheeler",
                "email": "[email protected]",
                "status": "PROVISIONED",
                "__typename": "ApiUserWithStatus"
            }
        ]
}

### Query return

 "data": {
        "getOrgAdminUserIds": [
            "694d6c40-e524-4063-a60b-fa26175f4e0a",
            "9b10a573-dc27-40e8-9550-60d219f5a5bb"
        ]
    }


Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deployed and tested on dev7 -- would love your thoughts on a comment I left! Thank you, Bob!

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

83.3% 83.3% Coverage
0.0% 0.0% Duplication

return foundUser.getInternalId();
Optional<ApiUser> foundUser = apiUserRepository.findByLoginEmail(email);
if (foundUser.isEmpty()) {
log.warn(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this change! :D

Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! tested on dev7 with the org that was erroring before and got back user ids 😸

Copy link
Collaborator

@mpbrown mpbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work on this, I like the warning about a user in Okta but not the database

@fzhao99 fzhao99 added this pull request to the merge queue Nov 17, 2023
Merged via the queue into main with commit 7974f3a Nov 17, 2023
41 checks passed
@fzhao99 fzhao99 deleted the bob/6936-query-for-admin-emails branch November 17, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query to get admin emails for orgs
3 participants