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.



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

Returns the value of attribute auth_source.



190
191
192
# File 'lib/nexpose/user.rb', line 190

def auth_source
  @auth_source
end

#externalObject (readonly)

Returns the value of attribute external.



190
191
192
# File 'lib/nexpose/user.rb', line 190

def external
  @external
end

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