Sha256: e4f27530d29c75aa7ec61d85e2f14aa675687a698d625c7556e8fc525ad5caa2

Contents?: true

Size: 748 Bytes

Versions: 32

Compression:

Stored size: 748 Bytes

Contents

# frozen_string_literal: true

class Puppet::Network::HTTP::API::IndirectionType
  INDIRECTION_TYPE_MAP = {
    "certificate" => :ca,
    "certificate_request" => :ca,
    "certificate_revocation_list" => :ca,
    "certificate_status" => :ca
  }

  def self.master_url_prefix
    "#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/v3"
  end

  def self.ca_url_prefix
    "#{Puppet::Network::HTTP::CA_URL_PREFIX}/v1"
  end

  def self.type_for(indirection)
    INDIRECTION_TYPE_MAP[indirection] || :master
  end

  def self.url_prefix_for(indirection_name)
    case type_for(indirection_name)
    when :ca
      ca_url_prefix
    when :master
      master_url_prefix
    else
      raise ArgumentError, _("Not a valid indirection type")
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/network/http/api/indirection_type.rb
puppet-8.10.0-x86-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.10.0-x64-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.10.0-universal-darwin lib/puppet/network/http/api/indirection_type.rb
puppet-8.9.0 lib/puppet/network/http/api/indirection_type.rb
puppet-8.9.0-x86-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.9.0-x64-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.9.0-universal-darwin lib/puppet/network/http/api/indirection_type.rb
puppet-8.8.1 lib/puppet/network/http/api/indirection_type.rb
puppet-8.8.1-x86-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.8.1-x64-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.8.1-universal-darwin lib/puppet/network/http/api/indirection_type.rb
puppet-8.7.0 lib/puppet/network/http/api/indirection_type.rb
puppet-8.7.0-x86-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.7.0-x64-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.7.0-universal-darwin lib/puppet/network/http/api/indirection_type.rb
puppet-8.6.0 lib/puppet/network/http/api/indirection_type.rb
puppet-8.6.0-x86-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.6.0-x64-mingw32 lib/puppet/network/http/api/indirection_type.rb
puppet-8.6.0-universal-darwin lib/puppet/network/http/api/indirection_type.rb