Sha256: 7d20a3c71363ad5de630541413043288aade3e9d299ac6cab609be44730a4842

Contents?: true

Size: 694 Bytes

Versions: 5

Compression:

Stored size: 694 Bytes

Contents

module AwsAssumeRole::Store::Serialization
    module_function

    def credentials_from_hash(credentials)
        creds_for_deserialization = credentials.respond_to?("[]") ? credentials : credentials_to_hash(credentials)
        Aws::Credentials.new(creds_for_deserialization[:access_key_id],
                             creds_for_deserialization[:secret_access_key],
                             creds_for_deserialization[:session_token])
    end

    def credentials_to_hash(credentials)
        {
            access_key_id: credentials.access_key_id,
            secret_access_key: credentials.secret_access_key,
            session_token: credentials.session_token,
        }
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aws_assume_role-0.2.2 lib/aws_assume_role/store/serialization.rb
aws_assume_role-0.2.0 lib/aws_assume_role/store/serialization.rb
aws_assume_role-0.1.2 lib/aws_assume_role/store/serialization.rb
aws_assume_role-0.1.1 lib/aws_assume_role/store/serialization.rb
aws_assume_role-0.1.0 lib/aws_assume_role/store/serialization.rb