Class: ZAPv2::AjaxSpider

Inherits:
Object
  • Object
show all
Defined in:
lib/zap/v2apis/ajax_spider.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ AjaxSpider

Returns a new instance of AjaxSpider.



5
6
7
# File 'lib/zap/v2apis/ajax_spider.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#add_allowed_resource(regex, enabled = '') ⇒ Object

action



75
76
77
# File 'lib/zap/v2apis/ajax_spider.rb', line 75

def add_allowed_resource(regex, enabled = '')
  @client.get("/JSON/ajaxSpider/action/addAllowedResource/?regex=#{regex}&enabled=#{enabled}")
end

#add_excluded_element(contextname, description, element, xpath, text, attributename, attributevalue, enabled = '') ⇒ Object



79
80
81
82
# File 'lib/zap/v2apis/ajax_spider.rb', line 79

def add_excluded_element(contextname, description, element, xpath, text, attributename, attributevalue,
                         enabled = '')
  @client.get("/JSON/ajaxSpider/action/addExcludedElement/?contextName=#{contextname}&description=#{description}&element=#{element}&xpath=#{xpath}&text=#{text}&attributeName=#{attributename}&attributeValue=#{attributevalue}&enabled=#{enabled}")
end

#allowed_resourcesObject

view



10
11
12
# File 'lib/zap/v2apis/ajax_spider.rb', line 10

def allowed_resources
  @client.get('/JSON/ajaxSpider/view/allowedResources/')
end

#excluded_elements(contextname = '') ⇒ Object



14
15
16
# File 'lib/zap/v2apis/ajax_spider.rb', line 14

def excluded_elements(contextname = '')
  @client.get("/JSON/ajaxSpider/view/excludedElements/?contextName=#{contextname}")
end

#full_resultsObject



18
19
20
# File 'lib/zap/v2apis/ajax_spider.rb', line 18

def full_results
  @client.get('/JSON/ajaxSpider/view/fullResults/')
end

#modify_excluded_element(contextname, description, element, descriptionnew, xpath, text, attributename, attributevalue, enabled = '') ⇒ Object



84
85
86
87
# File 'lib/zap/v2apis/ajax_spider.rb', line 84

def modify_excluded_element(contextname, description, element, descriptionnew, xpath, text, attributename,
                            attributevalue, enabled = '')
  @client.get("/JSON/ajaxSpider/action/modifyExcludedElement/?contextName=#{contextname}&description=#{description}&element=#{element}&descriptionNew=#{descriptionnew}&xpath=#{xpath}&text=#{text}&attributeName=#{attributename}&attributeValue=#{attributevalue}&enabled=#{enabled}")
end

#number_of_resultsObject



22
23
24
# File 'lib/zap/v2apis/ajax_spider.rb', line 22

def number_of_results
  @client.get('/JSON/ajaxSpider/view/numberOfResults/')
end

#option_browser_idObject



26
27
28
# File 'lib/zap/v2apis/ajax_spider.rb', line 26

def option_browser_id
  @client.get('/JSON/ajaxSpider/view/optionBrowserId/')
end

#option_click_default_elemsObject



30
31
32
# File 'lib/zap/v2apis/ajax_spider.rb', line 30

def option_click_default_elems
  @client.get('/JSON/ajaxSpider/view/optionClickDefaultElems/')
end

#option_click_elems_onceObject



34
35
36
# File 'lib/zap/v2apis/ajax_spider.rb', line 34

def option_click_elems_once
  @client.get('/JSON/ajaxSpider/view/optionClickElemsOnce/')
end

#option_event_waitObject



38
39
40
# File 'lib/zap/v2apis/ajax_spider.rb', line 38

def option_event_wait
  @client.get('/JSON/ajaxSpider/view/optionEventWait/')
end

#option_max_crawl_depthObject



42
43
44
# File 'lib/zap/v2apis/ajax_spider.rb', line 42

def option_max_crawl_depth
  @client.get('/JSON/ajaxSpider/view/optionMaxCrawlDepth/')
end

#option_max_crawl_statesObject



46
47
48
# File 'lib/zap/v2apis/ajax_spider.rb', line 46

def option_max_crawl_states
  @client.get('/JSON/ajaxSpider/view/optionMaxCrawlStates/')
end

#option_max_durationObject



50
51
52
# File 'lib/zap/v2apis/ajax_spider.rb', line 50

def option_max_duration
  @client.get('/JSON/ajaxSpider/view/optionMaxDuration/')
end

#option_number_of_browsersObject



54
55
56
# File 'lib/zap/v2apis/ajax_spider.rb', line 54

def option_number_of_browsers
  @client.get('/JSON/ajaxSpider/view/optionNumberOfBrowsers/')
end

#option_random_inputsObject



58
59
60
# File 'lib/zap/v2apis/ajax_spider.rb', line 58

def option_random_inputs
  @client.get('/JSON/ajaxSpider/view/optionRandomInputs/')
end

#option_reload_waitObject



62
63
64
# File 'lib/zap/v2apis/ajax_spider.rb', line 62

def option_reload_wait
  @client.get('/JSON/ajaxSpider/view/optionReloadWait/')
end

#remove_allowed_resource(regex) ⇒ Object



89
90
91
# File 'lib/zap/v2apis/ajax_spider.rb', line 89

def remove_allowed_resource(regex)
  @client.get("/JSON/ajaxSpider/action/removeAllowedResource/?regex=#{regex}")
end

#remove_excluded_element(contextname, description) ⇒ Object



93
94
95
# File 'lib/zap/v2apis/ajax_spider.rb', line 93

def remove_excluded_element(contextname, description)
  @client.get("/JSON/ajaxSpider/action/removeExcludedElement/?contextName=#{contextname}&description=#{description}")
end

#results(start, count) ⇒ Object



66
67
68
# File 'lib/zap/v2apis/ajax_spider.rb', line 66

def results(start, count)
  @client.get("/JSON/ajaxSpider/view/results/?start=#{start}&count=#{count}")
end

#scan(url, inscope = '', contextname = '', subtreeonly = '') ⇒ Object



97
98
99
# File 'lib/zap/v2apis/ajax_spider.rb', line 97

def scan(url, inscope = '', contextname = '', subtreeonly = '')
  @client.get("/JSON/ajaxSpider/action/scan/?url=#{url}&inScope=#{inscope}&contextName=#{contextname}&subtreeOnly=#{subtreeonly}")
end

#scan_as_user(contextname, username, url, subtreeonly = '') ⇒ Object



101
102
103
# File 'lib/zap/v2apis/ajax_spider.rb', line 101

def scan_as_user(contextname, username, url, subtreeonly = '')
  @client.get("/JSON/ajaxSpider/action/scanAsUser/?contextName=#{contextname}&userName=#{username}&url=#{url}&subtreeOnly=#{subtreeonly}")
end

#set_enabled_allowed_resource(regex, enabled = '') ⇒ Object



105
106
107
# File 'lib/zap/v2apis/ajax_spider.rb', line 105

def set_enabled_allowed_resource(regex, enabled = '')
  @client.get("/JSON/ajaxSpider/action/setEnabledAllowedResource/?regex=#{regex}&enabled=#{enabled}")
end

#set_option_browser_id(string) ⇒ Object



109
110
111
# File 'lib/zap/v2apis/ajax_spider.rb', line 109

def set_option_browser_id(string)
  @client.get("/JSON/ajaxSpider/action/setOptionBrowserId/?String=#{string}")
end

#set_option_click_default_elems(boolean) ⇒ Object



113
114
115
# File 'lib/zap/v2apis/ajax_spider.rb', line 113

def set_option_click_default_elems(boolean)
  @client.get("/JSON/ajaxSpider/action/setOptionClickDefaultElems/?Boolean=#{boolean}")
end

#set_option_click_elems_once(boolean) ⇒ Object



117
118
119
# File 'lib/zap/v2apis/ajax_spider.rb', line 117

def set_option_click_elems_once(boolean)
  @client.get("/JSON/ajaxSpider/action/setOptionClickElemsOnce/?Boolean=#{boolean}")
end

#set_option_event_wait(integer) ⇒ Object



121
122
123
# File 'lib/zap/v2apis/ajax_spider.rb', line 121

def set_option_event_wait(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionEventWait/?Integer=#{integer}")
end

#set_option_max_crawl_depth(integer) ⇒ Object



125
126
127
# File 'lib/zap/v2apis/ajax_spider.rb', line 125

def set_option_max_crawl_depth(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionMaxCrawlDepth/?Integer=#{integer}")
end

#set_option_max_crawl_states(integer) ⇒ Object



129
130
131
# File 'lib/zap/v2apis/ajax_spider.rb', line 129

def set_option_max_crawl_states(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionMaxCrawlStates/?Integer=#{integer}")
end

#set_option_max_duration(integer) ⇒ Object



133
134
135
# File 'lib/zap/v2apis/ajax_spider.rb', line 133

def set_option_max_duration(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionMaxDuration/?Integer=#{integer}")
end

#set_option_number_of_browsers(integer) ⇒ Object



137
138
139
# File 'lib/zap/v2apis/ajax_spider.rb', line 137

def set_option_number_of_browsers(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionNumberOfBrowsers/?Integer=#{integer}")
end

#set_option_random_inputs(boolean) ⇒ Object



141
142
143
# File 'lib/zap/v2apis/ajax_spider.rb', line 141

def set_option_random_inputs(boolean)
  @client.get("/JSON/ajaxSpider/action/setOptionRandomInputs/?Boolean=#{boolean}")
end

#set_option_reload_wait(integer) ⇒ Object



145
146
147
# File 'lib/zap/v2apis/ajax_spider.rb', line 145

def set_option_reload_wait(integer)
  @client.get("/JSON/ajaxSpider/action/setOptionReloadWait/?Integer=#{integer}")
end

#statusObject



70
71
72
# File 'lib/zap/v2apis/ajax_spider.rb', line 70

def status
  @client.get('/JSON/ajaxSpider/view/status/')
end

#stopObject



149
150
151
# File 'lib/zap/v2apis/ajax_spider.rb', line 149

def stop
  @client.get('/JSON/ajaxSpider/action/stop/')
end