diff options
author | Jordan Running <jr@getchef.com> | 2016-01-26 13:28:04 -0600 |
---|---|---|
committer | Jordan Running <jr@getchef.com> | 2016-02-10 17:06:57 -0600 |
commit | 96a82ea1050e1dd360035b760c19faca5678251c (patch) | |
tree | 6c4ed0a351442451462ab3e93fc1d346918ca14f | |
parent | 666885cfe0db0053e67cf9cef65e0a1a5df0acd0 (diff) | |
download | chef-zero-96a82ea1050e1dd360035b760c19faca5678251c.tar.gz |
Rename UserKey(s)Endpoint to ActorKey(s)Endpoint, add client keys routes
-rw-r--r-- | lib/chef_zero/endpoints/actor_key_endpoint.rb (renamed from lib/chef_zero/endpoints/user_key_endpoint.rb) | 3 | ||||
-rw-r--r-- | lib/chef_zero/endpoints/actor_keys_endpoint.rb (renamed from lib/chef_zero/endpoints/user_keys_endpoint.rb) | 4 | ||||
-rw-r--r-- | lib/chef_zero/server.rb | 10 | ||||
-rw-r--r-- | spec/run_oc_pedant.rb | 6 |
4 files changed, 14 insertions, 9 deletions
diff --git a/lib/chef_zero/endpoints/user_key_endpoint.rb b/lib/chef_zero/endpoints/actor_key_endpoint.rb index 4e4872b..4cfd4b2 100644 --- a/lib/chef_zero/endpoints/user_key_endpoint.rb +++ b/lib/chef_zero/endpoints/actor_key_endpoint.rb @@ -4,7 +4,8 @@ require 'chef_zero/rest_base' module ChefZero module Endpoints # /users/USER/keys/NAME - class UserKeyEndpoint < RestBase + # /organizations/ORG/clients/CLIENT/keys/NAME + class ActorKeyEndpoint < RestBase def get(request) path = [ "user_keys", *request.rest_path[1..-1] ] already_json_response(200, get_data(request, path)) diff --git a/lib/chef_zero/endpoints/user_keys_endpoint.rb b/lib/chef_zero/endpoints/actor_keys_endpoint.rb index c6aea07..405a927 100644 --- a/lib/chef_zero/endpoints/user_keys_endpoint.rb +++ b/lib/chef_zero/endpoints/actor_keys_endpoint.rb @@ -4,8 +4,8 @@ require 'chef_zero/rest_base' module ChefZero module Endpoints # /users/USER/keys - - class UserKeysEndpoint < RestBase + # /organizations/ORG/clients/CLIENT/keys + class ActorKeysEndpoint < RestBase DATE_FORMAT = "%FT%TZ" # e.g. 2015-12-24T21:00:00Z def get(request) diff --git a/lib/chef_zero/server.rb b/lib/chef_zero/server.rb index f0ad9b1..45d36c3 100644 --- a/lib/chef_zero/server.rb +++ b/lib/chef_zero/server.rb @@ -94,8 +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/user_key_endpoint' -require 'chef_zero/endpoints/user_keys_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' @@ -539,8 +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", UserKeysEndpoint.new(self) ], - [ "/users/*/keys/*", UserKeyEndpoint.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) ], @@ -568,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) ], diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index 25b5ea9..25672fb 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -145,10 +145,12 @@ begin default_skips + chef_fs_skips + %w{ --skip-knife } end + pedant_args << "--focus-client-keys" + Pedant.setup(pedant_args) - fail_fast = %w()#--fail-fast) - #fail_fast = ["--fail-fast"] + # fail_fast = [] + fail_fast = ["--fail-fast"] result = RSpec::Core::Runner.run(Pedant.config.rspec_args + fail_fast) |