File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
vertica_python/tests/integration_tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,31 @@ def totp_invalid_format_scenario(self):
217217 cur .execute ("DROP USER IF EXISTS totp_user" )
218218 cur .execute ("DROP AUTHENTICATION IF EXISTS totp_auth CASCADE" )
219219
220+ def test_totp_invalid_alphanumeric_code (self ):
221+ # Verify alphanumeric TOTP inputs return the explicit validation error
222+ with self ._connect () as conn :
223+ cur = conn .cursor ()
224+
225+ cur .execute ("DROP USER IF EXISTS totp_user" )
226+ cur .execute ("DROP AUTHENTICATION IF EXISTS totp_auth CASCADE" )
227+
228+ try :
229+ cur .execute ("CREATE USER totp_user IDENTIFIED BY 'password' ENFORCEMFA" )
230+ cur .execute ("CREATE AUTHENTICATION totp_auth METHOD 'password' HOST '0.0.0.0/0'" )
231+ cur .execute ("GRANT AUTHENTICATION totp_auth TO totp_user" )
232+
233+ self ._conn_info ['user' ] = 'totp_user'
234+ self ._conn_info ['password' ] = 'password'
235+ # Alphanumeric TOTP provided via driver parameter
236+ self ._conn_info ['totp' ] = "ot123"
237+
238+ err_msg = "Invalid TOTP: Please enter a valid 6-digit numeric code"
239+ self .assertConnectionFail (err_msg = err_msg )
240+
241+ finally :
242+ cur .execute ("DROP USER IF EXISTS totp_user" )
243+ cur .execute ("DROP AUTHENTICATION IF EXISTS totp_auth CASCADE" )
244+
220245 # Negative Test: Wrong TOTP (Valid format, wrong value)
221246 def totp_wrong_code_scenario (self ):
222247 with self ._connect () as conn :
You can’t perform that action at this time.
0 commit comments