method
s3_source_auth
v2_6_3 -
Show latest stable
- Class:
Gem::RemoteFetcher
s3_source_auth(uri)private
No documentation available.
# File lib/rubygems/remote_fetcher.rb, line 389
def s3_source_auth(uri)
return [uri.user, uri.password] if uri.user && uri.password
s3_source = Gem.configuration[:s3_source] || Gem.configuration['s3_source']
host = uri.host
raise FetchError.new("no s3_source key exists in .gemrc", "s3://#{host}") unless s3_source
auth = s3_source[host] || s3_source[host.to_sym]
raise FetchError.new("no key for host #{host} in s3_source in .gemrc", "s3://#{host}") unless auth
id = auth[:id] || auth['id']
secret = auth[:secret] || auth['secret']
raise FetchError.new("s3_source for #{host} missing id or secret", "s3://#{host}") unless id and secret
[id, secret]
end