Skip to content

Commit

Permalink
Load IdentitySettings secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyanderson committed Mar 6, 2025
1 parent 997df8d commit 7dbb611
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions config/initializers/identity_config.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# frozen_string_literal: true

identity_settings_files = Config.setting_files(Rails.root.join('config', 'identity_settings'), Settings.vsp_environment)
ENV_PREFIX = 'IDENTITY_SETTINGS'
ENV_SEPARATOR = '__'
SETTINGS_FOLDER = Rails.root.join('config', 'identity_settings')

IdentitySettings = Config.load_files(identity_settings_files)
IdentitySettings = Config::Options.new

Config.setting_files(SETTINGS_FOLDER, Settings.vsp_environment).each do |file|
IdentitySettings.add_source!(file)
end

secrets_source = Config::Sources::EnvSource.new(ENV, prefix: ENV_PREFIX, separator: ENV_SEPARATOR)
IdentitySettings.add_source!(secrets_source)

IdentitySettings.reload!

0 comments on commit 7dbb611

Please sign in to comment.