Skip to content

authz: Fix logic for repos without external repo set

Created by: tsenart

This commit makes authzFilter include repositories that have no ExternalRepoSpec set when authzAllowByDefault is true and there are not external services configured with auth fields (at the moment, GitHub and GitLab are only ones).

With this patch, Gitolite repos that were created without external repo set (before Gitolite special chars #2972) can be read by normal users before repo-updater has a chance to sync those repos, and, hence, persisting their external repo field.

Part of https://github.com/sourcegraph/infrastructure/issues/1505

Test plan: go test

Merge request reports

Loading