summaryrefslogtreecommitdiff
path: root/lib/chef_zero/server.rb
diff options
context:
space:
mode:
authorJordan Running <jr@getchef.com>2016-02-11 13:06:56 -0600
committerJordan Running <jr@getchef.com>2016-02-24 13:35:19 -0600
commit2469894eab12f24893916b571a981e082dfe97df (patch)
treebc657d22f7f41dad46a68f9825189c2dd20053b9 /lib/chef_zero/server.rb
parent86e99a48cc39a0b5c931c29fbfef9e196252c9c2 (diff)
downloadchef-zero-2469894eab12f24893916b571a981e082dfe97df.tar.gz
Make user and client keys endpoints pass Pedant specs
- Implement ActorKeyEndpoint, ActorKeysEndpoint. - Implement user, client keys in `ActorEndpoint#delete`, `#put`. - RestBase - Fix RestErrorResponse exceptions to report actual `rest_path` instead associated with the failed data store operation instead of `request.rest_path`. - Move `json_response`, `already_json_response` args `request_version` and `response_version` into options hash; add docs. - DataError, RestErrorResponse: Pass useful message text to `super`. - RestRouter: Clean up logging - Print request methods, paths and bodies more readably for log_level >= INFO. - Pretty-print RestRequest objects (only printed when log_level == DEBUG). - Server: Change default log_level to `:warn` (to enable logging cleanup above). - `Rakefile`, `spec/run_oc_pedant.rb` - Consume RSpec, Pedant options from `ENV['RSPEC_OPTS']`, `ENV['PEDANT_OPTS']` (see `rake -D`). - Consume `ENV['LOG_LEVEL'` (see `rake -D`). - Clean up ChefZero::Server default opts and move duplicated logic to `start_chef_server` method.
Diffstat (limited to 'lib/chef_zero/server.rb')
-rw-r--r--lib/chef_zero/server.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef_zero/server.rb b/lib/chef_zero/server.rb
index d6f27c4..da277b6 100644
--- a/lib/chef_zero/server.rb
+++ b/lib/chef_zero/server.rb
@@ -94,6 +94,8 @@ require 'chef_zero/endpoints/system_recovery_endpoint'
require 'chef_zero/endpoints/user_association_requests_endpoint'
require 'chef_zero/endpoints/user_association_requests_count_endpoint'
require 'chef_zero/endpoints/user_association_request_endpoint'
+require 'chef_zero/endpoints/actor_key_endpoint'
+require 'chef_zero/endpoints/actor_keys_endpoint'
require 'chef_zero/endpoints/user_organizations_endpoint'
require 'chef_zero/endpoints/file_store_file_endpoint'
require 'chef_zero/endpoints/not_found_endpoint'
@@ -107,7 +109,7 @@ module ChefZero
DEFAULT_OPTIONS = {
:host => '127.0.0.1',
:port => 8889,
- :log_level => :info,
+ :log_level => :warn,
:generate_real_keys => true,
:single_org => 'chef',
:ssl => false
@@ -537,6 +539,8 @@ module ChefZero
[ "/users/*/association_requests", UserAssociationRequestsEndpoint.new(self) ],
[ "/users/*/association_requests/count", UserAssociationRequestsCountEndpoint.new(self) ],
[ "/users/*/association_requests/*", UserAssociationRequestEndpoint.new(self) ],
+ [ "/users/*/keys", ActorKeysEndpoint.new(self) ],
+ [ "/users/*/keys/*", ActorKeyEndpoint.new(self) ],
[ "/users/*/organizations", UserOrganizationsEndpoint.new(self) ],
[ "/authenticate_user", AuthenticateUserEndpoint.new(self) ],
[ "/system_recovery", SystemRecoveryEndpoint.new(self) ],
@@ -564,6 +568,8 @@ module ChefZero
[ "/dummy", DummyEndpoint.new(self) ],
[ "/organizations/*/clients", ActorsEndpoint.new(self) ],
[ "/organizations/*/clients/*", ActorEndpoint.new(self) ],
+ [ "/organizations/*/clients/*/keys", ActorKeysEndpoint.new(self) ],
+ [ "/organizations/*/clients/*/keys/*", ActorKeyEndpoint.new(self) ],
[ "/organizations/*/controls", ControlsEndpoint.new(self) ],
[ "/organizations/*/cookbooks", CookbooksEndpoint.new(self) ],
[ "/organizations/*/cookbooks/*", CookbookEndpoint.new(self) ],