-
Notifications
You must be signed in to change notification settings - Fork 226
Routing by username? #509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, Currently we route by username and database name, see You can alias any database name to any database or server using |
Thank you, I'll test that out |
How difficult would it be to support I'm trying to use pgcat against a PostgreSQL-compatible SaaS service that says its wire compatible, but was receiving these messages while debugging:
I've never coded in Rust before, but I think if we define a // AuthenticationCleartextPassword
pub const CLEARTEXT_PASSWORD: i32 = 3; in /// Send password challenge response to the server.
/// This is the cleartext challenge.
pub async fn cleartext_password<S>(
stream: &mut S,
password: &str,
) -> Result<(), Error>
where
S: tokio::io::AsyncWrite + std::marker::Unpin,
{
let password = password.as_bytes();
let mut message = BytesMut::with_capacity(password.len() as usize + 5);
message.put_u8(b'p');
message.put_i32(password.len() as i32 + 4);
message.put_slice(&password[..]);
write_all(stream, message).await
} which I don't think this is correctly sending the password to the server because the logs end up printing:
|
For client authentication, we only support MD5. For server authentication,we support MD5 and SCRAM (SASL). If you want to add cleartext for either, a PR is welcome! In terms of difficulty, clear text is the simplest one, so it should be pretty much like how you described. Just make sure the payload is correct. Client code is very dependent of md5, so it needs to be refactored a bit and maybe a config option to indicate which auth method we want the pooler to use. For the server, it's just another algorithm, which should be pretty simple. |
Looks like I’m running into what has already been reported. #487 The system I’m connecting to is using TLS and clear text as others have mentioned. Will look into creating a PR. |
Is your feature request related to a problem? Please describe.
I'm currently generating unique hostnames (with separate IP addresses) on a common port for customers to connect to my architecture. I'd like to consolidate all of this to a single hostname (with the same common port), but be able to route customers to specific databases based on the username they are authenticating with. Is this possible?
Describe the solution you'd like
Support username-based routing
Describe alternatives you've considered
https://github.com/pgbouncer/pgbouncer + https://github.com/awslabs/pgbouncer-rr-patch kind of achieves this
https://github.com/pg-sharding/spqr
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: