[bitnami/pgbouncer] Add PGBOUNCER_AUTH_IDENT_FILE (#75939)

This adds support for user name maps via auth_ident_file.

cf: https://github.com/pgbouncer/pgbouncer/pull/996

Signed-off-by: Christopher Broglie <cbroglie@cloudflare.com>
This commit is contained in:
Chris Broglie
2025-01-07 07:02:10 -08:00
committed by GitHub
parent 0618ecea75
commit 13dfc98168
3 changed files with 7 additions and 0 deletions

View File

@@ -73,6 +73,9 @@ pgbouncer_validate() {
elif [[ ! -f "$PGBOUNCER_AUTH_HBA_FILE" ]]; then
print_validation_error "The hba file in the specified path ${PGBOUNCER_AUTH_HBA_FILE} does not exist"
fi
if [[ ! -z "$PGBOUNCER_AUTH_IDENT_FILE" ]] && [[ ! -f "$PGBOUNCER_AUTH_IDENT_FILE" ]]; then
print_validation_error "The ident map file in the specified path ${PGBOUNCER_AUTH_IDENT_FILE} does not exist"
fi
fi
# TLS Checks (client)
@@ -269,6 +272,7 @@ pgbouncer_initialize() {
"auth_file:${PGBOUNCER_AUTH_FILE}"
"auth_type:${PGBOUNCER_AUTH_TYPE}"
"auth_hba_file:${PGBOUNCER_AUTH_HBA_FILE}"
"auth_ident_file:${PGBOUNCER_AUTH_IDENT_FILE}"
"auth_query:${PGBOUNCER_AUTH_QUERY}"
"pidfile:${PGBOUNCER_PID_FILE}"
"logfile:${PGBOUNCER_LOG_FILE}"

View File

@@ -32,6 +32,7 @@ pgbouncer_env_vars=(
PGBOUNCER_AUTH_QUERY
PGBOUNCER_AUTH_TYPE
PGBOUNCER_AUTH_HBA_FILE
PGBOUNCER_AUTH_IDENT_FILE
PGBOUNCER_STATS_USERS
PGBOUNCER_POOL_MODE
PGBOUNCER_INIT_SLEEP_TIME
@@ -126,6 +127,7 @@ export PGBOUNCER_AUTH_USER="${PGBOUNCER_AUTH_USER:-}"
export PGBOUNCER_AUTH_QUERY="${PGBOUNCER_AUTH_QUERY:-}"
export PGBOUNCER_AUTH_TYPE="${PGBOUNCER_AUTH_TYPE:-scram-sha-256}"
export PGBOUNCER_AUTH_HBA_FILE="${PGBOUNCER_AUTH_HBA_FILE:-}"
export PGBOUNCER_AUTH_IDENT_FILE="${PGBOUNCER_AUTH_IDENT_FILE:-}"
export PGBOUNCER_STATS_USERS="${PGBOUNCER_STATS_USERS:-}"
export PGBOUNCER_POOL_MODE="${PGBOUNCER_POOL_MODE:-}"
export PGBOUNCER_INIT_SLEEP_TIME="${PGBOUNCER_INIT_SLEEP_TIME:-10}"

View File

@@ -82,6 +82,7 @@ docker build -t bitnami/APP:latest .
| `PGBOUNCER_AUTH_QUERY` | PgBouncer authentication query | `nil` |
| `PGBOUNCER_AUTH_TYPE` | PgBouncer authentication type | `scram-sha-256` |
| `PGBOUNCER_AUTH_HBA_FILE` | HBA configuration file to use | `nil` |
| `PGBOUNCER_AUTH_IDENT_FILE` | Ident map file to use | `nil` |
| `PGBOUNCER_STATS_USERS` | PgBouncer comma-separated list of database users that are allowed to connect and run read-only queries. | `nil` |
| `PGBOUNCER_POOL_MODE` | PgBouncer pool mode. Allowed values: session (default), transaction and statement. | `nil` |
| `PGBOUNCER_INIT_SLEEP_TIME` | PgBouncer initialization sleep time | `10` |