diff --git a/modules/openid_connect/app/seeders/env_data/openid_connect/provider_seeder.rb b/modules/openid_connect/app/seeders/env_data/openid_connect/provider_seeder.rb index 207ba426c74b..861dd96206ad 100644 --- a/modules/openid_connect/app/seeders/env_data/openid_connect/provider_seeder.rb +++ b/modules/openid_connect/app/seeders/env_data/openid_connect/provider_seeder.rb @@ -31,7 +31,7 @@ module EnvData module OpenIDConnect class ProviderSeeder < Seeder def seed_data! - Setting.seed_openid_connect_provider.each do |name, configuration| + Setting.seed_oidc_provider.each do |name, configuration| print_status " ↳ Creating or Updating OpenID provider #{name}" do call = ::OpenIDConnect::SyncService.new(name, configuration).call @@ -45,7 +45,7 @@ def seed_data! end def applicable? - Setting.seed_openid_connect_provider.present? + Setting.seed_oidc_provider.present? end end end diff --git a/modules/openid_connect/lib/open_project/openid_connect.rb b/modules/openid_connect/lib/open_project/openid_connect.rb index d82e29f7e2d5..859f3a34a01d 100644 --- a/modules/openid_connect/lib/open_project/openid_connect.rb +++ b/modules/openid_connect/lib/open_project/openid_connect.rb @@ -4,15 +4,6 @@ module OpenProject module OpenIDConnect - CONFIG_KEY = :seed_openid_connect_provider - CONFIG_OPTIONS = { - description: "Provide a OpenIDConnect provider and sync its settings through ENV", - env_alias: "OPENPROJECT_OPENID__CONNECT", - default: {}, - writable: false, - format: :hash - }.freeze - def providers # update base redirect URI in case settings changed ::OmniAuth::OpenIDConnect::Providers.configure( diff --git a/modules/openid_connect/lib/open_project/openid_connect/engine.rb b/modules/openid_connect/lib/open_project/openid_connect/engine.rb index a9914ec6c6ac..c7e9cff0235e 100644 --- a/modules/openid_connect/lib/open_project/openid_connect/engine.rb +++ b/modules/openid_connect/lib/open_project/openid_connect/engine.rb @@ -60,13 +60,6 @@ class Engine < ::Rails::Engine end end - initializer "openid_connect.configure" do - ::Settings::Definition.add( - OpenProject::OpenIDConnect::CONFIG_KEY, - **OpenProject::OpenIDConnect::CONFIG_OPTIONS - ) - end - initializer "openid_connect.form_post_method" do # If response_mode 'form_post' is chosen, # the IP sends a POST to the callback. Only if @@ -81,6 +74,15 @@ class Engine < ::Rails::Engine end end + initializer "openid_connect.configuration" do + ::Settings::Definition.add :seed_oidc_provider, + description: "Provide a OIDC provider and sync its settings through ENV", + env_alias: "OPENPROJECT_OIDC", + writable: false, + default: {}, + format: :hash + end + config.to_prepare do ::OpenProject::OpenIDConnect::Hooks::Hook end