Skip to content

Commit de8a45d

Browse files
Gary Trakhmangtrak
authored andcommitted
Error out on SASL handshake
1 parent cf2f3c4 commit de8a45d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pgx/src/pgx.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module Message_in = struct
6969
| AuthenticationCryptPassword of string
7070
| AuthenticationMD5Password of string
7171
| AuthenticationSCMCredential
72+
| AuthenticationSASLCredential
7273
| BackendKeyData of int32 * int32
7374
| BindComplete
7475
| CloseComplete
@@ -155,6 +156,7 @@ module Message_in = struct
155156
| 4l -> AuthenticationCryptPassword (get_n_bytes 2)
156157
| 5l -> AuthenticationMD5Password (get_n_bytes 4)
157158
| 6l -> AuthenticationSCMCredential
159+
| 10l -> AuthenticationSASLCredential
158160
| _ -> UnknownMessage (typ, msg))
159161
| 'H' ->
160162
let format_code_to_format = function
@@ -700,6 +702,8 @@ module Make (Thread : Io) = struct
700702
loop (Some (Message_out.Password password))
701703
| Message_in.AuthenticationSCMCredential ->
702704
fail_msg "Pgx: SCM Credential authentication not supported"
705+
| Message_in.AuthenticationSASLCredential ->
706+
fail_msg "Pgx: SASL Credential authentication not supported"
703707
| Message_in.ErrorResponse err ->
704708
raise (PostgreSQL_Error ("Failed to authenticate with postgres server", err))
705709
| Message_in.NoticeResponse _ ->

0 commit comments

Comments
 (0)