Closed philipp-classen closed 5 months ago
I've tried to do the same, but it turns out that there's a library for obtaining credentials: https://github.com/y2k2mt/aws-credentials.cr
The only thing needed here is a session_key
added as another argument in the client constructor.
I've tried to do the same, but it turns out that there's a library for obtaining credentials: https://github.com/y2k2mt/aws-credentials.cr The only thing needed here is a
session_key
added as another argument in the client constructor.
@anton7c3 Thanks, I got it working with your pull requests. For instance, code like this can be used to instantiate a client:
require "aws-credentials"
require "awscr-s3"
include Aws::Credentials
REGION = "us-east-1"
provider = Providers.new([EnvProvider.new, SharedCredentialFileProvider.new] of Provider)
cred = provider.credentials
client = Awscr::S3::Client.new(REGION, cred.access_key_id, cred.secret_access_key, cred.session_token)
Closing this, as it is obsolete now.
I tried to make the naming more consistent, which resulted in a small change in awscr-signer, but I don't have a strong opinion on the naming (-> https://github.com/taylorfinnell/awscr-signer/pull/61).
Now the following code should work if the environment variables are set:
fixes #105