Class: AwsAssumeRole::Credentials::Factories::SharedKeyring

Inherits:
AbstractFactory
  • Object
show all
Defined in:
lib/aws_assume_role/credentials/factories/shared_keyring.rb

Constant Summary

Constants included from AwsAssumeRole::Credentials::Factories

Types

Constants included from AwsAssumeRole

AwsAssumeRole::Config, DefaultProvider, VERSION

Instance Attribute Summary

Attributes inherited from AbstractFactory

#credentials, #profile, #region, #role_arn

Instance Method Summary collapse

Methods inherited from AbstractFactory

priority, register_if_complete, type

Methods included from Logging

included

Methods included from AwsAssumeRole

shared_config

Constructor Details

#initialize(options = {}) ⇒ SharedKeyring

Returns a new instance of SharedKeyring.



8
9
10
11
12
13
14
15
# File 'lib/aws_assume_role/credentials/factories/shared_keyring.rb', line 8

def initialize(options = {})
    @profile = options[:profile] || "default"
    @credentials = AwsAssumeRole::Credentials::Providers::SharedKeyringCredentials.new(profile_name: @profile)
    @region = AwsAssumeRole.shared_config.profile_region(@profile)
    @role_arn = AwsAssumeRole.shared_config.profile_role(@profile)
rescue Aws::Errors::NoSuchProfileError
    nil
end