mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
Support sending passwords in cleartext
This commit is contained in:
parent
fda6d9ef81
commit
3bb8c17c57
2 changed files with 5 additions and 0 deletions
|
@ -78,6 +78,10 @@ impl Connection {
|
|||
// there is no password needed
|
||||
}
|
||||
|
||||
ServerMessage::AuthenticationCleartextPassword => {
|
||||
conn.send(PasswordMessage { password: options.password.unwrap_or_default() }).await?;
|
||||
}
|
||||
|
||||
ServerMessage::AuthenticationMd5Password(body) => {
|
||||
// Hash password|username
|
||||
// FIXME: ConnectOptions should prepare a default user
|
||||
|
|
|
@ -76,6 +76,7 @@ impl Message {
|
|||
|
||||
b'R' => match BigEndian::read_i32(&buf[idx..]) {
|
||||
0 => Message::AuthenticationOk,
|
||||
3 => Message::AuthenticationCleartextPassword,
|
||||
5 => Message::AuthenticationMd5Password(AuthenticationMd5Password {
|
||||
salt: buf.slice_from(idx + 4),
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue