Skip to content

Commit 5ad94a9

Browse files
committed
Add TOTP support to Startup message for authentication
1 parent c42d663 commit 5ad94a9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

vertica_python/vertica/messages/backend_messages/authentication.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Authentication(BackendMessage):
5757
PASSWORD_CHANGED = 10 # client doesn't do password changing, this should never be seen
5858
PASSWORD_GRACE = 11
5959
OAUTH = 12
60+
TOTP = 14
6061
HASH = 65536
6162
HASH_MD5 = 65536 + 5
6263
HASH_SHA512 = 65536 + 512

vertica_python/vertica/messages/frontend_messages/startup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Startup(BulkFrontendMessage):
5959

6060
def __init__(self, user, database, session_label, os_user_name, autocommit,
6161
binary_transfer, request_complex_types, oauth_access_token,
62-
workload, auth_category):
62+
workload, auth_category, totp=None):
6363
BulkFrontendMessage.__init__(self)
6464

6565
try:
@@ -103,7 +103,8 @@ def __init__(self, user, database, session_label, os_user_name, autocommit,
103103
if len(oauth_access_token) > 0:
104104
# compatibility for protocol version 3.11
105105
self.parameters[b'oauth_access_token'] = oauth_access_token
106-
106+
if totp is not None:
107+
self.parameters[b'totp'] = totp
107108
def read_bytes(self):
108109
# The fixed protocol version is followed by pairs of parameter name and value strings.
109110
# A zero byte is required as a terminator after the last name/value pair.

0 commit comments

Comments
 (0)