Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e89970a
Move PBKDF2 computation to blocking thread pool
NikolayS Sep 30, 2025
7fd65e7
Add per-IP rate limiting for authentication attempts
NikolayS Sep 30, 2025
0dc78c7
Make authentication rate limit configurable
NikolayS Sep 30, 2025
5879bb8
Comment out slow rate limiter recovery test
NikolayS Sep 30, 2025
a9ab317
Document auth_rate_limit configuration option
NikolayS Sep 30, 2025
d6c9332
Clarify block_in_place usage with trait constraint note
NikolayS Sep 30, 2025
dd103cf
Fix memory leak in rate limiter using LRU cache
NikolayS Sep 30, 2025
92fdf96
Replace unwrap() with expect() for better error messages
NikolayS Sep 30, 2025
58d5a36
Add validation to prevent disabling auth rate limiting
NikolayS Sep 30, 2025
7178ba5
Improve rate limit error logging with more context
NikolayS Sep 30, 2025
e742aeb
Document why time-based recovery test cannot use mocking
NikolayS Sep 30, 2025
82480c7
Optimize rate limiter to allow concurrent auth attempts
NikolayS Sep 30, 2025
2e23f54
Add IPv6 /64 prefix normalization to prevent bypass attacks
NikolayS Sep 30, 2025
69df07e
Remove unused dashmap dependency to avoid version conflict
NikolayS Sep 30, 2025
b9c3eab
Refactor rate limiter to use governor's keyed limiter
NikolayS Sep 30, 2025
54e85d0
Add config reload support for rate limiter
NikolayS Sep 30, 2025
5cf1a6c
Decouple tests from config defaults
NikolayS Sep 30, 2025
c23e30d
Prevent unbounded memory growth with periodic limiter reset
NikolayS Sep 30, 2025
adfe130
move scram pbkdf2 hashing off the async runtime
cursoragent Oct 25, 2025
a6f5709
make auth rate limiting optional and clarify unit
cursoragent Oct 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]
# Use system default linker for compatibility
# (remove mold-specific flags that break with clang)
84 changes: 77 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions example.pgdog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ mirror_queue = 128
# - trust
auth_type = "scram"

# Authentication rate limit (attempts per minute per IP address).
#
# Prevents brute-force authentication attacks by limiting the number
# of authentication attempts from a single IP address.
#
# Default: 10
auth_rate_limit = 10

# Disable cross-shard queries.
#
# Default: false
Expand Down
2 changes: 1 addition & 1 deletion pgdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ regex = "1"
uuid = { version = "1", features = ["v4", "serde"] }
url = "2"
ratatui = { version = "0.30.0-alpha.1", optional = true }
governor = "0.6"
rmp-serde = "1"
rust_decimal = { version = "1.36", features = ["db-postgres"] }
chrono = "0.4"
Expand All @@ -60,7 +61,6 @@ indexmap = "2.9"
lru = "0.16"
hickory-resolver = "0.25.2"
lazy_static = "1"
dashmap = "6"

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator = "0.6"
Expand Down
1 change: 1 addition & 0 deletions pgdog/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

pub mod error;
pub mod md5;
pub mod rate_limit;
pub mod scram;

pub use error::Error;
Expand Down
Loading