Class: Ronin::Credential
- Inherits:
-
Object
- Object
- Ronin::Credential
- Includes:
- Model
- Defined in:
- lib/ronin/credential.rb
Overview
Represents Credentials used to access services or websites.
Direct Known Subclasses
Class Method Summary collapse
-
.for_user(name) ⇒ Array<Credential>
Searches for all credentials for a specific user.
-
.with_password(password) ⇒ Array<Credential>
Searches for all credentials with a common password.
Instance Method Summary collapse
-
#clear_text ⇒ String
The clear-text password of the credential.
-
#to_ary ⇒ Array<String>
Splits the credential to multiple variables.
-
#to_s ⇒ String
Converts the credentials to a String.
-
#user ⇒ String
The user the credential belongs to.
Methods included from Model
Class Method Details
.for_user(name) ⇒ Array<Credential>
Searches for all credentials for a specific user.
54 55 56 |
# File 'lib/ronin/credential.rb', line 54 def self.for_user(name) all('user_name.name' => name) end |
.with_password(password) ⇒ Array<Credential>
Searches for all credentials with a common password.
71 72 73 |
# File 'lib/ronin/credential.rb', line 71 def self.with_password(password) all('password.clear_text' => password) end |
Instance Method Details
#clear_text ⇒ String
The clear-text password of the credential.
99 100 101 |
# File 'lib/ronin/credential.rb', line 99 def clear_text self.password.clear_text if self.password end |
#to_ary ⇒ Array<String>
Splits the credential to multiple variables.
135 136 137 |
# File 'lib/ronin/credential.rb', line 135 def to_ary [self.user_name.name, self.password.clear_text] end |
#to_s ⇒ String
Converts the credentials to a String.
113 114 115 |
# File 'lib/ronin/credential.rb', line 113 def to_s "#{self.user_name}:#{self.password}" end |
#user ⇒ String
The user the credential belongs to.
85 86 87 |
# File 'lib/ronin/credential.rb', line 85 def user self.user_name.name if self.user_name end |