Class: Nexpose::WebCredentials::Headers
- Defined in:
- lib/nexpose/web_credentials.rb
Overview
Object that represents Headers, associated with Web Session Authentication.
Instance Attribute Summary collapse
-
#baseURL ⇒ Object
readonly
Base URL of the application for which the form authentication applies.
-
#enabled ⇒ Object
is this enable for the site configuration.
-
#headers ⇒ Object
readonly
When using HTTP headers, this represents the set of headers to pass with the authentication request.
-
#id ⇒ Object
readonly
id of the header.
-
#name ⇒ Object
readonly
name of the html header.
-
#service ⇒ Object
readonly
service type of header.
-
#soft403Pattern ⇒ Object
readonly
A regular expression used to match against the response to identify authentication failures.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #add_header(header) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(name, baseURL, soft403Pattern, id = -1,, enabled = true) ⇒ Headers
constructor
A new instance of Headers.
- #to_h ⇒ Object
- #to_json ⇒ Object
Methods inherited from APIObject
Constructor Details
#initialize(name, baseURL, soft403Pattern, id = -1,, enabled = true) ⇒ Headers
Returns a new instance of Headers.
55 56 57 58 59 60 61 62 63 |
# 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 |
Instance Attribute Details
#baseURL ⇒ Object (readonly)
Base URL of the application for which the form authentication applies.
43 44 45 |
# File 'lib/nexpose/web_credentials.rb', line 43 def baseURL @baseURL end |
#enabled ⇒ Object
is this enable for the site configuration
49 50 51 |
# File 'lib/nexpose/web_credentials.rb', line 49 def enabled @enabled end |
#headers ⇒ Object (readonly)
When using HTTP headers, this represents the set of headers to pass with the authentication request.
45 46 47 |
# File 'lib/nexpose/web_credentials.rb', line 45 def headers @headers end |
#id ⇒ Object (readonly)
id of the header
53 54 55 |
# File 'lib/nexpose/web_credentials.rb', line 53 def id @id end |
#name ⇒ Object (readonly)
name of the html header
47 48 49 |
# File 'lib/nexpose/web_credentials.rb', line 47 def name @name end |
#service ⇒ Object (readonly)
service type of header
51 52 53 |
# File 'lib/nexpose/web_credentials.rb', line 51 def service @service end |
#soft403Pattern ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
41 42 43 |
# File 'lib/nexpose/web_credentials.rb', line 41 def soft403Pattern @soft403Pattern end |
Instance Method Details
#==(other) ⇒ Object
83 84 85 |
# File 'lib/nexpose/web_credentials.rb', line 83 def ==(other) eql?(other) end |
#add_header(header) ⇒ Object
65 66 67 |
# File 'lib/nexpose/web_credentials.rb', line 65 def add_header(header) @headers = @headers.merge(header.to_h) end |
#eql?(other) ⇒ Boolean
87 88 89 90 91 92 93 94 95 |
# 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 ⇒ Object
73 74 75 76 77 78 79 80 81 |
# 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 ⇒ Object
69 70 71 |
# File 'lib/nexpose/web_credentials.rb', line 69 def to_json JSON.generate(to_h) end |