instance method
Gem::GemcutterUtilities#update_scope
update_scope(scope)
lib/rubygems/gemcutter_utilities.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/gemcutter_utilities.rb, line 130
def update_scope(scope)
sign_in_host = host
pretty_host = pretty_host(sign_in_host)
update_scope_params = { scope => true }
say "The existing key doesn't have access of #{scope} on #{pretty_host}. Please sign in to update access."
identifier = ask "Username/email: "
password = ask_for_password " Password: "
response = rubygems_api_request(:put, "api/v1/api_key",
sign_in_host, scope: scope) do |request|
request.basic_auth identifier, password
request.body = Gem::URI.encode_www_form({ api_key: api_key }.merge(update_scope_params))
end
with_response response do |_resp|
say "Added #{scope} scope to the existing API key"
end
end
No documentation available
See also
#sign_in
#verify_api_key
#set_api_key
#wait_for_otp_thread
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0