Class: Nexpose::UserAuthenticator
- Inherits:
-
Object
- Object
- Nexpose::UserAuthenticator
- Defined in:
- lib/nexpose/user.rb
Instance Attribute Summary collapse
-
#auth_module ⇒ Object
readonly
Returns the value of attribute auth_module.
-
#auth_source ⇒ Object
readonly
Returns the value of attribute auth_source.
-
#external ⇒ Object
readonly
Returns the value of attribute external.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
-
.list(connection) ⇒ Object
Provide a list of user authentication sources.
Instance Method Summary collapse
-
#initialize(id, auth_module, auth_source, external = false) ⇒ UserAuthenticator
constructor
A new instance of UserAuthenticator.
Constructor Details
#initialize(id, auth_module, auth_source, external = false) ⇒ UserAuthenticator
Returns a new instance of UserAuthenticator.
192 193 194 195 196 197 |
# File 'lib/nexpose/user.rb', line 192 def initialize(id, auth_module, auth_source, external = false) @id = id @auth_source = auth_source @auth_module = auth_module @external = external end |
Instance Attribute Details
#auth_module ⇒ Object (readonly)
Returns the value of attribute auth_module.
190 191 192 |
# File 'lib/nexpose/user.rb', line 190 def auth_module @auth_module end |
#auth_source ⇒ Object (readonly)
Returns the value of attribute auth_source.
190 191 192 |
# File 'lib/nexpose/user.rb', line 190 def auth_source @auth_source end |
#external ⇒ Object (readonly)
Returns the value of attribute external.
190 191 192 |
# File 'lib/nexpose/user.rb', line 190 def external @external end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
190 191 192 |
# File 'lib/nexpose/user.rb', line 190 def id @id end |
Class Method Details
.list(connection) ⇒ Object
Provide a list of user authentication sources.
-
Returns : An array of known user authenticator sources.
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/nexpose/user.rb', line 201 def self.list(connection) r = connection.execute('<UserAuthenticatorListingRequest session-id="' + connection.session_id + '" />', '1.1') modules = [] if r.success r.res.elements.each('UserAuthenticatorListingResponse/AuthenticatorSummary') do |summary| modules << UserAuthenticator.new(summary.attributes['id'], summary.attributes['authModule'], summary.attributes['authSource'], ('1'.eql? summary.attributes['external'])) end end modules end |