praefect: Present a client certificate on Praefect outbound connections
This relates to gitlab#634060, which it does not close, and is part of gitlab#634072.
Praefect now presents the client certificate from [tls] on its node dialer, its health checks and its subcommands. The keys come from !9556. This is what lets Praefect reach a Gitaly node set to client_auth_mode = "require".
Merge order: last of four. It depends on !9556, which depends on !9555 (merged) and !9554 (merged). It targets C's branch, zt/mtls-c-gitaly-outbound, so its diff shows only its own 2 commits. It is safe alone, since an unset pair presents nothing. With it merged, require on a Gitaly node behind Praefect works. require on Praefect or on a standalone Gitaly node still waits on every client that dials it presenting a certificate: Rails, Workhorse, gitlab-shell, the GitLab agent server for Kubernetes (KAS) and the Elasticsearch and Zoekt indexers, because those clients dial Praefect and standalone Gitaly directly, and a fork or storage move also needs !9556. There is no diagram because it threads the pair through dialers that already exist.
Claims and not in this MR
Code citations are at 1712095b.
- The node dialer, health checks and manager load and pass the pair:
internal/praefect/nodes/manager.go:149,195,217,ping.go:87,247. Test:TestDial_clientCertificate(manager_test.go:596). The server loads it for per-repository election and subcommands dial with it:internal/cli/praefect/serve.go:292,internal/cli/dial.go:37. Tests:TestServer_clientCertificate,TestDialNode_clientCertificate,TestDialGitalyStorages_clientCertificate,TestSubCmdDialNodes_clientCertificate. - All 2 commits build and pass
go vet, and none is flagged by the commit linter. On a private copy of this branch every job that runs by default passed. The manual jobs were not run. - Not here: Rails, Workhorse, gitlab-shell, KAS and the Elasticsearch and Zoekt indexers presenting a certificate, revocation, and identity checks. A node not set to
requireaccepts requests without a certificate and can pass them on to arequirenode, so arequirenode is only as strong as the nodes that reach it.
An AI coding assistant wrote this change and ran the checks above on test VMs.