Skip to content

Commit

Permalink
fix: correct access to moss and devise secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Sep 13, 2024
1 parent 9b009a5 commit 8fae9c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/similarity/unit_similarity_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def check_moss_similarity(force: false)
logger.debug 'Contacting MOSS for new checks'

# Create the MossRuby object
moss_key = Doubtfire::Application.secrets.secret_key_moss
moss_key = Doubtfire::Application.credentials.secret_key_moss
raise "No moss key set. Check ENV['DF_SECRET_KEY_MOSS'] first." if moss_key.nil?

moss = MossRuby.new(moss_key)
Expand Down Expand Up @@ -99,7 +99,7 @@ def check_moss_similarity(force: false)
end

def update_plagiarism_stats
moss_key = Doubtfire::Application.secrets.secret_key_moss
moss_key = Doubtfire::Application.credentials.secret_key_moss
raise "No moss key set. Check ENV['DF_SECRET_KEY_MOSS'] first." if moss_key.nil?

moss = MossRuby.new(moss_key)
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
# ==> AAF via JWT OmniAuth
# Devise method for JWT
# if Doubtfire::Application.config.auth_method == :jwt
# aaf_secret = Doubtfire::Application.secrets.secret_key_aaf
# aaf_secret = Doubtfire::Application.credentials.secret_key_aaf
# aaf_config = Doubtfire::Application.config.aaf
# config.omniauth :jwt,
# aaf_secret,
Expand All @@ -268,7 +268,7 @@

# ==> Devise secret key
# Secret key to be used by devise in prod.
config.secret_key = Doubtfire::Application.secrets.secret_key_devise if Rails.env.production?
config.secret_key = Doubtfire::Application.credentials.secret_key_devise if Rails.env.production?

config.ldap_use_admin_to_bind = ENV.fetch('DF_LDAP_USE_ADMIN_TO_BIND', 'false').to_s.downcase != 'false'

Expand Down

0 comments on commit 8fae9c6

Please sign in to comment.