This file is indexed.

/usr/lib/ruby/vendor_ruby/chef_zero/endpoints/user_association_requests_count_endpoint.rb is in chef-zero 5.1.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
require "ffi_yajl"
require "chef_zero/rest_base"

module ChefZero
  module Endpoints
    # /users/NAME/association_requests/count
    class UserAssociationRequestsCountEndpoint < RestBase
      def get(request)
        get_data(request, request.rest_path[0..-3])

        username = request.rest_path[1]
        result = list_data(request, [ "organizations" ]).select do |org|
          exists_data?(request, [ "organizations", org, "association_requests", username ])
        end
        json_response(200, { "value" => result.size })
      end
    end
  end
end