fix(config): harden database pool settings
This commit is contained in:
@@ -27,6 +27,23 @@ llm:
|
||||
}
|
||||
}
|
||||
|
||||
func TestDatabaseConfigDSNEscapesCredentials(t *testing.T) {
|
||||
cfg := DatabaseConfig{
|
||||
Host: "db.internal",
|
||||
Port: 5432,
|
||||
User: "geo",
|
||||
Password: "p@ss:word/with?symbols",
|
||||
DBName: "geo",
|
||||
SSLMode: "disable",
|
||||
}
|
||||
|
||||
got := cfg.DSN()
|
||||
want := "postgres://geo:p%40ss%3Aword%2Fwith%3Fsymbols@db.internal:5432/geo?sslmode=disable"
|
||||
if got != want {
|
||||
t.Fatalf("DSN() = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadFallsBackToConfigLLMAPIKey(t *testing.T) {
|
||||
t.Setenv("LLM_API_KEY", "")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user