diff options
author | Jenny Shen <jenny.shen@shopify.com> | 2023-02-16 16:14:36 -0500 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-04-12 11:57:43 +0900 |
commit | c7a8d63df84c4884cb30cc58292ec36efabfabbb (patch) | |
tree | c4adabe5606f2199b78e55873db288124a5e56d2 /lib | |
parent | cd60113faa41384cba31781eeb8fa51ea3ed2355 (diff) | |
download | ruby-c7a8d63df84c4884cb30cc58292ec36efabfabbb.tar.gz |
Terminate interaction when rescuing WebauthnVerificationError during wait_for_otp
Co-authored-by: Betty Li <makewithbetty@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/commands/owner_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/gemcutter_utilities.rb | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index eb66c510a9..fce32aca3e 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -101,7 +101,7 @@ permission to. rescue Gem::WebauthnVerificationError => e raise e rescue StandardError - # ignore + # ignore early exits to allow for completing the iteration of all owners end end diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb index c4f31dc0d6..e66fd0e60f 100644 --- a/lib/rubygems/gemcutter_utilities.rb +++ b/lib/rubygems/gemcutter_utilities.rb @@ -266,6 +266,9 @@ module Gem::GemcutterUtilities thread = Thread.new do Thread.current[:otp] = Gem::WebauthnListener.wait_for_otp_code(host, server) + rescue Gem::WebauthnVerificationError => e + alert_error e.message + terminate_interaction(1) end thread.abort_on_exception = true thread.report_on_exception = false |