-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from chef/mp/merge-pedants
CS12 Support
- Loading branch information
Showing
24 changed files
with
129 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
source 'https://rubygems.org' | ||
gemspec :path => '../' | ||
|
||
gem 'rest-client', :github => 'opscode/rest-client', :branch => 'lcg/1.6.7-version-lying' | ||
gem 'chef-pedant', :github => 'opscode/chef-pedant', :ref => '81f3b4ecbc09d04950f2819b38a6a8f906ada2a7' | ||
gem 'oc-chef-pedant', :git => '[email protected]:opscode/oc-chef-pedant', :ref => '3c0eb31f1e49aa947b81ad51387b7a68adbc5f91' | ||
gem 'chef', :github => 'opscode/chef' | ||
gem 'rest-client', :github => 'chef/rest-client', :branch => 'lcg/1.6.7-version-lying' | ||
gem 'oc-chef-pedant', :github => 'chef/oc-chef-pedant', :tag => '2.0.0' | ||
gem 'chef', :github => 'chef/chef' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'ffi_yajl' | ||
require 'chef_zero/rest_base' | ||
require 'uuidtools' | ||
|
||
module ChefZero | ||
module Endpoints | ||
# /organizations/NAME/nodes/NAME/_identifiers | ||
class NodeIdentifiersEndpoint < RestBase | ||
def get(request) | ||
if get_data(request, request.rest_path[0..3]) | ||
result = { | ||
:id => UUIDTools::UUID.parse_raw(request.rest_path[0..4].to_s).to_s.gsub('-',''), | ||
:authz_id => '0'*32, | ||
:org_id => UUIDTools::UUID.parse_raw(request.rest_path[0..1].to_s).to_s.gsub('-','') } | ||
json_response(200, result) | ||
else | ||
raise RestErrorResponse.new(404, "Object not found: #{build_uri(request.base_uri, request.rest_path)}") | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'ffi_yajl' | ||
require 'chef_zero/rest_base' | ||
|
||
module ChefZero | ||
module Endpoints | ||
module OrganizationUserBase | ||
|
||
def self.get(obj, request, &block) | ||
result = obj.list_data(request).map(&block) | ||
obj.json_response(200, result) | ||
end | ||
|
||
def self.post(obj, request, key) | ||
json = FFI_Yajl::Parser.parse(request.body, :create_additions => false) | ||
username = json[key] | ||
orgname = request.rest_path[1] | ||
id = "#{username}-#{orgname}" | ||
|
||
if obj.exists_data?(request, [ 'organizations', orgname, 'users', username ]) | ||
raise RestErrorResponse.new(409, "User #{username} is already in organization #{orgname}") | ||
end | ||
|
||
obj.create_data(request, request.rest_path, username, '{}') | ||
obj.json_response(201, { "uri" => obj.build_uri(request.base_uri, request.rest_path + [ id ]) }) | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.