class Nexpose::WebCredentials::Headers
Object that represents Headers
, associated with Web Session Authentication.
Attributes
baseURL[R]
Base URL of the application for which the form authentication applies.
enabled[RW]
is this enable for the site configuration
headers[R]
When using HTTP headers, this represents the set of headers to pass with the authentication request.
id[R]
id of the header
name[R]
name of the html header
service[R]
service type of header
soft403Pattern[R]
A regular expression used to match against the response to identify authentication failures.
Public Class Methods
new(name, baseURL, soft403Pattern, id = -1, enabled = true)
click to toggle source
# File lib/nexpose/web_credentials.rb, line 55 def initialize(name, baseURL, soft403Pattern, id = -1, enabled = true) @headers = {} @name = name @baseURL = baseURL @soft403Pattern = soft403Pattern @service = WebAppAuthType::HTTP_HEADER @enabled = enabled @id = id end
Public Instance Methods
==(other)
click to toggle source
# File lib/nexpose/web_credentials.rb, line 83 def ==(other) eql?(other) end
add_header(header)
click to toggle source
# File lib/nexpose/web_credentials.rb, line 65 def add_header(header) @headers = @headers.merge(header.to_h) end
eql?(other)
click to toggle source
# File lib/nexpose/web_credentials.rb, line 87 def eql?(other) id.eql?(other.id) && service.eql?(other.service) && enabled.eql?(other.enabled) && name.eql?(other.name) && headers.eql?(other.headers) && baseURL.eql?(other.baseURL) && soft403Pattern.eql?(other.soft403Pattern) end
to_h()
click to toggle source
# File lib/nexpose/web_credentials.rb, line 73 def to_h { id: id, service: service, enabled: enabled, name: name, headers: headers, baseURL: baseURL, soft403Pattern: soft403Pattern } end
to_json()
click to toggle source
# File lib/nexpose/web_credentials.rb, line 69 def to_json JSON.generate(to_h) end