You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is kind of not so awesome; we need to be able to manage multiple credentials/connections sometimes.
key = OpenSSL::PKey::RSA.new(1024)
region = 'us-east-1'
s3_client_options = {
region: region,
credentials: Aws::Credentials.new(valid_key, valid_s_key)
}
# Have to set this because of other bug
# https://github.com/aws/aws-sdk-ruby/issues/800
ENV['AWS_DEFAULT_REGION'] = region
@s3_client = Aws::S3::Encryption::Client.new(s3_client_options.merge(encryption_key: key))
f = File.new('/var/log/file.csv')
@s3_client.put_object(bucket: 'bucket', key: 'some/path/to/test/encryption', body: f)
Aws::Errors::MissingCredentialsError: unable to sign request without credentials set
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/request_signer.rb:94:in `require_credentials'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_request_signer.rb:26:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/xml/error_handler.rb:8:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_request_signer.rb:124:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_redirects.rb:15:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/retry_errors.rb:88:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_md5s.rb:33:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_expect_100_continue.rb:21:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_bucket_dns.rb:31:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/rest_body_handler.rb:9:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/user_agent.rb:12:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/restful_bindings.rb:13:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/endpoint.rb:35:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-resources-2.0.41/lib/aws-sdk-resources/services/s3/encryption/encrypt_handler.rb:19:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/param_validation.rb:22:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/s3_sse_cpk.rb:18:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/param_conversion.rb:22:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/plugins/response_target.rb:18:in `call'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-core-2.0.41/lib/seahorse/client/request.rb:70:in `send_request'
from /opt/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/aws-sdk-resources-2.0.41/lib/aws-sdk-resources/services/s3/encryption/client.rb:217:in `put_object'
from (irb):17
from /opt/rbenv/versions/2.1.5/bin/irb:11:in `<main>'irb(main):018:0>
The @option tag for the `:client` option contained a typo
preventing it from rendering in the API reference documentation.
The current usage is:
s3 = Aws::S3::Client.new(region:'...', credentials: ...)
s3 = Aws::S3::Encryption::Client(client: s3)
See #800
See #801
This is kind of not so awesome; we need to be able to manage multiple credentials/connections sometimes.
But if we try again after setting keys in the ENV
The text was updated successfully, but these errors were encountered: