Skip to content

Commit

Permalink
Add external_authentication_uid to actors endpoint for querying
Browse files Browse the repository at this point in the history
  • Loading branch information
kmacgugan committed Jun 9, 2016
1 parent f6f92e1 commit ddc6fd0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/chef_zero/endpoints/actors_endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ def get(request)
response[2] = to_json(new_results)
end

if request.query_params['external_authentication_uid']
results = parse_json(response[2])
new_results = {}
results.each do |name, url|
record = get_data(request, request.rest_path + [ name ], :nil)
if record
record = parse_json(record)
new_results[name] = url if record['external_authentication_uid'] == request.query_params['external_authentication_uid']
end
end
response[2] = to_json(new_results)
end

if request.query_params['verbose']
results = parse_json(response[2])
results.each do |name, url|
Expand Down

0 comments on commit ddc6fd0

Please sign in to comment.