Add "GET /groups/:id/enterprise_users" API endpoint
What does this MR do and why?
This MR adds "GET /groups/:id/enterprise_users" API endpoint that allows top-level group Owners to get list of their enterprise users and see their private attributes, like email
, two_factor_enabled
, etc.
See the following issue for more details #438366 (closed).
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Make sure the GitLab instance simulates or a SaaS instance since Enterprise Users is a SaaS feature
- Configure "Automatic claims of enterprise users". For testing purposes on the local environment you can claim the user manually from the Rails console:
User.find_by_username('USERNAME').user_detail.update(enterprise_group_id: GROUP_ID)
- Request the API endpoint as a group Owner. The enterprise user should be listed in the response with attributes as per the docs.
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/GROUP_ID/enterprise_users
Edited by Bogdan Denkovych