Commit graph

88 commits

Author SHA1 Message Date
Mike Perham
5d0708378e
[rubygems/rubygems] Smoother authentication experience
Copying the URL is painful here because the URL is embedded within a paragraph of text. I presume we don't want to automatically open the browser.

Instead, move the URL to its own line so that "triple click" will automatically select the whole thing.

21532a69ae
2025-05-02 09:49:15 +09:00
David Rodríguez
9ce1b5e11f [rubygems/rubygems] Fix commands with 2 MFA requests when webauthn is enabled
If a command requires two MFA authenticated requests, and webauthn is
enabled, then first one will succeed but the second one will fail
because it tries to reuse the OTP code from the first request and that
does not work.

This happens when you have not yet logged in to rubygems.org, or when
you have an API key with invalid scopes for the current operation. In
that case, we need:

* An API request to get a token or change scopes for the one that you
  have.
* Another API request to perform the actual operation.

Instead of trying to reuse the token, make sure it's cleared so we are
asked to authenticate again. We only do this when webauthn is enabled
because reusing TOPT tokens otherwise is allowed and I don't want to
break that.

669e343935
2024-11-04 10:04:58 +00:00
David Rodríguez
7fba517d50 [rubygems/rubygems] OTP is already added by rubygems_api_request
15930fe126
2024-11-04 10:04:57 +00:00
Hiroshi SHIBATA
d2da774f87 [rubygems/rubygems] Rename wrapper files for vendored libraries with 'vendored_' prefix
cfc908c8c1
2024-02-26 22:04:04 +00:00
Vitaliy Serov
0bcad50c8c [rubygems/rubygems] Fix var name and also update other places
f72a7989cd
2024-02-02 19:26:58 +00:00
Vitaliy Serov
064f251571 [rubygems/rubygems] Change gem login message to clear up that username can be also used
2bf6163eaf
2024-02-02 19:26:57 +00:00
Willian Tenfen W
d42330d702 [rubygems/rubygems] Improve gem login scope selection
26c7abe5f6
2024-01-29 17:22:01 +00:00
David Rodríguez
d64d0b5423
Vendor uri gem in RubyGems 2024-01-29 12:14:21 +09:00
David Rodríguez
ce924ce1fb [rubygems/rubygems] Vendor net-http and net-protocol in RubyGems
99d91c9ed2
2023-12-13 12:16:55 +09:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Jenny Shen
fce04f9a6c [rubygems/rubygems] Move WebauthnListener into the Gem::GemcutterUtilities namespace
3080394f81
2023-07-28 16:08:08 +00:00
Jenny Shen
108cc38a76 [rubygems/rubygems] Extract polling logic into its own class
218b83abed
2023-07-28 16:08:07 +00:00
Jenny Shen
023d0f662b [rubygems/rubygems] Add Webauthn verification poller to fetch OTP
39c5e86a67
2023-07-28 16:08:07 +00:00
Hiroshi SHIBATA
ef54a9aeb6 [rubygems/rubygems] Introduce self.load_with_rubygems_config_hash
9175b8cf2a
2023-04-19 06:56:21 +00:00
Hiroshi SHIBATA
cdc2e3de10 [rubygems/rubygems] Wrap self.convert_rubygems_config_hash from Bundler::YAMLSerializer.load
080880ac23
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA
1225eff38f [rubygems/rubygems] Don't use Psych
d6555aaa28
2023-04-19 06:56:15 +00:00
Hiroshi SHIBATA
038c6e773f [rubygems/rubygems] Added explicitly loading for Gem::SafeYAML
3d9d587dd7
2023-04-19 06:56:15 +00:00
Ashley Ellis Pierce
851344965a
Ensure api_key is sent if basic auth not provided on webauthn_verification_url
Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
2023-04-12 12:00:25 +09:00
Eric Herscovich
1b1485ae4d
Add message for otp bypass
Update tests

Fix wording of message
2023-04-12 11:59:18 +09:00
Jenny Shen
b909ca94bd
Terminate interaction after wait for otp thread completes to support jruby 2023-04-12 11:58:03 +09:00
Jenny Shen
c7a8d63df8
Terminate interaction when rescuing WebauthnVerificationError during wait_for_otp
Co-authored-by: Betty Li <makewithbetty@gmail.com>
2023-04-12 11:57:43 +09:00
Jenny Shen
cd60113faa
Use Webauthn Listener in wait_for_otp 2023-04-12 11:57:15 +09:00
Jenny Shen
b6e860ba1b
Add wait for webauthn otp when fetching otp
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2023-04-12 11:57:11 +09:00
Ashley Ellis Pierce
774d1f1a00
Merge lines 2023-04-12 11:56:33 +09:00
Ashley Ellis Pierce
ea95ec5443 [rubygems/rubygems] Clarify message
d94173be49
2023-04-12 11:51:02 +09:00
Ashley Ellis Pierce
6275284f02 [rubygems/rubygems] Ask user to otp at webauthn verification url
004eadb0c5
2023-04-12 11:51:01 +09:00
Hiroshi SHIBATA
fb822076d7 [rubygems/rubygems] util/rubocop -A --only Style/LineEndConcatenation
67ece7b8b6
2023-04-06 23:33:20 +00:00
Hiroshi SHIBATA
f24a86d83f util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA
5efadf8139 [rubygems/rubygems] util/rubocop -A --only Lint/ShadowingOuterLocalVariable
82ed77178d
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA
7800d4eeb5 util/rubocop -A --only Style/MultipleComparison 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
31c572f4fa util/rubocop -A --only Style/SymbolArray 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
1ca67f13cd util/rubocop -A --only Style/RedundantSelf 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
712d6e675b [rubygems/rubygems] util/rubocop -A --only Style/RedundantInterpolation
add44e56eb
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
0b632b9cdd [rubygems/rubygems] util/rubocop -A --only Style/ClassCheck
1c3356a872
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
4bb5ce8188 [rubygems/rubygems] util/rubocop -A --only Style/StringLiteralsInInterpolation
cb554f6eb7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
583fbc627c [rubygems/rubygems] util/rubocop -A --only Layout/EmptyLinesAroundModuleBody
48c88466b7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
05208c3875 [rubygems/rubygems] util/rubocop -A --only Lint/UnusedBlockArgument
d8efd919db
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
b7ad60a794 Merge RubyGems/Bundler master
from 72fd3dd209
2022-12-26 15:09:21 +09:00
Jenny Shen
28840d74c2 [rubygems/rubygems] Refine error message to check the push URL instead of just the host
46990f3292
2022-09-29 17:56:36 +09:00
Jenny Shen
17b783ad9e [rubygems/rubygems] Surface entire redirect uri in permanent redirections
da7837630b
2022-09-29 17:56:35 +09:00
Jenny Shen
1cbf0fd863 [rubygems/rubygems] Add error message when api response is a permanent redirect
ccca30c77a

Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
2022-09-29 17:56:34 +09:00
Hiroshi SHIBATA
44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
Ashley Ellis Pierce
244bda7efd [rubygems/rubygems] Display mfa warnings on gem signin
4dc77b7099

Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
2022-07-23 03:42:59 +09:00
Takuya Noguchi
d7ffd3fea4
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-07-22 12:07:23 +09:00
Hiroshi SHIBATA
aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
Ashley Ellis Pierce
c59488a8e3 [rubygems/rubygems] Use ask_yes_no
1d38e167fa
2022-04-06 08:55:00 +09:00
Ashley Ellis Pierce
37a19f7f67 [rubygems/rubygems] Extract default_host method
6e10e75574
2022-04-06 08:54:59 +09:00
Ashley Ellis Pierce
b75b67f113 [rubygems/rubygems] Use YAML
6122e8cac5
2022-04-06 08:54:59 +09:00
Ashley Ellis Pierce
bb3ecdba6a [rubygems/rubygems] Accomodate gem hosts without profile/me endpoint
31b6dcf5d3
2022-04-06 08:54:58 +09:00
Ashley Ellis Pierce
75083704bf [rubygems/rubygems] Update endpoint
a5a7b3ec96
2022-04-06 08:54:58 +09:00