Homogenize GET requests
parent
846df018e0
commit
08b53a1ef7
|
@ -7,7 +7,7 @@ module RemoteSessionEventDataService
|
|||
SESSION_EVENT_MDM_CLASS = 'Mdm::SessionEvent'
|
||||
|
||||
def session_events(opts = {})
|
||||
json_to_mdm_object(self.get_data(SESSION_EVENT_API_PATH, opts), SESSION_EVENT_MDM_CLASS, [])
|
||||
json_to_mdm_object(self.get_data(SESSION_EVENT_API_PATH, nil, opts), SESSION_EVENT_MDM_CLASS, [])
|
||||
end
|
||||
|
||||
def report_session_event(opts)
|
||||
|
|
|
@ -27,7 +27,6 @@ module HostServlet
|
|||
def self.get_host
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.hosts(sanitized_params)
|
||||
includes = [:loots]
|
||||
|
|
|
@ -22,7 +22,6 @@ module LootServlet
|
|||
def self.get_loot
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.loots(sanitized_params)
|
||||
includes = [:host]
|
||||
|
|
|
@ -22,7 +22,6 @@ module NoteServlet
|
|||
def self.get_note
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.notes(sanitized_params)
|
||||
includes = [:host]
|
||||
|
|
|
@ -22,8 +22,8 @@ module ServiceServlet
|
|||
def self.get_services
|
||||
lambda {
|
||||
begin
|
||||
opts = sanitize_params(params)
|
||||
data = get_db.services(opts)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.services(sanitized_params)
|
||||
includes = [:host]
|
||||
set_json_response(data, includes)
|
||||
rescue => e
|
||||
|
|
|
@ -16,8 +16,8 @@ module SessionEventServlet
|
|||
def self.get_session_event
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
data = get_db.session_events(opts)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.session_events(sanitized_params)
|
||||
set_json_response(data)
|
||||
rescue => e
|
||||
set_error_on_response(e)
|
||||
|
|
|
@ -20,7 +20,6 @@ module SessionServlet
|
|||
def self.get_session
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.sessions(sanitized_params)
|
||||
includes = [:host]
|
||||
|
|
|
@ -20,8 +20,8 @@ module VulnAttemptServlet
|
|||
def self.get_vuln_attempt
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
data = get_db.vuln_attempts(params.symbolize_keys)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.vuln_attempts(sanitized_params)
|
||||
set_json_response(data)
|
||||
rescue => e
|
||||
set_error_on_response(e)
|
||||
|
|
|
@ -22,7 +22,6 @@ module VulnServlet
|
|||
def self.get_vuln
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
sanitized_params = sanitize_params(params)
|
||||
data = get_db.vulns(sanitized_params)
|
||||
includes = [:host, :vulns_refs, :refs, :module_refs]
|
||||
|
|
|
@ -22,7 +22,6 @@ module WorkspaceServlet
|
|||
def self.get_workspace
|
||||
lambda {
|
||||
begin
|
||||
opts = parse_json_request(request, false)
|
||||
includes = nil
|
||||
|
||||
sanitized_params = sanitize_params(params)
|
||||
|
|
Loading…
Reference in New Issue