Class: Gitlab::Email::SmtpConfig
- Inherits:
-
Object
- Object
- Gitlab::Email::SmtpConfig
- Defined in:
- lib/gitlab/email/smtp_config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ SmtpConfig
constructor
A new instance of SmtpConfig.
- #password ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize ⇒ SmtpConfig
Returns a new instance of SmtpConfig.
14 15 16 17 18 |
# File 'lib/gitlab/email/smtp_config.rb', line 14 def initialize @secrets ||= self.class.encrypted_secrets.config rescue StandardError => e Gitlab::AppLogger.error "SMTP encrypted secrets are invalid: #{e.inspect}" end |
Class Method Details
.encrypted_secrets ⇒ Object
6 7 8 |
# File 'lib/gitlab/email/smtp_config.rb', line 6 def self.encrypted_secrets Settings.encrypted(Gitlab.config.gitlab.email_smtp_secret_file) end |
.secrets ⇒ Object
10 11 12 |
# File 'lib/gitlab/email/smtp_config.rb', line 10 def self.secrets self.new end |
Instance Method Details
#password ⇒ Object
24 25 26 |
# File 'lib/gitlab/email/smtp_config.rb', line 24 def password @secrets&.fetch(:password, nil)&.chomp end |
#username ⇒ Object
20 21 22 |
# File 'lib/gitlab/email/smtp_config.rb', line 20 def username @secrets&.fetch(:user_name, nil)&.chomp end |