mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 15:51:43 +00:00
They should not be used outside of cmd/frontend, so making it a frontend internal package. While doing that, I realized that there is a coupling dependency between authz providers and auth (which is authN) providers: GitLab code host connections can do authz mapping via the usernames of another OIDC or SAML auth provider (https://sourcegraph.com/docs/admin/code_hosts/gitlab#administrator-sudo-level-access-token). It turns out this feature does not work anymore, since at least several releases, because we don't actually instantiate auth providers outside of `cmd/frontend` and thus the mapping will never find anything (auth providers don't explode when queried before init, unlike authz). This only now became clear as I moved this code, and the dependency graph was broken, so that's a nice property of these cleanups I guess 😬 Since it doesn't seem to work for quite some time, I opted for removing it, and added a changelog entry about it. Not sure if that is sufficient, I raised a thread here: https://sourcegraph.slack.com/archives/C03K05FCRFH/p1721848436473209. This would've prevented this change and needed more refactoring as unfortunately we cannot map an auth provider by the conf type to a record in the `user_external_accounts` table and need to actually instantiate it. Test plan: Compiler doesn't complain, tests still pass. ## Changelog GitLab code host connections were [able to sync permissions by mapping Sourcegraph users to GitLab users via the username property of an external OIDC or SAML provider](https://sourcegraph.com/docs/admin/code_hosts/gitlab#administrator-sudo-level-access-token) that is shared across Sourcegraph and GitLab. This integration stopped working a long time ago, and it has been removed in this release.
60 lines
1.5 KiB
Python
60 lines
1.5 KiB
Python
load("//dev:go_defs.bzl", "go_test")
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|
|
|
go_library(
|
|
name = "own",
|
|
srcs = [
|
|
"conf.go",
|
|
"ownref.go",
|
|
"service.go",
|
|
],
|
|
importpath = "github.com/sourcegraph/sourcegraph/internal/own",
|
|
tags = [TAG_SEARCHSUITE],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
"//internal/api",
|
|
"//internal/collections",
|
|
"//internal/database",
|
|
"//internal/errcode",
|
|
"//internal/extsvc",
|
|
"//internal/extsvc/azuredevops",
|
|
"//internal/extsvc/bitbucketcloud",
|
|
"//internal/extsvc/github",
|
|
"//internal/extsvc/gitlab",
|
|
"//internal/gitserver",
|
|
"//internal/own/codeowners",
|
|
"//internal/types",
|
|
"//lib/errors",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "own_test",
|
|
timeout = "short",
|
|
srcs = [
|
|
"ownref_test.go",
|
|
"service_test.go",
|
|
],
|
|
embed = [":own"],
|
|
tags = [
|
|
TAG_SEARCHSUITE,
|
|
"requires-network",
|
|
],
|
|
deps = [
|
|
"//internal/api",
|
|
"//internal/database",
|
|
"//internal/database/dbmocks",
|
|
"//internal/database/dbtest",
|
|
"//internal/extsvc",
|
|
"//internal/gitserver",
|
|
"//internal/own/codeowners",
|
|
"//internal/own/codeowners/v1:codeowners",
|
|
"//internal/own/types",
|
|
"//internal/types",
|
|
"@com_github_google_go_cmp//cmp",
|
|
"@com_github_sourcegraph_log//logtest",
|
|
"@com_github_stretchr_testify//assert",
|
|
"@com_github_stretchr_testify//require",
|
|
],
|
|
)
|