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 4ba69f2 commit df0ff56
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 df0ff56

Please sign in to comment.