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.
189 190 191 192 193 194 |
# File 'lib/nexpose/user.rb', line 189 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.
187 188 189 |
# File 'lib/nexpose/user.rb', line 187 def auth_module @auth_module end |
#auth_source ⇒ Object (readonly)
Returns the value of attribute auth_source.
187 188 189 |
# File 'lib/nexpose/user.rb', line 187 def auth_source @auth_source end |
#external ⇒ Object (readonly)
Returns the value of attribute external.
187 188 189 |
# File 'lib/nexpose/user.rb', line 187 def external @external end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
187 188 189 |
# File 'lib/nexpose/user.rb', line 187 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.
198 199 200 201 202 203 204 205 206 207 |
# File 'lib/nexpose/user.rb', line 198 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 |