Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Commands::PushCommand#send_push_request_with_attestation
send_push_request_with_attestation(name, args)
lib/rubygems/commands/push_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/commands/push_command.rb, line 177
def send_push_request_with_attestation(name, args)
attestations = if options[:attestations].any?
options[:attestations].map do |attestation|
load_attestation(attestation)
end
else
# Only the opportunistic signing step falls back. The request below stays
# outside this rescue because once the server may have seen the attested
# push, a network error must not trigger an unattested retry.
begin
[attest!(name)]
rescue StandardError => e
message = "Failed to create an attestation, pushing without one.\n"
message += if Gem.configuration.really_verbose
e.full_message
else
e.message
end
alert_warning message
return send_push_request_without_attestation(name, args)
end
end
bundles = "[" + attestations.join(",") + "]"
rubygems_api_request(*args, scope: get_push_scope) do |request|
request.set_form([
["gem", Gem.read_binary(name), { filename: name, content_type: "application/octet-stream" }],
["attestations", bundles, { content_type: "application/json" }],
], "multipart/form-data")
request.add_field "Authorization", api_key
end
end
No documentation available