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
- #as_xml ⇒ Object (also: #to_xml_elem)
-
#initialize(parentpage, soft403, webapproot) ⇒ HTMLForms
constructor
A new instance of HTMLForms.
Methods included from XMLUtils
Constructor Details
#initialize(parentpage, soft403, webapproot) ⇒ HTMLForms
Returns a new instance of HTMLForms.
362 363 364 365 366 367 |
# File 'lib/nexpose/creds.rb', line 362 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
360 361 362 |
# File 'lib/nexpose/creds.rb', line 360 def html_forms @html_forms end |
#parentpage ⇒ Object (readonly)
The URL of the login page containing the login form.
353 354 355 |
# File 'lib/nexpose/creds.rb', line 353 def parentpage @parentpage end |
#soft403 ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
356 357 358 |
# File 'lib/nexpose/creds.rb', line 356 def soft403 @soft403 end |
#webapproot ⇒ Object (readonly)
Base URL of the application for which the form authentication applies.
358 359 360 |
# File 'lib/nexpose/creds.rb', line 358 def webapproot @webapproot end |
Instance Method Details
#add_html_form(html_form) ⇒ Object
369 370 371 |
# File 'lib/nexpose/creds.rb', line 369 def add_html_form(html_form) @html_forms << html_form end |
#as_xml ⇒ Object Also known as: to_xml_elem
373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/nexpose/creds.rb', line 373 def as_xml 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 |