Class: Nexpose::Headers
- Inherits:
-
Object
- Object
- Nexpose::Headers
- Includes:
- XMLUtils
- Defined in:
- lib/nexpose/site_credential.rb
Overview
Object that represents Headers, associated with Web Session Authentication.
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
When using HTTP headers, 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
- #as_xml ⇒ Object (also: #to_xml_elem)
-
#initialize(webapproot, soft403) ⇒ Headers
constructor
A new instance of Headers.
Methods included from XMLUtils
#make_xml, #parse_xml, success?
Constructor Details
#initialize(webapproot, soft403) ⇒ Headers
Returns a new instance of Headers.
167 168 169 170 171 |
# File 'lib/nexpose/site_credential.rb', line 167 def initialize(webapproot, soft403) @headers = [] @webapproot = webapproot @soft403 = soft403 end |
Instance Attribute Details
#headers ⇒ Object (readonly)
When using HTTP headers, this represents the set of headers to pass with the authentication request.
165 166 167 |
# File 'lib/nexpose/site_credential.rb', line 165 def headers @headers end |
#soft403 ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
161 162 163 |
# File 'lib/nexpose/site_credential.rb', line 161 def soft403 @soft403 end |
#webapproot ⇒ Object (readonly)
Base URL of the application for which the form authentication applies.
163 164 165 |
# File 'lib/nexpose/site_credential.rb', line 163 def webapproot @webapproot end |
Instance Method Details
#add_header(header) ⇒ Object
173 174 175 |
# File 'lib/nexpose/site_credential.rb', line 173 def add_header(header) @headers.push(header) end |
#as_xml ⇒ Object Also known as: to_xml_elem
177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/nexpose/site_credential.rb', line 177 def as_xml 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 |