Class: Nexpose::Headers
- Inherits:
-
Object
- Object
- Nexpose::Headers
- Includes:
- XMLUtils
- Defined in:
- lib/nexpose/creds.rb
Overview
Object that represents Headers, associated with Web Session Authentication.
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
When using httpheaders, this represents the set of headers to pass with the authentication request.
-
#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_header(header) ⇒ Object
-
#initialize(webapproot, soft403) ⇒ Headers
constructor
A new instance of Headers.
- #to_xml_elem ⇒ Object
Methods included from XMLUtils
Constructor Details
#initialize(webapproot, soft403) ⇒ Headers
Returns a new instance of Headers.
196 197 198 199 200 |
# File 'lib/nexpose/creds.rb', line 196 def initialize(webapproot, soft403) @headers = [] @webapproot = webapproot @soft403 = soft403 end |
Instance Attribute Details
#headers ⇒ Object (readonly)
When using httpheaders, this represents the set of headers to pass with the authentication request.
194 195 196 |
# File 'lib/nexpose/creds.rb', line 194 def headers @headers end |
#soft403 ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
190 191 192 |
# File 'lib/nexpose/creds.rb', line 190 def soft403 @soft403 end |
#webapproot ⇒ Object (readonly)
Base URL of the application for which the form authentication applies.
192 193 194 |
# File 'lib/nexpose/creds.rb', line 192 def webapproot @webapproot end |
Instance Method Details
#add_header(header) ⇒ Object
202 203 204 |
# File 'lib/nexpose/creds.rb', line 202 def add_header(header) @headers.push(header) end |
#to_xml_elem ⇒ Object
206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/nexpose/creds.rb', line 206 def to_xml_elem attributes = {} attributes['webapproot'] = @webapproot attributes['soft403'] = @soft403 xml = make_xml('Headers', attributes) @headers.each do |header| xml.add_element(header.to_xml_elem) end xml end |