OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Make warden available across entire application
Jan Sandbrink7c978030beb2
diff --git a/config/initializers/warden.rb b/config/initializers/warden.rbindex b2a43c58277..49215af78e2 100644--- a/config/initializers/warden.rb+++ b/config/initializers/warden.rb@@ -1,27 +1,31 @@-Rails.application.config.after_initialize do- namespace = OpenProject::Authentication::Strategies::Warden+# frozen_string_literal: true- strategies = [- [:basic_auth_failure, namespace::BasicAuthFailure, "Basic"],- [:global_basic_auth, namespace::GlobalBasicAuth, "Basic"],- [:user_basic_auth, namespace::UserBasicAuth, "Basic"],- [:oauth, namespace::DoorkeeperOAuth, "Bearer"],- [:anonymous_fallback, namespace::AnonymousFallback, "Basic"],- [:jwt_oidc, namespace::JwtOidc, "Bearer"],- [:session, namespace::Session, "Session"]- ]+namespace = OpenProject::Authentication::Strategies::Warden- strategies.each do |name, clazz, auth_scheme|- OpenProject::Authentication.add_strategy(name, clazz, auth_scheme)- end+strategies = [+ [:basic_auth_failure, namespace::BasicAuthFailure, "Basic"],+ [:global_basic_auth, namespace::GlobalBasicAuth, "Basic"],+ [:user_basic_auth, namespace::UserBasicAuth, "Basic"],+ [:oauth, namespace::DoorkeeperOAuth, "Bearer"],+ [:anonymous_fallback, namespace::AnonymousFallback, "Basic"],+ [:jwt_oidc, namespace::JwtOidc, "Bearer"],+ [:session, namespace::Session, "Session"]+]- OpenProject::Authentication.update_strategies(OpenProject::Authentication::Scope::API_V3, { store: false }) do |_|- %i[global_basic_auth- user_basic_auth- basic_auth_failure- oauth- jwt_oidc- session- anonymous_fallback]- end+strategies.each do |name, clazz, auth_scheme|+ OpenProject::Authentication.add_strategy(name, clazz, auth_scheme)+end++OpenProject::Authentication.update_strategies(OpenProject::Authentication::Scope::API_V3, { store: false }) do |_|+ %i[global_basic_auth+ user_basic_auth+ basic_auth_failure+ oauth+ jwt_oidc+ session+ anonymous_fallback]+end++Rails.application.configure do |app|+ app.config.middleware.use OpenProject::Authentication::Manager, intercept_401: false # rubocop:disable Naming/VariableNumberenddiff --git a/lib/api/root_api.rb b/lib/api/root_api.rbindex 01eca460c10..f24ed382a00 100644--- a/lib/api/root_api.rb+++ b/lib/api/root_api.rb@@ -44,8 +44,6 @@ module APIcontent_type :json, "application/json; charset=utf-8"- use OpenProject::Authentication::Manager-helpers API::Caching::Helpersmodule Helpersinclude ::API::Helpers::RaiseQueryErrorsdiff --git a/lib/open_project/static_routing.rb b/lib_static/open_project/static_routing.rbsimilarity index 100%rename from lib/open_project/static_routing.rbrename to lib_static/open_project/static_routing.rbdiff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rbindex 53e9e5a3aff..d50855d6212 100644--- a/modules/bim/lib/open_project/bim/engine.rb+++ b/modules/bim/lib/open_project/bim/engine.rb@@ -215,7 +215,9 @@ module OpenProject::Bimconfig.to_prepare doDoorkeeper.configuration.scopes.add(:bcf_v2_1)+ end+ config.before_initialize dounless defined? OpenProject::Authentication::Scope::BCF_V2_1OpenProject::Authentication::Scope::BCF_V2_1 = :bcf_v2_1end