Skip to content

Add REST API invited groups in a group

Shubham Kumar requested to merge invited-groups-projects into master

What does this MR do and why?

Implement groups REST API to return the equivalent of https://gitlab.com/groups/<full path>/-/group_members?tab=groups.

  • Invited groups in a group: /groups/:id/invited_groups
  • Ensure API is rate limited
  • Invited projects in a group (To be implemented in follow-up MR due to the size)
  • Update docs
  • Add query plans to the MR description

Note: If the request is unauthenticated and the endpoint could be accessed without authentication and not already rate-limited then the endpoint will be rate-limited by IP and it will have the same value as for the rate-limiting by the user.

Endpoint Rate limit per user
GET /api/v4/groups/:id/invited_groups 60 requests per minute

Closes #465207 (closed)

Query Plans

MR acceptance checklist

curl -X GET \
  'http://localhost:3000/api/v4/groups/29/invited_groups' \
  --header 'Accept: */*' \
  --header 'User-Agent: Thunder Client (https://www.thunderclient.com)'
[
  {
    "id": 33,
    "web_url": "http://127.0.0.1:3000/groups/flightjs",
    "name": "Flightjs",
    "path": "flightjs",
    "description": "Illo dolorum tempore eligendi minima ducimus provident.",
    "visibility": "public",
    "share_with_group_lock": false,
    "require_two_factor_authentication": false,
    "two_factor_grace_period": 48,
    "project_creation_level": "developer",
    "auto_devops_enabled": null,
    "subgroup_creation_level": "maintainer",
    "emails_disabled": false,
    "emails_enabled": true,
    "mentions_disabled": null,
    "lfs_enabled": true,
    "math_rendering_limits_enabled": true,
    "lock_math_rendering_limits_enabled": false,
    "default_branch": null,
    "default_branch_protection": 2,
    "default_branch_protection_defaults": {
      "allowed_to_push": [
        {
          "access_level": 40
        }
      ],
      "allow_force_push": false,
      "allowed_to_merge": [
        {
          "access_level": 40
        }
      ],
      "developer_can_initial_push": false
    },
    "avatar_url": null,
    "request_access_enabled": true,
    "full_name": "Flightjs",
    "full_path": "flightjs",
    "created_at": "2024-07-09T10:31:08.307Z",
    "parent_id": null,
    "organization_id": 1,
    "shared_runners_setting": "enabled",
    "ldap_cn": null,
    "ldap_access": null,
    "wiki_access_level": "enabled"
  }
]

Screenshot_2024-08-06_at_13.43.57

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Shubham Kumar

Merge request reports

Loading