Sha256: de97c5d1f3c080dd836833fe92bd197e6f4e5c52a239a8a48dabb3dedacbefa9
Contents?: true
Size: 842 Bytes
Versions: 43
Compression:
Stored size: 842 Bytes
Contents
# frozen_string_literal: true require_relative "abstract_factory" class AwsAssumeRole::Credentials::Factories::Environment < AwsAssumeRole::Credentials::Factories::AbstractFactory type :credential_provider priority 10 def initialize(_options, **) key = %w[AWS_ACCESS_KEY_ID AMAZON_ACCESS_KEY_ID AWS_ACCESS_KEY] secret = %w[AWS_SECRET_ACCESS_KEY AMAZON_SECRET_ACCESS_KEY AWS_SECRET_KEY] token = %w[AWS_SESSION_TOKEN AMAZON_SESSION_TOKEN] region = %w[AWS_DEFAULT_REGION] profile = %w[AWS_PROFILE] @credentials = Aws::Credentials.new(envar(key), envar(secret), envar(token)) @region = envar(region) @profile = envar(profile) end def envar(keys) keys.each do |key| return ENV[key] if ENV.key?(key) end nil end end
Version data entries
43 entries across 43 versions & 1 rubygems