Add Restrict group access by Domain to API
What does this MR do and why?
- This change allows a user to add/update (PUT) and read (GET) the restricted domains by email group setting in the Group API.
- This is currently described in the Restrict Group Access by Domain docs but is not exposed via the API to
read
orwrite
to. - Closes: #351494 (closed)
Example read (GET)
Request:curl -H "PRIVATE_TOKEN: $ADMIN_PAT" -s -X GET \
"http://gdk.test:3000/api/v4/groups/24" | jq '.allowed_email_domains_list'
Response:
"legit.com"
Example write (PUT)
Request:curl -H "PRIVATE_TOKEN: $ADMIN_PAT" -s -X PUT \
"http://gdk.test:3000/api/v4/groups/24?allowed_email_domains_list=domain.com" | jq '.allowed_email_domains_list'
Response:
"domain.com"
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
- Ensure you have sufficient permissions on a Premium/Ultimate instance
- Read the current allow listed domain names (if set):
curl -H "PRIVATE_TOKEN: $ADMIN_PAT" -s -X GET \
"http://gdk.test:3000/api/v4/groups/24" | jq '.allowed_email_domains_list'
"example.com"
- Then set them:
curl -H "PRIVATE_TOKEN: $ADMIN_PAT" -s -X PUT \
"http://gdk.test:3000/api/v4/groups/24?allowed_email_domains_list=domain.com" | jq '.allowed_email_domains_list'
"domain.com"
Related to #351494 (closed)
Merge request reports
Activity
changed milestone to %Backlog
added Category:API Category:Groups & Projects Deliverable Documentation guidelines GitLab Premium analytics instrumentation api backend devopsdata stores documentation featureaddition grouptenant scale quad-planningcomplete-action sectioncore platform typefeature workflowready for development labels
assigned to @nmcd
added pipelinetier-1 label
- Resolved by Josianne Hyson
1 Warning fc672f84: The commit subject and body must be separated by a blank line. For more information, take a look at our Commit message guidelines. 2 Messages CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
-
doc/api/groups.md
(Link to current live version)
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Category Reviewer Maintainer backend @ghavenga
(UTC+2)@j_lar
(UTC+2)Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger -
added 1 commit
- 0d127477 - Fix end typo on allowed_email_domains_list Spec
added 1 commit
- ac3ed21d - Fix spec test to exclude extra included context
added workflowready for review label and removed workflowready for development label