Skip to content
Snippets Groups Projects

Add "GET /groups/:id/enterprise_users" API endpoint

Merged Bogdan Denkovych requested to merge bdenkovych-issue-438366 into master
1 unresolved thread

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

  1. Make sure the GitLab instance simulates or a SaaS instance since Enterprise Users is a SaaS feature
  2. 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)
  1. 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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • requested review from @jglassman1

  • added 1 commit

    • a64f6226 - Add "GET /groups/:id/enterprise_users" API endpoint

    Compare with previous version

  • Bogdan Denkovych changed milestone to %17.7

    changed milestone to %17.7

  • Ghost User
  • added 1 commit

    • 1c65e7a2 - Apply 2 suggestion(s) to 1 file(s)

    Compare with previous version

  • Jon Glassman approved this merge request

    approved this merge request

  • Jon Glassman removed review request for @jglassman1

    removed review request for @jglassman1

  • added 1 commit

    • 2badcdd0 - Test Authn::EnterpriseUsersFinder class

    Compare with previous version

  • added 1 commit

    • e50c8409 - Cosmetic changes for ee/spec/finders/authn/enterprise_users_finder_spec.rb

    Compare with previous version

  • E2E Test Result Summary

    allure-report-publisher generated test report!

    e2e-test-on-gdk: :white_check_mark: test report for 08e14bf6

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Create      | 4      | 0      | 0       | 0     | 4     | ✅     |
    | Fulfillment | 1      | 0      | 0       | 0     | 1     | ✅     |
    | Govern      | 3      | 0      | 0       | 0     | 3     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 8      | 0      | 0       | 0     | 8     | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+

    e2e-test-on-cng: :white_check_mark: test report for 08e14bf6

    expand test summary
    +------------------------------------------------------------------+
    |                          suites summary                          |
    +-------------+--------+--------+---------+-------+-------+--------+
    |             | passed | failed | skipped | flaky | total | result |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Govern      | 84     | 0      | 9       | 1     | 93    | ✅     |
    | Create      | 140    | 0      | 20      | 0     | 160   | ✅     |
    | Plan        | 86     | 0      | 8       | 0     | 94    | ✅     |
    | Monitor     | 8      | 0      | 12      | 0     | 20    | ✅     |
    | Ai-powered  | 0      | 0      | 2       | 0     | 2     | ➖     |
    | Verify      | 49     | 0      | 16      | 0     | 65    | ✅     |
    | Data Stores | 33     | 0      | 10      | 0     | 43    | ✅     |
    | Configure   | 0      | 0      | 3       | 0     | 3     | ➖     |
    | Package     | 24     | 0      | 14      | 0     | 38    | ✅     |
    | Secure      | 2      | 0      | 5       | 0     | 7     | ✅     |
    | Fulfillment | 2      | 0      | 7       | 1     | 9     | ✅     |
    | Release     | 5      | 0      | 1       | 0     | 6     | ✅     |
    | Manage      | 1      | 0      | 9       | 0     | 10    | ✅     |
    | Analytics   | 2      | 0      | 0       | 1     | 2     | ✅     |
    | ModelOps    | 0      | 0      | 1       | 0     | 1     | ➖     |
    | Growth      | 0      | 0      | 2       | 0     | 2     | ➖     |
    +-------------+--------+--------+---------+-------+-------+--------+
    | Total       | 436    | 0      | 119     | 3     | 555   | ✅     |
    +-------------+--------+--------+---------+-------+-------+--------+
  • :tools: Generated by gitlab_quality-test_tooling.


    :snail: Slow tests detected in this merge request. These slow tests might be related to this merge request's changes.

    Click to expand
    Job File Name Duration Expected duration
    #8381626000 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.11 s < 50.13 s
    #8383658120 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.22 s < 50.13 s
    #8413813732 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 69.29 s < 50.13 s
    #8415356152 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.57 s < 50.13 s
    #8423826342 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 65.43 s < 50.13 s
    #8464843605 spec/features/admin/users/users_spec.rb#L177 Admin::Users GET /admin/users when blocking/unblocking a user shows confirmation and allows blocking and unblocking 66.26 s < 50.13 s
  • A deleted user added rspec:slow test detected label
  • added 1 commit

    • 58f09441 - Polish ee/lib/api/group_enterprise_users.rb file

    Compare with previous version

  • added 1 commit

    • 571f2418 - Add tests for 'GET /groups/:id/enterprise_users' API endpoint

    Compare with previous version

  • Bogdan Denkovych reset approvals from @jglassman1 by pushing to the branch

    reset approvals from @jglassman1 by pushing to the branch

  • added 1 commit

    • a06170fe - Test pagination parameters 'GET /groups/:id/enterprise_users'

    Compare with previous version

  • added 1 commit

    • be08a349 - Clean up ee/spec/requests/api/group_enterprise_users_spec.rb

    Compare with previous version

  • Bogdan Denkovych marked this merge request as ready

    marked this merge request as ready

  • Jon Glassman approved this merge request

    approved this merge request

  • Isaac Durham
  • Isaac Durham
  • added 1 commit

    • baff9fba - Apply documentation suggestions from Isaac

    Compare with previous version

  • Bogdan Denkovych reset approvals from @jglassman1 by pushing to the branch

    reset approvals from @jglassman1 by pushing to the branch

  • added 1 commit

    • 08e14bf6 - Apply documentation suggestions from Isaac

    Compare with previous version

  • Bogdan Denkovych changed the description

    changed the description

  • requested review from @paulobarros

  • requested review from @Quintasan

  • added workflowin review label and removed workflowin dev label

  • Bogdan Denkovych changed the description

    changed the description

  • Isaac Durham approved this merge request

    approved this merge request

  • Bogdan Denkovych changed the description

    changed the description

  • Bogdan Denkovych changed the description

    changed the description

  • Michał Zając approved this merge request

    approved this merge request

  • requested review from @fabiopitino

  • Before you set this MR to auto-merge

    This merge request will progress on pipeline tiers until it reaches the last tier: pipelinetier-3. We will trigger a new pipeline for each transition to a higher tier.

    Before you set this MR to auto-merge, please check the following:

    • You are the last maintainer of this merge request
    • The latest pipeline for this merge request is pipelinetier-3 (You can find which tier it is in the pipeline name)
    • This pipeline is recent enough (created in the last 8 hours)

    If all the criteria above apply, please set auto-merge for this merge request.

    See pipeline tiers and merging a merge request for more details.

  • Paulo Barros
  • Paulo Barros
  • Paulo Barros approved this merge request

    approved this merge request

  • Paulo Barros requested review from @a_akgun

    requested review from @a_akgun

  • Alper Akgun approved this merge request

    approved this merge request

  • added databaseapproved label and removed databasereview pending label

  • Fabio Pitino requested review from @dbalexandre and removed review request for @fabiopitino

    requested review from @dbalexandre and removed review request for @fabiopitino

  • resolved all threads

  • Douglas Barbosa Alexandre approved this merge request

    approved this merge request

  • resolved all threads

  • Douglas Barbosa Alexandre enabled automatic add to merge train when checks pass

    enabled automatic add to merge train when checks pass

  • Jio Castillo mentioned in merge request !171755 (closed)

    mentioned in merge request !171755 (closed)

  • mentioned in commit 1e7b9904

  • Hello @bdenkovych :wave:

    The database team is looking for ways to improve the database review process and we would love your help!

    If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:

    @gitlab-org/database-team

    And someone will be by shortly!

    Thanks for your help! :heart:

    This message was generated automatically. Improve it or delete it.

  • added workflowstaging label and removed workflowcanary label

  • mentioned in issue #438366 (closed)

  • mentioned in merge request gitlab-docs!5225 (merged)

  • Jio Castillo mentioned in merge request !176328 (merged)

    mentioned in merge request !176328 (merged)

  • mentioned in issue #487911 (closed)

  • Please register or sign in to reply
    Loading