New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize JSON into MDM Objects #9394

Closed
wants to merge 57 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+5 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Fix a couple of bugs.

  • Loading branch information...
jbarnett-r7 committed Sep 19, 2017
commit 9f95f880359dbbcf28cf48d5d75a5a2d6044fc41
@@ -59,6 +59,7 @@ def post_data(path, data_hash)
end
rescue Exception => e
puts "Problem with POST request: #{e.message}"
puts "#{e.backtrace}"
ensure
@client_pool << client
end
@@ -6,7 +6,7 @@ module RemoteLootDataService
LOOT_PATH = '/api/1/msf/loot'
LOOT_SEARCH_PATH = LOOT_PATH + "/search"
def loot(opts)
def loot(opts = {})
json_to_open_struct_object(self.get_data(LOOT_PATH, opts), [])
end
@@ -22,7 +22,7 @@ def report_loot(loot)
self.post_data(LOOT_PATH, loot)
end
def do_host_search(search)
def do_loot_search(search)
response = self.post_data(LOOT_SEARCH_PATH, search)
return response.body
end
@@ -17,7 +17,7 @@ def self.get_loot
lambda {
begin
opts = parse_json_request(request, false)
data = get_db().hosts(opts)
data = get_db().loots(opts)
set_json_response(data)
rescue Exception => e
set_error_on_response(e)
@@ -27,7 +27,7 @@ def self.get_loot
def self.report_loot
lambda {
job = lambda { |opts| get_db().report_host(opts) }
job = lambda { |opts| get_db().report_loot(opts) }
exec_report_job(request, &job)
}
end
ProTip! Use n and p to navigate between commits in a pull request.