Skip to content

Commit f48578d

Browse files
author
CommanderKeynes
committed
Remove breaking change
1 parent fa05ae3 commit f48578d

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.circleci/pgcat.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ tls_private_key = ".circleci/server.key"
4949
# Connecting to that database allows running commands like `SHOW POOLS`, `SHOW DATABASES`, etc..
5050
admin_username = "admin_user"
5151
admin_password = "admin_pass"
52-
admin_auth_type = "md5"
5352

5453
# pool
5554
# configs are structured as pool.<pool_name>
@@ -99,7 +98,6 @@ sharding_function = "pg_bigint_hash"
9998
[pools.sharded_db.users.0]
10099
username = "sharding_user"
101100
password = "sharding_user"
102-
auth_type = "md5"
103101
# Maximum number of server connections that can be established for this user
104102
# The maximum number of connection from a single Pgcat process to any database in the cluster
105103
# is the sum of pool_size across all users.
@@ -109,7 +107,6 @@ statement_timeout = 0
109107
[pools.sharded_db.users.1]
110108
username = "other_user"
111109
password = "other_user"
112-
auth_type = "md5"
113110
pool_size = 21
114111
statement_timeout = 30000
115112

@@ -150,7 +147,6 @@ prepared_statements_cache_size = 500
150147
[pools.simple_db.users.0]
151148
username = "simple_user"
152149
password = "simple_user"
153-
auth_type = "md5"
154150
pool_size = 5
155151
statement_timeout = 30000
156152

pgcat.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ verify_server_certificate = false
7676
admin_username = "admin_user"
7777
# Password to access the virtual administrative database
7878
admin_password = "admin_pass"
79-
admin_auth_type = "md5"
8079

8180
# Default plugins that are configured on all pools.
8281
[plugins]
@@ -275,8 +274,6 @@ result = [
275274
# if `server_username` is not set.
276275
username = "sharding_user"
277276

278-
auth_type = "md5"
279-
280277
# PostgreSQL password used to authenticate the user and connect to the server
281278
# if `server_password` is not set.
282279
password = "sharding_user"
@@ -302,7 +299,6 @@ statement_timeout = 0
302299
[pools.sharded_db.users.1]
303300
username = "other_user"
304301
password = "other_user"
305-
auth_type = "md5"
306302
pool_size = 21
307303
statement_timeout = 15000
308304
connect_timeout = 1000
@@ -341,7 +337,6 @@ sharding_function = "pg_bigint_hash"
341337
[pools.simple_db.users.0]
342338
username = "simple_user"
343339
password = "simple_user"
344-
auth_type = "md5"
345340
pool_size = 5
346341
min_pool_size = 3
347342
server_lifetime = 60000

src/config.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ impl Address {
208208
pub struct User {
209209
pub username: String,
210210
pub password: Option<String>,
211+
212+
#[serde(default = "User::default_auth_type")]
211213
pub auth_type: String,
212214
pub auth_ldapsuffix: Option<String>,
213215
pub auth_ldapurl: Option<String>,
@@ -245,6 +247,10 @@ impl Default for User {
245247
}
246248

247249
impl User {
250+
pub fn default_auth_type() -> String {
251+
"md5".into()
252+
}
253+
248254
fn validate(&self) -> Result<(), Error> {
249255
if let Some(min_pool_size) = self.min_pool_size {
250256
if min_pool_size > self.pool_size {
@@ -339,7 +345,10 @@ pub struct General {
339345

340346
pub admin_username: String,
341347
pub admin_password: String,
348+
349+
#[serde(default = "General::default_admin_auth_type")]
342350
pub admin_auth_type: String,
351+
343352
pub admin_auth_ldapurl: Option<String>,
344353
pub admin_auth_ldapsuffix: Option<String>,
345354

@@ -357,6 +366,10 @@ impl General {
357366
"0.0.0.0".into()
358367
}
359368

369+
pub fn default_admin_auth_type() -> String {
370+
"md5".into()
371+
}
372+
360373
pub fn default_port() -> u16 {
361374
5432
362375
}

0 commit comments

Comments
 (0)