Skip to content

Add API get /invitations for project and group

Jackie Fraser requested to merge add-get-invitations-for-group-and-project into master

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)

get-doc

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Merge request reports

Loading