Class: AwsAssumeRole::Credentials::Factories::DefaultChainProvider
- Inherits:
-
Object
- Object
- AwsAssumeRole::Credentials::Factories::DefaultChainProvider
- 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
Constants included from AwsAssumeRole
AwsAssumeRole::Config, DefaultProvider, VERSION
Instance Method Summary collapse
-
#initialize(*options) ⇒ DefaultChainProvider
constructor
A new instance of DefaultChainProvider.
- #resolve(nil_with_role_not_set: false, explicit_default_profile: false) ⇒ Object
Methods included from Logging
Methods included from AwsAssumeRole
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(*) if [0].is_a? Seahorse::Client::Configuration::DefaultResolver initialize_with_seahorse([0]) else super(*) 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 |