@@ -915,18 +915,20 @@ def configure_tenant(self, tenant, alias, output_format):
915915 def configure_global (self , default_tenant_name , output_format , backend ):
916916 self .config .save_global (default_tenant_name = default_tenant_name , output_format = output_format , backend = backend )
917917
918- def viewsecret (self , path , blocktime , justification , maxpolltime ):
918+ def viewsecret (self , path , blocktime , justification , otp , maxpolltime ):
919919 self ._validate_justification (justification )
920920 self .login ()
921921
922922 try :
923923 value = self .b .my_secrets .view (
924- path = path , justification = justification , wait_time = blocktime , max_wait_time = maxpolltime
924+ path = path , justification = justification , otp = otp , wait_time = blocktime , max_wait_time = maxpolltime
925925 )
926926 except exceptions .AccessDenied as e :
927927 raise click .ClickException ('user does not have access to the secret.' ) from e
928928 except exceptions .ApprovalRequiredButNoJustificationProvided as e :
929929 raise click .ClickException ('approval required and no justification provided.' ) from e
930+ except exceptions .StepUpAuthRequiredButNotProvided as e :
931+ raise click .ClickException ('Step Up Authentication required and no OTP provided.' ) from e
930932
931933 # handle the generic note template type for a better UX
932934 if len (value ) == 1 and 'Note' in value :
@@ -943,18 +945,20 @@ def viewsecret(self, path, blocktime, justification, maxpolltime):
943945 # and finally print the secret data
944946 self .print (value , ignore_silent = True )
945947
946- def downloadsecret (self , path , blocktime , justification , maxpolltime , file ):
948+ def downloadsecret (self , path , blocktime , justification , otp , maxpolltime , file ):
947949 self ._validate_justification (justification )
948950 self .login ()
949951
950952 try :
951953 response = self .b .my_secrets .download (
952- path = path , justification = justification , wait_time = blocktime , max_wait_time = maxpolltime
954+ path = path , justification = justification , otp = otp , wait_time = blocktime , max_wait_time = maxpolltime
953955 )
954956 except exceptions .AccessDenied as e :
955957 raise click .ClickException ('user does not have access to the secret.' ) from e
956958 except exceptions .ApprovalRequiredButNoJustificationProvided as e :
957959 raise click .ClickException ('approval required and no justification provided.' ) from e
960+ except exceptions .StepUpAuthRequiredButNotProvided as e :
961+ raise click .ClickException ('Step Up Authentication required and no OTP provided.' ) from e
958962
959963 filename_from_secret = response ['filename' ]
960964 content = response ['content_bytes' ]
0 commit comments