commit | 62e0be5127a2dd33e15dc954974ce95768498719 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Thu Sep 16 00:09:15 2021 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Thu Sep 23 00:35:08 2021 +0100 |
tree | ce230eb97097ab9da3b3e9c303386e4d244dc15e | |
parent | 59e701d960f7cce36522230b994bb19169081146 [diff] |
Filter out edit refs User's private edits are not part of an open change and should not be served or advertised. The refs could be in theory made invisible by playing with the ACLs. However, having a complex ACL would have a detrimental impact on the overall performance of the security evaluation. It does not make sense to expose the user's private edits and they would risk to make a clone failing with a wants-not-valid error. Change-Id: Idbae7ed339515daa44df3f0093a51f6343b4e8d5
Gerrit lib module to allow filtering out refs in the Git advertizing protocol phase.
Build this module as it was a Gerrit plugin:
git-refs-filter
directory to Gerrit /plugins/git-refs-filter
bazel build plugins/git-refs-filter
bazel test plugins/git-refs-filter:git_refs_filter_tests
git-refs-filter.jar
module is generated under /bazel-genfiles/plugins/git-refs-filter/
Copy git-refs-filter.jar
library to Gerrit /lib
and add the following one extra settings to gerrit.config
:
[gerrit] installModule = com.googlesource.gerrit.modules.gitrefsfilter.RefsFilterModule
The refsfilter module defines a new global capability called “Filter out closed changes refs”. By default the capability isn't assigned to any user or group, thus the module installation has no side effects.
Filtering a closed change refs has the following meaning:
To enable a group of users of getting a “filtered list” of refs (e.g. CI jobs):
NOTE Gerrit makes a super-simplified ACL evaluation if all the projects are globally readable (e.g. project has a READ rule to refs/*). To enable the closed changes filtering you need to disable any global read rule for the group that needs refs filtering.