Sha256: 6e389766f982bc8126e197b4cbcad892efb5b1226d761984b2338cd268c92ae6

Contents?: true

Size: 946 Bytes

Versions: 6

Compression:

Stored size: 946 Bytes

Contents

# frozen_string_literal: true

require_relative "includes"
require_relative "repository"
require_relative "../../profile_configuration"

class AwsAssumeRole::Credentials::Factories::AbstractFactory
    include AwsAssumeRole
    include AwsAssumeRole::Credentials::Factories
    include AwsAssumeRole::Logging

    Dry::Types.register("aws.sharedcredentials", Aws::SharedCredentials)
    attr_reader :credentials, :region, :profile, :role_arn

    def initialize(_options)
        raise "Not implemented"
    end

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aws_assume_role-1.2.0 lib/aws_assume_role/credentials/factories/abstract_factory.rb
aws_assume_role-1.2.0-linux lib/aws_assume_role/credentials/factories/abstract_factory.rb
aws_assume_role-1.2.0-universal-openbsd lib/aws_assume_role/credentials/factories/abstract_factory.rb
aws_assume_role-1.2.0-universal-darwin lib/aws_assume_role/credentials/factories/abstract_factory.rb
aws_assume_role-1.2.0-universal-freebsd lib/aws_assume_role/credentials/factories/abstract_factory.rb
aws_assume_role-1.2.0-universal-linux lib/aws_assume_role/credentials/factories/abstract_factory.rb