Skip to content

Commit 879ac27

Browse files
committed
Encrypted credentials
1 parent 4ef2619 commit 879ac27

8 files changed

Lines changed: 9 additions & 6 deletions

File tree

evaluationserver/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ coverage
3333
# Ignore encrypted secrets key file.
3434
config/secrets.yml.key
3535
config/initializers/01_env.rb
36+
37+
# Ignore master key for decrypting credentials and more.
38+
/config/master.key

evaluationserver/app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base
77

88
CREDENTIALS = {
99
:name => 'admin',
10-
:password => ENV['ADMIN_PASSWORD']
10+
:password => Rails.application.credentials.admin_password
1111

1212
}
1313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FTUFXD2ZlOTrgBhIsiyWNSI0+jynWKt2HgZ/QOcoU8CDvwBpTMUnuInLJhT4zWeGkAjoAQDBCdSVm2UN9bMDNXNx1pUh2MEjNiMPrLR4khCwyjBeEQU4HLWsMTwEygq4ityywwyxoFvivq1mMoOXI7nNJlj7fSPTBunZWFxIa8XnO6DdD88KlpYEsWztZ29MiX4VnAz4SQSYQ/Dn7zvQnLa2iXO3LdI+cjfKnn/SD6Vy+RHHSXsX5EiyTjnXY8iPAvgh5Ka4h7WooL/VYfSks3BEHogNqApiS0kEFc1a4KpMvCaw1RrZf5acE5cXNat6fsg0igWh4L4v178/yTHPkuRbqxxCIonEZubSO1nZU3wvbvfwkTtw+y7Ye6ajTEc7QmUQKtwn81qxHcbw5rWnWEpO0i3SG5Xab4JxvHSAoWPEmLiQ+eqQcQY=--h4+AiwgXsnjapqn1--NWJpV3kvUw/PH3HfNdipXw==

evaluationserver/config/initializers/example_credential.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

evaluationserver/config/initializers/secret_token.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
# Make sure your secret_key_base is kept private
1111
# if you're sharing your code publicly.
12-
EvalServer::Application.config.secret_key_base = '715eb86cac15abfacc1dc995e7cb88f562e0b8030608347d03d750bcefded2b6ad1e1b59076c53e7955452f2b7be6ceb84b9c5c6b579200459d88f4bb3784333'
12+
EvalServer::Application.config.secret_key_base = Rails.application.credentials.secret_key_base

evaluationserver/config/secrets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ test:
2929
# and move the `production:` environment over there.
3030

3131
production:
32-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
32+
secret_key_base: <%= Rails.application.credentials.secret_key_base %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module BasicAuthHelper
22
def login_as_admin
33
user = 'admin'
4-
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,ENV['ADMIN_PASSWORD'])
4+
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,Rails.application.credentials.admin_password)
55
end
66
end

evaluationserver/spec/support/features/session_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def authenticate_as_admin
44
visit root_path
55
click_link(t('layout.admin_on'))
66
admin_user = "admin"
7-
page.driver.browser.basic_authorize(admin_user,ENV['ADMIN_PASSWORD'])
7+
page.driver.browser.basic_authorize(admin_user,Rails.application.credentials.admin_password)
88
end
99

1010

0 commit comments

Comments
 (0)