Class: AwsAssumeRole::Credentials::Factories::Repository

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

Constant Summary collapse

SubFactoryRepositoryType =
Types::Hash.schema(Types::Coercible::Int => Types::Strict::Array)
FactoryRepositoryType =
Types::Hash.schema(
    credential_provider: SubFactoryRepositoryType,
    second_factor_provider: SubFactoryRepositoryType,
    instance_role_provider: SubFactoryRepositoryType,
)

Constants included from AwsAssumeRole::Credentials::Factories

Types

Constants included from AwsAssumeRole

AwsAssumeRole::Config, DefaultProvider, VERSION

Class Method Summary collapse

Methods included from Logging

included

Methods included from AwsAssumeRole

shared_config

Class Method Details

.factoriesObject


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

def self.factories
    repository.keys.map { |t| [t, flatten_factory_type_list(t)] }.to_h
end

.flatten_factory_type_list(type) ⇒ Object


32
33
34
# File 'lib/aws_assume_role/credentials/factories/repository.rb', line 32

def self.flatten_factory_type_list(type)
    repository[type].keys.sort.map { |x| @repository[type][x] }.flatten
end

.register_factory(klass, type, priority) ⇒ Object


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

def self.register_factory(klass, type, priority)
    repository[type][priority] ||= []
    repository[type][priority] << klass
end

.repositoryObject


19
20
21
22
23
24
25
# File 'lib/aws_assume_role/credentials/factories/repository.rb', line 19

def self.repository
    @repository ||= FactoryRepositoryType[
        credential_provider: {},
        second_factor_provider: {},
        instance_role_provider: {},
    ]
end