fix(backend): secure production startup and migrations
This commit is contained in:
20
backend/internal/testutil/postgres_integration_test.go
Normal file
20
backend/internal/testutil/postgres_integration_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build integration
|
||||
|
||||
package testutil
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestPostgresSchemaDSNSupportsURLAndKeywordFormats(t *testing.T) {
|
||||
urlDSN, err := postgresSchemaDSN("postgres://user:pass@localhost:5432/db?sslmode=disable", "senlin_test_abc")
|
||||
require.NoError(t, err)
|
||||
require.Contains(t, urlDSN, "sslmode=disable")
|
||||
require.Contains(t, urlDSN, "search_path=senlin_test_abc")
|
||||
|
||||
keywordDSN, err := postgresSchemaDSN("host=localhost dbname=db sslmode=disable", "senlin_test_abc")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "host=localhost dbname=db sslmode=disable search_path=senlin_test_abc", keywordDSN)
|
||||
}
|
||||
Reference in New Issue
Block a user