Class: Nexpose::HTMLForms
- Inherits:
-
Object
- Object
- Nexpose::HTMLForms
- Includes:
- XMLUtils
- Defined in:
- lib/nexpose/creds.rb
Overview
When using htmlform, this represents the login form information.
Instance Attribute Summary collapse
-
#html_forms ⇒ Object
readonly
The forms to authenticate with.
-
#parentpage ⇒ Object
readonly
The URL of the login page containing the login form.
-
#soft403 ⇒ Object
readonly
A regular expression used to match against the response to identify authentication failures.
-
#webapproot ⇒ Object
readonly
Base URL of the application for which the form authentication applies.
Instance Method Summary collapse
- #add_html_form(html_form) ⇒ Object
-
#initialize(parentpage, soft403, webapproot) ⇒ HTMLForms
constructor
A new instance of HTMLForms.
- #to_xml_elem ⇒ Object
Methods included from XMLUtils
Constructor Details
#initialize(parentpage, soft403, webapproot) ⇒ HTMLForms
Returns a new instance of HTMLForms.
261 262 263 264 265 266 |
# File 'lib/nexpose/creds.rb', line 261 def initialize(parentpage, soft403, webapproot) @parentpage = parentpage @soft403 = soft403 @webapproot = webapproot @html_forms = [] end |
Instance Attribute Details
#html_forms ⇒ Object (readonly)
The forms to authenticate with
259 260 261 |
# File 'lib/nexpose/creds.rb', line 259 def html_forms @html_forms end |
#parentpage ⇒ Object (readonly)
The URL of the login page containing the login form.
252 253 254 |
# File 'lib/nexpose/creds.rb', line 252 def parentpage @parentpage end |
#soft403 ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
255 256 257 |
# File 'lib/nexpose/creds.rb', line 255 def soft403 @soft403 end |
#webapproot ⇒ Object (readonly)
Base URL of the application for which the form authentication applies.
257 258 259 |
# File 'lib/nexpose/creds.rb', line 257 def webapproot @webapproot end |
Instance Method Details
#add_html_form(html_form) ⇒ Object
268 269 270 |
# File 'lib/nexpose/creds.rb', line 268 def add_html_form(html_form) @html_forms << html_form end |
#to_xml_elem ⇒ Object
272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/nexpose/creds.rb', line 272 def to_xml_elem attributes = {} attributes['parentpage'] = @parentpage attributes['soft403'] = @soft403 attributes['webapproot'] = @webapproot xml = make_xml('HTMLForms', attributes) html_forms.each() do |html_form| xml.add_element(html_form.to_xml_elem) end xml end |