Sha256: 9c35f51a8fa478c259cd6c766ef2ec27fcc45c3fc5027516c0776fa90f6f281c

Contents?: true

Size: 911 Bytes

Versions: 6

Compression:

Stored size: 911 Bytes

Contents

module Katello
  class WhitelistConstraint
    PATHS = [/^\/api\/v2\/organizations\/\S+\/parameters/]

    def matches?(request)
      PATHS.map { |path| request.env["REQUEST_PATH"].match(path) }.any? ? false : true
    end
  end
end

Foreman::Application.routes.draw do
  override_message = '{"message": "Route forbidden by Katello, check katello/config/routes/overrides"}'

  match "/api/v2/organizations/*all", :to => proc { [404, {}, [override_message]] },
                                      :via => :get,
                                      :constraints => Katello::WhitelistConstraint.new

  match "/api/v1/organizations/:id", via: :delete, to: proc { [404, {}, [override_message]] }

  resources :operatingsystems, :only => [] do
    get 'available_kickstart_repo', :on => :member
  end

  resources :hosts, :only => [] do
    get 'puppet_environment_for_content_view', :on => :collection
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
katello-2.4.5 config/routes/overrides.rb
katello-2.4.4 config/routes/overrides.rb
katello-2.4.3 config/routes/overrides.rb
katello-2.4.2 config/routes/overrides.rb
katello-2.4.1 config/routes/overrides.rb
katello-2.4.0 config/routes/overrides.rb