Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ specs:
- cp -a keys.example keys
- cp -a certs.example certs
- cp pwned_passwords/pwned_passwords.txt.sample pwned_passwords/pwned_passwords.txt
- "echo -e \"test:\n redis_url: 'redis://redis:6379/0'\n redis_throttle_url: 'redis://redis:6379/1'\n redis_irs_attempt_api_url: 'redis://redis:6379/2'\" > config/application.yml"
- "echo -e \"test:\n redis_url: 'redis://redis:6379/0'\n redis_throttle_url: 'redis://redis:6379/1'\" > config/application.yml"
- bundle exec rake db:create db:migrate --trace
- bundle exec rake db:seed
- bundle exec rake knapsack:rspec["--format documentation --format RspecJunitFormatter --out rspec.xml --format json --out rspec_json/${CI_NODE_INDEX}.json"]
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/unused_identity_config_keys.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if IdentityConfig.unused_keys.present?
Rails.logger.warn({ name: 'unused_identity_config_keys', keys: IdentityConfig.unused_keys })
end
3 changes: 2 additions & 1 deletion lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class IdentityConfig
VENDOR_STATUS_OPTIONS = %i[operational partial_outage full_outage]

class << self
attr_reader :store, :key_types
attr_reader :store, :key_types, :unused_keys
end

CONVERTERS = {
Expand Down Expand Up @@ -492,6 +492,7 @@ def self.build_store(config_map)
config.add(:weekly_auth_funnel_report_config, type: :json)

@key_types = config.key_types
@unused_keys = config_map.keys - config.written_env.keys
@store = RedactedStruct.new('IdentityConfig', *config.written_env.keys, keyword_init: true).
new(**config.written_env)
end
Expand Down
6 changes: 6 additions & 0 deletions spec/lib/identity_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,10 @@
end
end
end

describe '.unused_keys' do
it 'does not have any unused keys' do
expect(IdentityConfig.unused_keys).to be_empty
end
end
end