--- title: "ADR 0021: Inherited GitLab credentials are never sent to a payload-derived host" --- * Status: accepted * Code: [`pkg/provider/gitlab/gitlab.go`](https://github.com/tektoncd/pipelines-as-code/blob/main/pkg/provider/gitlab/gitlab.go) (`refuseInheritedCredentialForPayloadHost`, `setClient`) ## Context A Repository that omits `git_provider.secret` inherits the one from the global Repository (`GitProviderSecretFromGlobalRepo`). When no `git_provider.url` is set, `setClient` derives the API host from the project URL (`repoURL`) or the event URL, both taken from the webhook payload, which is not yet authenticated at that point. ## Decision `setClient` returns an error in those two payload-derived branches when the secret is inherited. It tells the user to set `git_provider.url` on the global Repository or give the repository its own `git_provider.secret`. An explicit `Provider.URL`, or the public GitLab default, is never refused. ## Consequences * Anyone able to create a Repository CR in any namespace cannot get the shared controller-namespace token delivered to a host of their choosing. * Self-hosted setups that relied on URL auto-detection with a global secret must now configure the URL explicitly.