Class: Nexpose::SharedCredentialSummary
- Inherits:
-
Credential
- Object
- APIObject
- Credential
- Nexpose::SharedCredentialSummary
- Defined in:
- lib/nexpose/shared_credential.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Credential
Instance Attribute Summary collapse
-
#all_sites ⇒ Object
Boolean to indicate whether this credential applies to all sites.
-
#domain ⇒ Object
Domain or realm.
-
#id ⇒ Object
Unique ID assigned to this credential by Nexpose.
-
#last_modified ⇒ Object
When this credential was last modified.
-
#name ⇒ Object
Name to identify this credential.
-
#privilege_username ⇒ Object
(also: #permission_elevation_user)
User name to use when elevating permissions (e.g., sudo).
-
#service ⇒ Object
(also: #type)
The credential service/type.
-
#username ⇒ Object
(also: #user_name)
User name.
Class Method Summary collapse
Instance Method Summary collapse
-
#delete(nsc) ⇒ Object
Delete this credential from the security console.
Methods included from CredentialHelper
#set_as400_service, #set_cifs_service, #set_cifshash_service, #set_cvs_service, #set_db2_service, #set_ftp_service, #set_http_service, #set_mysql_service, #set_notes_service, #set_oracle_service, #set_pop_service, #set_postgresql_service, #set_remote_execution_service, #set_snmp_service, #set_snmpv3_service, #set_ssh_key_service, #set_ssh_service, #set_sybase_service, #set_tds_service, #set_telnet_service
Methods inherited from APIObject
Instance Attribute Details
#all_sites ⇒ Object
Boolean to indicate whether this credential applies to all sites.
45 46 47 |
# File 'lib/nexpose/shared_credential.rb', line 45 def all_sites @all_sites end |
#domain ⇒ Object
Domain or realm.
35 36 37 |
# File 'lib/nexpose/shared_credential.rb', line 35 def domain @domain end |
#id ⇒ Object
Unique ID assigned to this credential by Nexpose.
27 28 29 |
# File 'lib/nexpose/shared_credential.rb', line 27 def id @id end |
#last_modified ⇒ Object
When this credential was last modified.
47 48 49 |
# File 'lib/nexpose/shared_credential.rb', line 47 def last_modified @last_modified end |
#name ⇒ Object
Name to identify this credential.
29 30 31 |
# File 'lib/nexpose/shared_credential.rb', line 29 def name @name end |
#privilege_username ⇒ Object Also known as: permission_elevation_user
User name to use when elevating permissions (e.g., sudo).
41 42 43 |
# File 'lib/nexpose/shared_credential.rb', line 41 def privilege_username @privilege_username end |
#service ⇒ Object Also known as: type
The credential service/type. See Nexpose::Credential::Service.
31 32 33 |
# File 'lib/nexpose/shared_credential.rb', line 31 def service @service end |
#username ⇒ Object Also known as: user_name
User name.
37 38 39 |
# File 'lib/nexpose/shared_credential.rb', line 37 def username @username end |
Class Method Details
.from_json(json) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/nexpose/shared_credential.rb', line 49 def self.from_json(json) cred = new cred.id = json['credentialID']['ID'] cred.name = json['name'] cred.type = json['service'] cred.domain = json['domain'] cred.username = json['username'] cred.privilege_username = json['privilegeElevationUsername'] cred.all_sites = json['scope'] == 'ALL_SITES_ENABLED_DEFAULT' cred.last_modified = Time.at(json['lastModified']['time'] / 1000) cred end |
Instance Method Details
#delete(nsc) ⇒ Object
Delete this credential from the security console.
66 67 68 |
# File 'lib/nexpose/shared_credential.rb', line 66 def delete(nsc) nsc.delete_shared_credential(@id) end |