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.



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

Returns the value of attribute auth_source.



187
188
189
# File 'lib/nexpose/user.rb', line 187

def auth_source
  @auth_source
end

#externalObject (readonly)

Returns the value of attribute external.



187
188
189
# File 'lib/nexpose/user.rb', line 187

def external
  @external
end

#idObject (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