mirror of
https://github.com/postgresml/pgcat.git
synced 2026-03-24 09:46:29 +00:00
Implement Trust Authentication
This commit is contained in:
committed by
CommanderKeynes
parent
9bb71ede9d
commit
feedcd49d9
@@ -64,6 +64,20 @@ where
|
||||
write_all(stream, auth_ok).await
|
||||
}
|
||||
|
||||
/// Tell the client to use clearr text auth
|
||||
pub async fn clear_text_challenge<S>(stream: &mut S) -> Result<(), Error>
|
||||
where
|
||||
S: tokio::io::AsyncWrite + std::marker::Unpin,
|
||||
{
|
||||
let mut auth_clear_text = BytesMut::with_capacity(9);
|
||||
|
||||
auth_clear_text.put_u8(b'R');
|
||||
auth_clear_text.put_i32(8);
|
||||
auth_clear_text.put_i32(3);
|
||||
|
||||
write_all(stream, auth_clear_text).await
|
||||
}
|
||||
|
||||
/// Generate md5 password challenge.
|
||||
pub async fn md5_challenge<S>(stream: &mut S) -> Result<[u8; 4], Error>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user