[前][次][番号順一覧][スレッド一覧]

ruby-changes:71641

From: Ashley <ko1@a...>
Date: Wed, 6 Apr 2022 08:55:15 +0900 (JST)
Subject: [ruby-changes:71641] 7bb6449fe5 (master): [rubygems/rubygems] Make mfa the default

https://git.ruby-lang.org/ruby.git/commit/?id=7bb6449fe5

From 7bb6449fe5e90a189dd03a47b3862f9a5912705d Mon Sep 17 00:00:00 2001
From: Ashley Ellis Pierce <anellis12@g...>
Date: Mon, 24 Jan 2022 16:19:15 -0500
Subject: [rubygems/rubygems] Make mfa the default

https://github.com/rubygems/rubygems/commit/0b636f6902
---
 lib/rubygems/gemcutter_utilities.rb               | 4 ++--
 test/rubygems/test_gem_commands_signin_command.rb | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb
index 895caf57e7..3f111c628e 100644
--- a/lib/rubygems/gemcutter_utilities.rb
+++ b/lib/rubygems/gemcutter_utilities.rb
@@ -273,8 +273,8 @@ module Gem::GemcutterUtilities https://github.com/ruby/ruby/blob/trunk/lib/rubygems/gemcutter_utilities.rb#L273
     mfa_level = get_user_mfa_level(email, password)
     params = {}
     if mfa_level == "ui_only" || mfa_level == "ui_and_gem_signin"
-      selected = ask "Would you like to enable MFA for this key? [y/N]"
-      params["mfa"] = true if selected =~ /^[yY](es)?$/
+      selected = ask "Would you like to enable MFA for this key? [Y/n]"
+      params["mfa"] = true unless selected =~ /^[nN](o)?$/
     end
     params
   end
diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb
index ea10bb0fb2..c2c3aac76f 100644
--- a/test/rubygems/test_gem_commands_signin_command.rb
+++ b/test/rubygems/test_gem_commands_signin_command.rb
@@ -125,7 +125,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L125
     assert_match "remove_owner [y/N]", key_name_ui.output
     assert_match "access_webhooks [y/N]", key_name_ui.output
     assert_match "show_dashboard [y/N]", key_name_ui.output
-    assert_match "Would you like to enable MFA for this key? [y/N]", key_name_ui.output
+    assert_match "Would you like to enable MFA for this key? [Y/n]", key_name_ui.output
     assert_equal "name=test-key&push_rubygem=true&mfa=true", fetcher.last_request.body
 
     credentials = load_yaml_file Gem.configuration.credentials_path
@@ -152,7 +152,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L152
     assert_match "remove_owner [y/N]", key_name_ui.output
     assert_match "access_webhooks [y/N]", key_name_ui.output
     assert_match "show_dashboard [y/N]", key_name_ui.output
-    assert_match "Would you like to enable MFA for this key? [y/N]", key_name_ui.output
+    assert_match "Would you like to enable MFA for this key? [Y/n]", key_name_ui.output
     assert_equal "name=test-key&push_rubygem=true&mfa=true", fetcher.last_request.body
 
     credentials = load_yaml_file Gem.configuration.credentials_path
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]