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.
57 58 59 60 61 62 63 64 65 |
# File 'lib/nexpose/web_credentials.rb', line 57 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.
44 45 46 |
# File 'lib/nexpose/web_credentials.rb', line 44 def baseURL @baseURL end |
#enabled ⇒ Object
is this enable for the site configuration
50 51 52 |
# File 'lib/nexpose/web_credentials.rb', line 50 def enabled @enabled end |
#headers ⇒ Object (readonly)
When using HTTP headers, this represents the set of headers to pass with the authentication request.
46 47 48 |
# File 'lib/nexpose/web_credentials.rb', line 46 def headers @headers end |
#id ⇒ Object (readonly)
id of the header
54 55 56 |
# File 'lib/nexpose/web_credentials.rb', line 54 def id @id end |
#name ⇒ Object (readonly)
name of the html header
48 49 50 |
# File 'lib/nexpose/web_credentials.rb', line 48 def name @name end |
#service ⇒ Object (readonly)
service type of header
52 53 54 |
# File 'lib/nexpose/web_credentials.rb', line 52 def service @service end |
#soft403Pattern ⇒ Object (readonly)
A regular expression used to match against the response to identify authentication failures.
42 43 44 |
# File 'lib/nexpose/web_credentials.rb', line 42 def soft403Pattern @soft403Pattern end |
Instance Method Details
#==(other) ⇒ Object
86 87 88 |
# File 'lib/nexpose/web_credentials.rb', line 86 def ==(other) eql?(other) end |
#add_header(header) ⇒ Object
67 68 69 |
# File 'lib/nexpose/web_credentials.rb', line 67 def add_header(header) @headers = @headers.merge(header.to_h) end |
#eql?(other) ⇒ Boolean
90 91 92 93 94 95 96 97 98 |
# File 'lib/nexpose/web_credentials.rb', line 90 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
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/nexpose/web_credentials.rb', line 75 def to_h { id: id, service: service, enabled: enabled, name: name, headers: headers, baseURL: baseURL, soft403Pattern: soft403Pattern } end |
#to_json ⇒ Object
71 72 73 |
# File 'lib/nexpose/web_credentials.rb', line 71 def to_json JSON.generate(to_h) end |