proxy: include client IP in ip deny message (#6854)

## Problem

Debugging IP deny errors is difficult for our users

## Summary of changes

Include the client IP in the deny message
This commit is contained in:
Conrad Ludgate
2024-02-21 17:24:59 +00:00
committed by GitHub
parent afda4420bd
commit 60e5a56a5a
4 changed files with 12 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ impl PoolingBackend {
let backend = self.config.auth_backend.as_ref().map(|_| user_info.clone());
let (allowed_ips, maybe_secret) = backend.get_allowed_ips_and_secret(ctx).await?;
if !check_peer_addr_is_in_list(&ctx.peer_addr, &allowed_ips) {
return Err(AuthError::ip_address_not_allowed());
return Err(AuthError::ip_address_not_allowed(ctx.peer_addr));
}
let cached_secret = match maybe_secret {
Some(secret) => secret,