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.


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

def initialize(_options)
    raise "Not implemented"
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials


11
12
13
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 11

def credentials
  @credentials
end

#profileObject (readonly)

Returns the value of attribute profile


11
12
13
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 11

def profile
  @profile
end

#regionObject (readonly)

Returns the value of attribute region


11
12
13
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 11

def region
  @region
end

#role_arnObject (readonly)

Returns the value of attribute role_arn


11
12
13
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 11

def role_arn
  @role_arn
end

Class Method Details

.priority(i) ⇒ Object


22
23
24
25
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 22

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

.register_if_completeObject


27
28
29
30
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 27

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

.type(str) ⇒ Object


17
18
19
20
# File 'lib/aws_assume_role/credentials/factories/abstract_factory.rb', line 17

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