Skip to content

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

[#54558] hardened oauth configuration interface

Eric Schubert197a5e668ee3
diff --git a/modules/storages/app/common/storages/peripherals/oauth_configurations/configuration_interface.rb b/modules/storages/app/common/storages/peripherals/oauth_configurations/configuration_interface.rb
index 78d22ce075a..faafbcdf59f 100644
--- a/modules/storages/app/common/storages/peripherals/oauth_configurations/configuration_interface.rb
+++ b/modules/storages/app/common/storages/peripherals/oauth_configurations/configuration_interface.rb
@@ -39,7 +39,7 @@ module Storages
def to_httpx_oauth_config = raise ::Storages::Errors::SubclassResponsibility
def authorization_uri(state: nil)
- basic_rack_oauth_client.authorization_uri(scope:, state:)
+ basic_rack_oauth_client&.authorization_uri(scope:, state:)
end
end
end
diff --git a/modules/storages/app/common/storages/peripherals/oauth_configurations/nextcloud_configuration.rb b/modules/storages/app/common/storages/peripherals/oauth_configurations/nextcloud_configuration.rb
index eb6c47c6db8..5b0eb0250c0 100644
--- a/modules/storages/app/common/storages/peripherals/oauth_configurations/nextcloud_configuration.rb
+++ b/modules/storages/app/common/storages/peripherals/oauth_configurations/nextcloud_configuration.rb
@@ -62,6 +62,8 @@ module Storages
end
def basic_rack_oauth_client
+ return nil if @oauth_client.nil?
+
Rack::OAuth2::Client.new(
identifier: @oauth_client.client_id,
secret: @oauth_client.client_secret,
diff --git a/modules/storages/app/common/storages/peripherals/oauth_configurations/one_drive_configuration.rb b/modules/storages/app/common/storages/peripherals/oauth_configurations/one_drive_configuration.rb
index d29e6bd947b..ae650ba6a02 100644
--- a/modules/storages/app/common/storages/peripherals/oauth_configurations/one_drive_configuration.rb
+++ b/modules/storages/app/common/storages/peripherals/oauth_configurations/one_drive_configuration.rb
@@ -67,6 +67,8 @@ module Storages
end
def basic_rack_oauth_client
+ return nil if @oauth_client.nil?
+
Rack::OAuth2::Client.new(
identifier: @oauth_client.client_id,
redirect_uri: @oauth_client.redirect_uri,