sourcegraph/dev/ci
Erik Seliger c917330d6b
authz: Drop requirement for installing authz providers in every service (#63743)
This is a register call that is easy to forget. When forgotten, all queries against the repo store will block forever.

In addition, this adds a hard-dependency on conf to every services startup, plus a busy loop. With multi-tenant, this will not work great because authz providers would be a global, and we instead want most things to be ephemeral so they're per-provider. This is a step toward that, but doesn't yet remove the providers global variable.

Good news, it turns out that we don't actually need to register the providers in every service! The reason they were required was to check if zero providers are configured, or if authzbypass mode is enabled.

Authz bypass mode is usually ON, except when there are problems with the authz providers, meaning some authz providers might not be able to sync permissions. Bypassing of permissions is only ever happening if there are ALSO zero providers configured.

So this is basically an optimization for the case where an instance has zero authz configured so that the SQL queries are a bit simpler. This also helps in tests because with bypass mode on and no providers configured, authz enforcement is effectively off in the repo store.
This makes it so that in tests we need to do slightly more work, but also makes for a more realistic test vs at runtime setup. Also, it's highly recommended to use mocks for DB wherever possible in more high-level components to keep tests fast.

To never have a scenario where we accidentally mess up here and enable bypass mode erroneously, this PR drops that entirely. Authz is always enforced, but when a code host connection is unrestricted (i.e., will not spawn a provider) the repos are still visible, so this should be no change over before.

## Test plan

The stack starts and works, and all CI tests are still passing. Code review should help as well.
2024-07-31 01:23:34 +02:00
..
gitops fix(ci): check command out for error when git fails (#63993) 2024-07-23 09:56:33 -05:00
helpers chore(bazel): update ownership tags to increase coverage (#63001) 2024-05-31 14:10:29 +00:00
images chore(tooling): bump Go version to 1.22.4 (#63124) 2024-06-06 15:19:03 +00:00
integration/executors authz: Drop requirement for installing authz providers in every service (#63743) 2024-07-31 01:23:34 +02:00
internal chore(ci): pass --profile to bazel-do jobs (#64148) 2024-07-30 08:01:27 -05:00
runtype ci: make internal+promote release higher priority in runtypes (#64049) 2024-07-24 18:59:58 +00:00
scripts bazel: Cleanup oci_deps.bzl (#62769) 2024-05-28 10:00:31 +01:00
trivy fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
annotate-cloud-ephemeral.sh sg+ci: cloud ephemeral annotation (#62489) 2024-05-07 17:57:54 +02:00
asdf-install.sh app: add step for intel mac builds (#52540) 2023-05-29 20:21:06 +02:00
bazel-build-sg.sh ci: call Aspect Agent Health check before doing rc gen (#61216) 2024-03-18 15:24:27 +02:00
bazel-configure.sh Reapply "ci: use aspect workflow agents (#60317)" (#60856)" (#60860) 2024-03-06 11:37:49 +02:00
bazel-gomodtidy.sh ci: call Aspect Agent Health check before doing rc gen (#61216) 2024-03-18 15:24:27 +02:00
bazel-prechecks-apply.sh aspect: use different dep step key if running as part of aspect (#58676) 2023-11-30 16:48:14 +02:00
bazel-prechecks.sh fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
bazel.sh ci: call Aspect Agent Health check before doing rc gen (#61216) 2024-03-18 15:24:27 +02:00
BUILD.bazel bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
CODENOTIFY enterprise: Move last directory out (#57392) 2023-10-05 20:15:40 +00:00
create-client-artifact.sh web: make web integration tests great again! (#25027) 2021-09-23 16:32:25 +02:00
docker-publish.sh ci: drop gcloud init from ci steps (#26492) 2021-10-27 17:02:29 +02:00
gen-metadata-annotation.sh fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
gen-pipeline.go fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
gen-pipeline.sh ci: call Aspect Agent Health check before doing rc gen (#61216) 2024-03-18 15:24:27 +02:00
glossary.md chore(ci): remove Percy visual tests (#63515) 2024-06-27 16:20:06 +02:00
msp_deploy.sh msp/deploy: remove old author variable (#64107) 2024-07-26 16:56:53 +01:00
OWNERS chore: links/ownership devx->dev-infra (#58999) 2023-12-14 15:07:20 +00:00
parallel_run.sh add shellcheck & shfmt to pre-commit's pre-push hook (#59485) 2024-01-11 14:16:22 +00:00
pnpm-build.sh use esbuild for client/web builds (#57365) 2023-10-23 10:59:06 -07:00
pnpm-install-with-retry.sh app: buildkite pipeline for releases (#52202) 2023-05-19 17:44:20 +00:00
pnpm-run.sh remove gulp (task runner) (#57963) 2023-10-29 12:09:50 -07:00
pnpm-web-integration.sh chore(ci): remove Percy visual tests (#63515) 2024-06-27 16:20:06 +02:00
push_all.sh chore(ci): emit execlog for image push jobs (#64130) 2024-07-29 14:08:10 +00:00
README.md fix: update links for dev docs (#62758) 2024-05-17 13:47:34 +02:00
reset-test-db.sh dev/ci: remove set -x in all tests (#36577) 2022-06-03 13:52:48 -07:00
semgrep-scan.sh ci: set tag refspec for semgrep when working with tags (#61494) 2024-03-29 12:35:39 +00:00

Buildkite Pipeline for sourcegraph/sourcegraph

We dynamically generate our CI pipeline for Buildkite based on the output of gen-pipeline.go. To learn more, refer to the continuous integration docs.