Skip to content

Commit

Permalink
Error out on SASL handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Trakhman committed May 31, 2022
1 parent fcc25ee commit 1836164
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pgx/src/pgx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module Message_in = struct
| AuthenticationCryptPassword of string
| AuthenticationMD5Password of string
| AuthenticationSCMCredential
| AuthenticationSASLCredential
| BackendKeyData of int32 * int32
| BindComplete
| CloseComplete
Expand Down Expand Up @@ -155,6 +156,7 @@ module Message_in = struct
| 4l -> AuthenticationCryptPassword (get_n_bytes 2)
| 5l -> AuthenticationMD5Password (get_n_bytes 4)
| 6l -> AuthenticationSCMCredential
| 10l -> AuthenticationSASLCredential
| _ -> UnknownMessage (typ, msg))
| 'H' ->
let format_code_to_format = function
Expand Down Expand Up @@ -700,6 +702,8 @@ module Make (Thread : Io) = struct
loop (Some (Message_out.Password password))
| Message_in.AuthenticationSCMCredential ->
fail_msg "Pgx: SCM Credential authentication not supported"
| Message_in.AuthenticationSASLCredential ->
fail_msg "Pgx: SASL Credential authentication not supported"
| Message_in.ErrorResponse err ->
raise (PostgreSQL_Error ("Failed to authenticate with postgres server", err))
| Message_in.NoticeResponse _ ->
Expand Down

0 comments on commit 1836164

Please sign in to comment.