Class: Nexpose::UserAuthenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, auth_module, auth_source, external = false) ⇒ UserAuthenticator

Returns a new instance of UserAuthenticator.



202
203
204
205
206
207
# File 'lib/nexpose/user.rb', line 202

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_moduleObject (readonly)

Returns the value of attribute auth_module.



200
201
202
# File 'lib/nexpose/user.rb', line 200

def auth_module
  @auth_module
end

#auth_sourceObject (readonly)

Returns the value of attribute auth_source.



200
201
202
# File 'lib/nexpose/user.rb', line 200

def auth_source
  @auth_source
end

#externalObject (readonly)

Returns the value of attribute external.



200
201
202
# File 'lib/nexpose/user.rb', line 200

def external
  @external
end

#idObject (readonly)

Returns the value of attribute id.



200
201
202
# File 'lib/nexpose/user.rb', line 200

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.



211
212
213
214
215
216
217
218
219
220
# File 'lib/nexpose/user.rb', line 211

def self.list(connection)
  r = connection.execute('<UserAuthenticatorListingRequest session-id="' + connection.session_id + '" />', '1.1')
  if r.success
    modules = []
    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
    modules
  end
end