Skip to content

Commit 4445df6

Browse files
authored
fix: Passthough -> Passthrough typo (#829)
Just a small typo I found while browsing the code Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
1 parent e3a9fe5 commit 4445df6

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

.schema/pgdog.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@
846846
},
847847
"passthrough_auth": {
848848
"description": "Toggle automatic creation of connection pools given the user name, database and password.\n\n_Default:_ `disabled`\n\nhttps://docs.pgdog.dev/configuration/pgdog.toml/general/#passthrough_auth",
849-
"$ref": "#/$defs/PassthoughAuth",
849+
"$ref": "#/$defs/PassthroughAuth",
850850
"default": "disabled"
851851
},
852852
"pooler_mode": {
@@ -1232,7 +1232,7 @@
12321232
"tables"
12331233
]
12341234
},
1235-
"PassthoughAuth": {
1235+
"PassthroughAuth": {
12361236
"description": "toggle automatic creation of connection pools given the user name, database and password.\n\nSee [passthrough authentication](https://docs.pgdog.dev/features/authentication/#passthrough-authentication).\n\nhttps://docs.pgdog.dev/configuration/pgdog.toml/general/#passthrough_auth",
12371237
"oneOf": [
12381238
{

pgdog-config/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{fmt::Display, str::FromStr};
99
/// https://docs.pgdog.dev/configuration/pgdog.toml/general/#passthrough_auth
1010
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, JsonSchema)]
1111
#[serde(rename_all = "snake_case")]
12-
pub enum PassthoughAuth {
12+
pub enum PassthroughAuth {
1313
/// Passthrough auth is disabled (default).
1414
#[default]
1515
Disabled,

pgdog-config/src/core.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use tracing::{error, info, warn};
88
use crate::sharding::ShardedSchema;
99
use crate::util::random_string;
1010
use crate::{
11-
system_catalogs, EnumeratedDatabase, Memory, OmnishardedTable, PassthoughAuth,
11+
system_catalogs, EnumeratedDatabase, Memory, OmnishardedTable, PassthroughAuth,
1212
PreparedStatements, QueryParserEngine, QueryParserLevel, ReadWriteSplit, RewriteMode, Role,
1313
SystemCatalogsBehavior,
1414
};
@@ -124,7 +124,7 @@ impl ConfigAndUsers {
124124
return Ok(());
125125
}
126126

127-
if self.config.general.passthrough_auth != PassthoughAuth::Disabled {
127+
if self.config.general.passthrough_auth != PassthroughAuth::Disabled {
128128
return Err(Error::ParseError(
129129
"\"passthrough_auth\" must be \"disabled\" when any user has \"server_auth = \\\"rds_iam\\\"\"".into(),
130130
));
@@ -490,12 +490,12 @@ impl Config {
490490

491491
// Warn about plain auth and TLS
492492
match self.general.passthrough_auth {
493-
PassthoughAuth::Enabled if !self.general.tls_client_required => {
493+
PassthroughAuth::Enabled if !self.general.tls_client_required => {
494494
warn!(
495495
"consider setting \"tls_client_required\" while \"passthrough_auth\" is enabled to prevent clients from exposing plaintext passwords"
496496
);
497497
}
498-
PassthoughAuth::EnabledPlain => {
498+
PassthroughAuth::EnabledPlain => {
499499
warn!(
500500
"\"passthrough_auth\" is set to \"plain\", network traffic may expose plaintext passwords"
501501
)
@@ -1264,7 +1264,7 @@ shard = 0
12641264
#[test]
12651265
fn test_rds_iam_rejects_passthrough_auth() {
12661266
let mut config = ConfigAndUsers::default();
1267-
config.config.general.passthrough_auth = PassthoughAuth::EnabledPlain;
1267+
config.config.general.passthrough_auth = PassthroughAuth::EnabledPlain;
12681268
config.config.general.tls_verify = TlsVerifyMode::VerifyFull;
12691269
config.users.users.push(crate::User {
12701270
name: "alice".into(),
@@ -1283,7 +1283,7 @@ shard = 0
12831283
fn test_rds_iam_rejects_tls_verify_disabled() {
12841284
let mut config = ConfigAndUsers::default();
12851285
config.config.general.tls_verify = TlsVerifyMode::Disabled;
1286-
config.config.general.passthrough_auth = PassthoughAuth::Disabled;
1286+
config.config.general.passthrough_auth = PassthroughAuth::Disabled;
12871287
config.users.users.push(crate::User {
12881288
name: "alice".into(),
12891289
database: "db".into(),

pgdog-config/src/general.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::{
1313
SystemCatalogsBehavior,
1414
};
1515

16-
use super::auth::{AuthType, PassthoughAuth};
16+
use super::auth::{AuthType, PassthroughAuth};
1717
use super::database::{LoadBalancingStrategy, ReadWriteSplit, ReadWriteStrategy};
1818
use super::networking::TlsVerifyMode;
1919
use super::pooling::{PoolerMode, PreparedStatements};
@@ -317,7 +317,7 @@ pub struct General {
317317
///
318318
/// https://docs.pgdog.dev/configuration/pgdog.toml/general/#passthrough_auth
319319
#[serde(default = "General::default_passthrough_auth")]
320-
pub passthrough_auth: PassthoughAuth,
320+
pub passthrough_auth: PassthroughAuth,
321321

322322
/// Maximum amount of time to allow for PgDog to create a connection to Postgres.
323323
///
@@ -1094,17 +1094,17 @@ impl General {
10941094
Self::env_or_default("PGDOG_STATS_PERIOD", 15_000)
10951095
}
10961096

1097-
fn default_passthrough_auth() -> PassthoughAuth {
1097+
fn default_passthrough_auth() -> PassthroughAuth {
10981098
if let Ok(auth) = env::var("PGDOG_PASSTHROUGH_AUTH") {
10991099
// TODO: figure out why toml::from_str doesn't work.
11001100
match auth.as_str() {
1101-
"enabled" => PassthoughAuth::Enabled,
1102-
"disabled" => PassthoughAuth::Disabled,
1103-
"enabled_plain" => PassthoughAuth::EnabledPlain,
1104-
_ => PassthoughAuth::default(),
1101+
"enabled" => PassthroughAuth::Enabled,
1102+
"disabled" => PassthroughAuth::Disabled,
1103+
"enabled_plain" => PassthroughAuth::EnabledPlain,
1104+
_ => PassthroughAuth::default(),
11051105
}
11061106
} else {
1107-
PassthoughAuth::default()
1107+
PassthroughAuth::default()
11081108
}
11091109
}
11101110

@@ -1129,8 +1129,8 @@ impl General {
11291129
}
11301130

11311131
pub fn passthrough_auth(&self) -> bool {
1132-
self.tls().is_some() && self.passthrough_auth == PassthoughAuth::Enabled
1133-
|| self.passthrough_auth == PassthoughAuth::EnabledPlain
1132+
self.tls().is_some() && self.passthrough_auth == PassthroughAuth::Enabled
1133+
|| self.passthrough_auth == PassthroughAuth::EnabledPlain
11341134
}
11351135

11361136
/// Support for LISTEN/NOTIFY.

pgdog-config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod url;
1717
pub mod users;
1818
pub mod util;
1919

20-
pub use auth::{AuthType, PassthoughAuth};
20+
pub use auth::{AuthType, PassthroughAuth};
2121
pub use core::{Config, ConfigAndUsers};
2222
pub use data_types::*;
2323
pub use database::{

pgdog/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use general::{General, LogFormat};
2222
pub use memory::*;
2323
pub use networking::{MultiTenant, Tcp, TlsVerifyMode};
2424
pub use overrides::Overrides;
25-
pub use pgdog_config::auth::{AuthType, PassthoughAuth};
25+
pub use pgdog_config::auth::{AuthType, PassthroughAuth};
2626
pub use pgdog_config::{LoadBalancingStrategy, ReadWriteSplit, ReadWriteStrategy};
2727
pub use pooling::{ConnectionRecovery, PoolerMode, PreparedStatements};
2828
pub use rewrite::{Rewrite, RewriteMode};

0 commit comments

Comments
 (0)