sourcegraph: multi-tenant Zoekt (#859)
This updates webserver and sourcegraph-indexserver to support multi-tenancy.
The change is behind an ENV feature-flag.
Key changes:
- tenant ID is now part of the index (repo metadata)
- GRPC: IndexOption and Repository have a new field TenantId
- If multi-tenancy is enabled, webserver checks if tenant in context matches the tenant id in the shard
- zoekt-git-index has a new parameter "-shard_prefix ". If set, the value will be used instead of repository name as prefix for the name of the shard. For Sourcegraph we use "<tenant id>_<repository id>" as prefix if multi-tenancy is enabled
Assumption:
All calls to Sourcegraph are privileged
Test plan:
- New tests
- Ran this together with Sourcegraph (with and without MT enabled)
This is a binary file and will not be displayed.
This is a binary file and will not be displayed.