/usr/lib/ruby/vendor_ruby/chef_zero/endpoints/group_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 20 | require "ffi_yajl"
require "chef_zero/endpoints/rest_object_endpoint"
require "chef_zero/chef_data/data_normalizer"
module ChefZero
module Endpoints
# /organizations/ORG/groups/NAME
class GroupEndpoint < RestObjectEndpoint
def initialize(server)
super(server, %w{id groupname})
end
def populate_defaults(request, response_json)
group = FFI_Yajl::Parser.parse(response_json)
group = ChefData::DataNormalizer.normalize_group(group, request.rest_path[3], request.rest_path[1])
FFI_Yajl::Encoder.encode(group, :pretty => true)
end
end
end
end
|