Class: AwsAssumeRole::Credentials::Factories::DefaultChainProvider

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer::Mixin
Includes:
AwsAssumeRole::Credentials::Factories
Defined in:
lib/aws_assume_role/credentials/factories/default_chain_provider.rb

Constant Summary

Constants included from AwsAssumeRole::Credentials::Factories

Types

Constants included from AwsAssumeRole

AwsAssumeRole::Config, DefaultProvider, VERSION

Instance Method Summary collapse

Methods included from Logging

included

Methods included from AwsAssumeRole

shared_config

Constructor Details

#initialize(*options) ⇒ DefaultChainProvider

Returns a new instance of DefaultChainProvider.



36
37
38
39
40
41
42
43
44
# File 'lib/aws_assume_role/credentials/factories/default_chain_provider.rb', line 36

def initialize(*options)
    if options[0].is_a? Seahorse::Client::Configuration::DefaultResolver
        initialize_with_seahorse(options[0])
    else
        super(*options)
    end
    @profile_name ||= @profile
    @original_profile = @profile
end

Instance Method Details

#resolve(nil_with_role_not_set: false, explicit_default_profile: false) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/aws_assume_role/credentials/factories/default_chain_provider.rb', line 46

def resolve(nil_with_role_not_set: false, explicit_default_profile: false)
    resolve_final_credentials(explicit_default_profile)
    nil_creds = Aws::Credentials.new(nil, nil, nil)
    return nil_creds if (nil_with_role_not_set &&
                         @role_arn &&
                         @credentials.credentials.session_token.nil?) || @credentials.nil?
    @credentials
end