Class: AwsAssumeRole::Credentials::Factories::AbstractFactory

Inherits:
Object
  • Object
show all
Includes:
AwsAssumeRole, AwsAssumeRole::Credentials::Factories, Logging
Defined in:
lib/aws_assume_role/credentials/factories/abstract_factory.rb

Direct Known Subclasses

AssumeRole, Environment, InstanceProfile, Shared, Static

Constant Summary

Constants included from AwsAssumeRole::Credentials::Factories

Types

Constants included from AwsAssumeRole

AwsAssumeRole::Config, DefaultProvider, VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

included

Methods included from AwsAssumeRole

shared_config

Constructor Details

#initialize(_options) ⇒ AbstractFactory

Returns a new instance of AbstractFactory.



15
16
17
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 15

def initialize(_options)
    raise "Not implemented"
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



13
14
15
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 13

def credentials
  @credentials
end

#profileObject (readonly)

Returns the value of attribute profile.



13
14
15
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 13

def profile
  @profile
end

#regionObject (readonly)

Returns the value of attribute region.



13
14
15
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 13

def region
  @region
end

#role_arnObject (readonly)

Returns the value of attribute role_arn.



13
14
15
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 13

def role_arn
  @role_arn
end

Class Method Details

.priority(i) ⇒ Object



24
25
26
27
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 24

def self.priority(i)
    @priority = Types::Strict::Int[i]
    register_if_complete
end

.register_if_completeObject



29
30
31
32
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 29

def self.register_if_complete
    return unless @type && @priority
    Repository.register_factory(self, @type, @priority)
end

.type(str) ⇒ Object



19
20
21
22
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 19

def self.type(str)
    @type = Types::Strict::Symbol.enum(:credential_provider, :second_factor_provider, :instance_role_provider)[str]
    register_if_complete
end