Sha256: f0ba2b4df57525a14f389f29820df3cfd5c47e69e20a275e7e550add7b534905

Contents?: true

Size: 781 Bytes

Versions: 20

Compression:

Stored size: 781 Bytes

Contents

class Puppet::Network::HTTP::API::Master::V3
  require 'puppet/network/http/api/master/v3/environments'
  require 'puppet/network/http/api/indirected_routes'

  def self.wrap(&block)
    lambda do |request, response|
      Puppet::Network::Authorization.check_external_authorization(request.method, request.path)

      block.call.call(request, response)
    end
  end

  INDIRECTED = Puppet::Network::HTTP::Route.
      path(/.*/).
      any(wrap { Puppet::Network::HTTP::API::IndirectedRoutes.new } )

  ENVIRONMENTS = Puppet::Network::HTTP::Route.
      path(%r{^/environments$}).
      get(wrap { Environments.new(Puppet.lookup(:environments)) } )

  def self.routes
    Puppet::Network::HTTP::Route.path(%r{v3}).
        any.
        chain(ENVIRONMENTS, INDIRECTED)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-7.4.1 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.1-x86-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.1-x64-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.1-universal-darwin lib/puppet/network/http/api/master/v3.rb
puppet-7.4.0 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.0-x86-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.0-x64-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.4.0-universal-darwin lib/puppet/network/http/api/master/v3.rb
puppet-7.3.0 lib/puppet/network/http/api/master/v3.rb
puppet-7.3.0-x86-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.3.0-x64-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.3.0-universal-darwin lib/puppet/network/http/api/master/v3.rb
puppet-7.1.0 lib/puppet/network/http/api/master/v3.rb
puppet-7.1.0-x86-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.1.0-x64-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.1.0-universal-darwin lib/puppet/network/http/api/master/v3.rb
puppet-7.0.0 lib/puppet/network/http/api/master/v3.rb
puppet-7.0.0-x86-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.0.0-x64-mingw32 lib/puppet/network/http/api/master/v3.rb
puppet-7.0.0-universal-darwin lib/puppet/network/http/api/master/v3.rb