Module: Brightbox::Config::PasswordHelper
- Included in:
- BBConfig
- Defined in:
- lib/brightbox-cli/config/password_helper.rb
Constant Summary collapse
- ENTER_PASSWORD_PROMPT =
"Enter your password : ".freeze
- EXPIRED_TOKEN_PROMPT =
"Your API credentials have expired, enter your password to update them.".freeze
Instance Attribute Summary collapse
-
#password_helper_password ⇒ Object
writeonly
Sets the attribute password_helper_password.
Instance Method Summary collapse
-
#discover_password(password: nil, expired: false) ⇒ String
#discover_password will return the first password that can be recovered from either the passed input, encrypted storage, a helper application (if configured) or finally promping.
Instance Attribute Details
#password_helper_password=(value) ⇒ Object
Sets the attribute password_helper_password
7 8 9 |
# File 'lib/brightbox-cli/config/password_helper.rb', line 7 def password_helper_password=(value) @password_helper_password = value end |
Instance Method Details
#discover_password(password: nil, expired: false) ⇒ String
#discover_password will return the first password that can be recovered from either the passed input, encrypted storage, a helper application (if configured) or finally promping.
17 18 19 20 21 |
# File 'lib/brightbox-cli/config/password_helper.rb', line 17 def discover_password(password: nil, expired: false) password ||= gpg_password password ||= password_helper_password password ||= prompt_for_password(expired) end |