Class: Nexpose::AdminCredentials
- Inherits:
-
Object
- Object
- Nexpose::AdminCredentials
- Includes:
- Sanitize
- Defined in:
- lib/nexpose.rb
Overview
Description
Object that represents administrative credentials to be used during a scan. When retrived from an existing site configuration the credentials will be returned as a security blob and can only be passed back as is during a Site Save operation. This object can only be used to create a new set of credentials.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
The host for these credentials.
-
#isblob ⇒ Object
readonly
Designates if this object contains user defined credentials or a security blob.
-
#password ⇒ Object
readonly
The password.
-
#port ⇒ Object
readonly
The port on which to use these credentials.
-
#realm ⇒ Object
readonly
The realm for these credentials.
-
#securityblob ⇒ Object
readonly
Security blob for an existing set of credentials.
-
#service ⇒ Object
readonly
The service for these credentials.
-
#userid ⇒ Object
readonly
The user id or username.
Instance Method Summary collapse
-
#initialize(isblob = false) ⇒ AdminCredentials
constructor
A new instance of AdminCredentials.
-
#setBlob(securityblob) ⇒ Object
TODO: add description.
-
#setCredentials(service, host, port, userid, password, realm) ⇒ Object
Sets the credentials information for this object.
- #setHost(host) ⇒ Object
-
#setService(service) ⇒ Object
TODO: add description.
- #to_xml ⇒ Object
Methods included from Sanitize
Constructor Details
#initialize(isblob = false) ⇒ AdminCredentials
Returns a new instance of AdminCredentials.
1247 1248 1249 |
# File 'lib/nexpose.rb', line 1247 def initialize(isblob = false) @isblob = isblob end |
Instance Attribute Details
#host ⇒ Object (readonly)
The host for these credentials. Can be Any.
1236 1237 1238 |
# File 'lib/nexpose.rb', line 1236 def host @host end |
#isblob ⇒ Object (readonly)
Designates if this object contains user defined credentials or a security blob
1232 1233 1234 |
# File 'lib/nexpose.rb', line 1232 def isblob @isblob end |
#password ⇒ Object (readonly)
The password
1242 1243 1244 |
# File 'lib/nexpose.rb', line 1242 def password @password end |
#port ⇒ Object (readonly)
The port on which to use these credentials.
1238 1239 1240 |
# File 'lib/nexpose.rb', line 1238 def port @port end |
#realm ⇒ Object (readonly)
The realm for these credentials
1244 1245 1246 |
# File 'lib/nexpose.rb', line 1244 def realm @realm end |
#securityblob ⇒ Object (readonly)
Security blob for an existing set of credentials
1230 1231 1232 |
# File 'lib/nexpose.rb', line 1230 def securityblob @securityblob end |
#service ⇒ Object (readonly)
The service for these credentials. Can be All.
1234 1235 1236 |
# File 'lib/nexpose.rb', line 1234 def service @service end |
#userid ⇒ Object (readonly)
The user id or username
1240 1241 1242 |
# File 'lib/nexpose.rb', line 1240 def userid @userid end |
Instance Method Details
#setBlob(securityblob) ⇒ Object
TODO: add description
1273 1274 1275 1276 |
# File 'lib/nexpose.rb', line 1273 def setBlob(securityblob) @isblob = true @securityblob = securityblob end |
#setCredentials(service, host, port, userid, password, realm) ⇒ Object
Sets the credentials information for this object.
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 |
# File 'lib/nexpose.rb', line 1252 def setCredentials(service, host, port, userid, password, realm) @isblob = false @securityblob = nil @service = service @host = host @port = port @userid = userid @password = password @realm = realm end |
#setHost(host) ⇒ Object
1268 1269 1270 |
# File 'lib/nexpose.rb', line 1268 def setHost(host) @host = host end |
#setService(service) ⇒ Object
TODO: add description
1264 1265 1266 |
# File 'lib/nexpose.rb', line 1264 def setService(service) @service = service end |
#to_xml ⇒ Object
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 |
# File 'lib/nexpose.rb', line 1279 def to_xml xml = '' xml << '<adminCredentials' xml << %Q{ service="#{replace_entities(service)}"} if (service) xml << %Q{ userid="#{replace_entities(userid)}"} if (userid) xml << %Q{ password="#{replace_entities(password)}"} if (password) xml << %Q{ realm="#{replace_entities(realm)}"} if (realm) xml << %Q{ host="#{replace_entities(host)}"} if (host) xml << %Q{ port="#{replace_entities(port)}"} if (port) xml << '>' xml << replace_entities(securityblob) if (isblob) xml << '</adminCredentials>' xml end |