Skip to content

Resolve "Group-Group sharing: Project Authorizations refresh can be limited to only direct members of `shared_with_group`" [RUN ALL RSPEC] [RUN AS-IF-FOSS]

What does this MR do?

For #299034 (closed), which helps us reduce the number of project authorizations jobs being enqueued when a group-group share is created/updates/deleted.

Details

The details of why this change can be made has been beautifully summarized by @ifarkas @ !50617 (comment 483963181), please go thru it for an understanding of the assumptions.

The optimization here is based on the fact that only (pure) direct members of a shared_with_group will have access to any other group it is being shared with.

Currently, we refresh project authorizations whenever a group share is created/updated/destroyed.

However, for these refreshes, we consider even inherited members of the shared_with_group group, which, based on the nature of how shared group works, is un-necessary (why enqueue a job to refresh project authorizations of an inherited member of the shared_with_group, when eventually even after the project authorizations refresh completes they will not have access anyway?)

Hence, we are going to limit project authourizations refresh in case of group-shares to just the purely direct members of shared_with_group.

Screenshots (strongly suggested)

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

Related to #299034 (closed)

Edited by Manoj M J

Merge request reports