Description
Passthrough auth for users in users.toml that don't have a password triggers weird behavior:
- Connection pool is created and starts sending health checks to database
- Health checks fail since PgDog can't connect to Postgres without a password
Potential fix
- Pause pool on creation and resume it when a user connects and provides a password
Potential edge cases
- When Postgres auth is set to
trust, we don't need a password for the user, so it's valid to not provide one and the pool should still be created. Maybe we don't resume it until the user connects anyway?
Reproduce
pgdog.toml
[general]
passthrough_auth = "enabled_plain"
[[databases]]
name = "pgdog"
host = "127.0.0.1"
users.toml
[[users]]
name = "pgdog"
database = "pgdog"
# Note: no password set.
# It can also be:
# password = "" # Empty string
# We don't differentiate between the two which is bad enough.
Start PgDog and notice the pool being banned on startup.
Description
Passthrough auth for users in
users.tomlthat don't have a password triggers weird behavior:Potential fix
Potential edge cases
trust, we don't need a password for the user, so it's valid to not provide one and the pool should still be created. Maybe we don't resume it until the user connects anyway?Reproduce
pgdog.toml
users.toml
Start PgDog and notice the pool being banned on startup.