Add API get /invitations for project and group
What does this MR do?
Adds API get /invitations
Related to #18464
query plan for group
EXPLAIN for: SELECT "members".* FROM "members" WHERE "members"."type" = $1 AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND "members"."requested_at" IS NULL AND "members"."access_level" != $4 AND "members"."invite_token" IS NOT NULL [["type", "GroupMember"], ["source_id", 63], ["source_type", "Namespace"], ["access_level", 5]]
QUERY PLAN
Index Scan using index_members_on_source_id_and_source_type on members (cost=0.14..2.17 rows=1 width=166)
Index Cond: ((source_id = 63) AND ((source_type)::text = 'Namespace'::text))
Filter: ((requested_at IS NULL) AND (invite_token IS NOT NULL) AND (access_level <> 5) AND ((type)::text = 'GroupMember'::text))
query plan for project
EXPLAIN for: SELECT "members".* FROM "members" WHERE "members"."type" = $1 AND "members"."source_id" = $2 AND "members"."source_type" = $3 AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NOT NULL [["type", "ProjectMember"], ["source_id", 25], ["source_type", "Project"]]
QUERY PLAN
Bitmap Heap Scan on members (cost=2.75..3.77 rows=1 width=166)
Recheck Cond: ((source_id = 25) AND ((source_type)::text = 'Project'::text) AND (requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text) AND (invite_token IS NOT NULL))
-> BitmapAnd (cost=2.75..2.75 rows=1 width=0)
-> Bitmap Index Scan on index_non_requested_project_members_on_source_id_and_type (cost=0.00..1.18 rows=4 width=0)
Index Cond: ((source_id = 25) AND ((source_type)::text = 'Project'::text))
-> Bitmap Index Scan on index_members_on_invite_token (cost=0.00..1.32 rows=23 width=0)
Index Cond: (invite_token IS NOT NULL)
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Jackie Fraser