Draft: For free SaaS namespaces, limit Invite/member API
What does this MR do and why?
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/356619+
Our current approach to manage users that are added to a free SaaS namespace via the Invite/Member API is to place members that exceed the 5 user limit in the "waiting" state. This issue is intended to capture an iteration where we prevent members being added from the Invite/Member API from exceeding the 5 user limit in total.
- add an error for that specific
invite
(email or username) in the errors- only affect the API use of the service for now - service layer should only use this logic based upon a parameter perhaps - similar to
skip_authorization
use in other services🤔
- only affect the API use of the service for now - service layer should only use this logic based upon a parameter perhaps - similar to
- error text:
Member can not be added. Over the limit for members on free namespaces.
Screenshots or screen recordings
How to set up and validate locally
- Sign in as admin user.
- Go to free private root group members page and try to invite 6 members. See the error.
- Make sure under limit users are invited.
- Go to admin -> group page. Try to add member. See the error.
- Create new API token. Open postman. Create new request with OAuth v2 authentication using token.
- Send POST request to
http://localhost:3000/api/v4/groups/[group id]/invitations
with body:
Make sure response has errors for email and user id separated.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Serhii Yarynovskyi