diff options
Diffstat (limited to 'lib/chef_zero/endpoints/organization_user_key_endpoint.rb')
-rw-r--r-- | lib/chef_zero/endpoints/organization_user_key_endpoint.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/chef_zero/endpoints/organization_user_key_endpoint.rb b/lib/chef_zero/endpoints/organization_user_key_endpoint.rb new file mode 100644 index 0000000..e0c114c --- /dev/null +++ b/lib/chef_zero/endpoints/organization_user_key_endpoint.rb @@ -0,0 +1,17 @@ +require 'chef_zero/rest_base' +require 'chef_zero/endpoints/actor_keys_endpoint' + +module ChefZero + module Endpoints + # GET /organizations/ORG/users/USER/keys/NAME + class OrganizationUserKeyEndpoint < RestBase + def get(request) + # 404 if not a member of the org + get_data(request, request.rest_path[0..3]) + # Just use the /users/USER/keys endpoint + request.rest_path = request.rest_path[2..-1] + ActorKeyEndpoint.new(server).get(request) + end + end + end +end |