db/postgres: add feature flag protected sslinline configuration (#27871)

* adds sslinline option to postgres conn string
* for database secrets type postgres, inspects the connection string for sslinline and generates a tlsconfig from the connection string.

* support fallback hosts

* remove broken multihost test

* bootstrap container with cert material

* overwrite pg config and set key file perms

* add feature flag check

* add tests

* add license and comments

* test all ssl modes

* add test cases for dsn (key/value) connection strings

* add fallback test cases

* fix error formatting

* add test for multi-host when using pgx native conn url parsing

---------

Co-authored-by: Branden Horiuchi <Branden.Horiuchi@blackline.com>
This commit is contained in:
John-Michael Faircloth
2024-08-01 11:43:54 -05:00
committed by GitHub
parent 10068ffb0a
commit 899ebd4aff
6 changed files with 923 additions and 194 deletions

View File

@@ -1451,7 +1451,7 @@ func TestBackend_ConnectionURL_redacted(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cleanup, u := postgreshelper.PrepareTestContainerWithPassword(t, "13.4-buster", tt.password)
cleanup, u := postgreshelper.PrepareTestContainerWithPassword(t, tt.password)
t.Cleanup(cleanup)
p, err := url.Parse(u)