Skip to content

Commit de070a6

Browse files
authored
Merge pull request #1 from zhanghaitao3/feat/gaussdb-sha256-auth
Add SHA256 authentication support in CoreProtocol
2 parents 5b14653 + e39ad30 commit de070a6

File tree

9 files changed

+551
-52
lines changed

9 files changed

+551
-52
lines changed

asyncpg/protocol/coreproto.pxd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ cdef enum TransactionStatus:
6363
PQTRANS_INERROR = 3 # idle, within failed transaction
6464
PQTRANS_UNKNOWN = 4 # cannot determine status
6565

66+
# Password storage methods
67+
cdef enum PasswordMethods:
68+
PLAIN_PASSWORD = 0
69+
SHA256_PASSWORD = 2
70+
MD5_PASSWORD = 1
71+
6672

6773
ctypedef object (*decode_row_method)(object, const char*, ssize_t)
6874

@@ -136,6 +142,7 @@ cdef class CoreProtocol:
136142

137143
cdef _auth_password_message_cleartext(self)
138144
cdef _auth_password_message_md5(self, bytes salt)
145+
cdef _auth_password_message_sha256(self, bytes random64code, bytes token, int32_t server_iteration)
139146
cdef _auth_password_message_sasl_initial(self, list sasl_auth_methods)
140147
cdef _auth_password_message_sasl_continue(self, bytes server_response)
141148
cdef _auth_gss_init_gssapi(self)

0 commit comments

Comments
 (0)