Skip to content

Commit be88dc1

Browse files
committed
Add documentation for Auth passthrough
1 parent 4bce72e commit be88dc1

File tree

3 files changed

+59
-4
lines changed

3 files changed

+59
-4
lines changed

CONFIG.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,41 @@ Connecting to that database allows running commands like `SHOW POOLS`, `SHOW DAT
175175
### admin_password
176176
```
177177
path: general.admin_password
178-
default: "admin_pass"
178+
default: <UNSET>
179179
```
180180

181181
Password to access the virtual administrative database
182182

183+
### auth_query (experimental)
184+
```
185+
path: general.auth_query
186+
default: <UNSET>
187+
```
188+
189+
Query to be sent to servers to obtain the hash used for md5 authentication. The connection will be
190+
established using the database configured in the pool. This parameter is inherited by every pool
191+
and can be redefined in pool configuration.
192+
193+
### auth_query_user (experimental)
194+
```
195+
path: general.auth_query_user
196+
default: <UNSET>
197+
```
198+
199+
User to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query
200+
specified in `auth_query_user`. The connection will be established using the database configured in the pool.
201+
This parameter is inherited by every pool and can be redefined in pool configuration.
202+
203+
### auth_query_password (experimental)
204+
```
205+
path: general.auth_query_password
206+
default: <UNSET>
207+
```
208+
209+
Password to be used for connecting to servers to obtain the hash used for md5 authentication by sending the query
210+
specified in `auth_query_user`. The connection will be established using the database configured in the pool.
211+
This parameter is inherited by every pool and can be redefined in pool configuration.
212+
183213
## `pools.<pool_name>` Section
184214

185215
### pool_mode
@@ -281,6 +311,30 @@ default: 3000
281311

282312
Connect timeout can be overwritten in the pool
283313

314+
### auth_query (experimental)
315+
```
316+
path: general.auth_query
317+
default: <UNSET>
318+
```
319+
320+
Auth query can be overwritten in the pool
321+
322+
### auth_query_user (experimental)
323+
```
324+
path: general.auth_query_user
325+
default: <UNSET>
326+
```
327+
328+
Auth query user can be overwritten in the pool
329+
330+
### auth_query_password (experimental)
331+
```
332+
path: general.auth_query_password
333+
default: <UNSET>
334+
```
335+
336+
Auth query password can be overwritten in the pool
337+
284338
## `pools.<pool_name>.users.<user_index>` Section
285339

286340
### username

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PostgreSQL pooler and proxy (like PgBouncer) with support for sharding, load bal
2525
| Sharding using comments parsing/Regex | **Experimental** | Clients can include shard information (sharding key, shard ID) in the query comments. |
2626
| Automatic sharding | **Experimental** | PgCat can parse queries, detect sharding keys automatically, and route queries to the correct shard. |
2727
| Mirroring | **Experimental** | Mirror queries between multiple databases in order to test servers with realistic production traffic. |
28+
| Auth passthrough | **Experimental** | MD5 password authentication can be configured to use an `auth_query` so no cleartext passwords are needed in the config file. |
2829

2930

3031
## Status

src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ pub struct Pool {
413413
pub shard_id_regex: Option<String>,
414414
pub regex_search_limit: Option<usize>,
415415

416-
pub shards: BTreeMap<String, Shard>,
417-
pub users: BTreeMap<String, User>,
418-
419416
pub auth_query: Option<String>,
420417
pub auth_query_user: Option<String>,
421418
pub auth_query_password: Option<String>,
419+
420+
pub shards: BTreeMap<String, Shard>,
421+
pub users: BTreeMap<String, User>,
422422
// Note, don't put simple fields below these configs. There's a compatability issue with TOML that makes it
423423
// incompatible to have simple fields in TOML after complex objects. See
424424
// https://users.rust-lang.org/t/why-toml-to-string-get-error-valueaftertable/85903

0 commit comments

Comments
 (0)