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

[#62103] split oauth locale keys for nextcloud and onedrive

Eric Schubert8f167d3c6e2f
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
index 07185f8b8f0..f03bc6fe3d4 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/nextcloud/authentication_validator.rb
@@ -55,13 +55,13 @@ module Storages
if OAuthClientToken.for_user_and_client(@user, @storage.oauth_client).exists?
pass_check(:existing_token)
else
- warn_check(:existing_token, message(:oauth_token_missing), halt_validation: true)
+ warn_check(:existing_token, message("nextcloud.oauth_token_missing"), halt_validation: true)
end
end
def user_bound_request
Registry["nextcloud.queries.user"].call(storage: @storage, auth_strategy:).on_failure do
- fail_check(:user_bound_request, message("oauth_request_#{it.result}"))
+ fail_check(:user_bound_request, message("nextcloud.oauth_request_#{it.result}"))
end
pass_check(:user_bound_request)
diff --git a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
index 17256dacaad..9af9378ab03 100644
--- a/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/connection_validators/one_drive/authentication_validator.rb
@@ -51,13 +51,13 @@ module Storages
if OAuthClientToken.for_user_and_client(@user, @storage.oauth_client).exists?
pass_check(:existing_token)
else
- warn_check(:existing_token, message(:oauth_token_missing), halt_validation: true)
+ warn_check(:existing_token, message("one_drive.oauth_token_missing"), halt_validation: true)
end
end
def user_bound_request
Registry["one_drive.queries.user"].call(storage: @storage, auth_strategy:).on_failure do
- fail_check(:user_bound_request, message("oauth_request_#{it.result}"))
+ fail_check(:user_bound_request, message("one_drive.oauth_request_#{it.result}"))
end
pass_check(:user_bound_request)
diff --git a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
index c08982b45bd..25f3a0941b1 100644
--- a/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
+++ b/modules/storages/app/common/storages/peripherals/nextcloud_connection_validator.rb
@@ -260,7 +260,7 @@ module Storages
type: :warning,
error_code: :wrn_unexpected_content,
timestamp: Time.current,
- description: I18n.t("storages.health.connection_validation.unexpected_content.nextcloud")
+ description: I18n.t("storages.health.connection_validation.nextcloud.unexpected_content")
)
)
end
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 57cf236fdb8..319697f20cc 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -279,11 +279,11 @@ en:
host_not_found: No Nextcloud server found at the configured host url. Please check the configuration.
missing_dependencies: 'A required dependency is missing on the file storage. Please add the following dependency: %{dependency}.'
nextcloud:
+ oauth_request_not_found: OpenProject couldn't find the root folder of Nextcloud using the current logged-in user. Please check the server logs for further information.
+ oauth_request_unauthorized: The current user isn't authorized to see the main folder of Nextcloud or we couldn't acquire a token. Please check the server logs for further information.
+ oauth_token_missing: OpenProject cannot test the user level communication with Nextcloud as the user did not yet link their Nextcloud account.
unexpected_content: Unexpected content found in the managed group folder.
not_configured: The connection could not be validated. Please finish configuration first.
- oauth_request_not_found: OpenProject couldn't find the root folder of Nextcloud using the current logged-in user. Please check the server logs for further information.
- oauth_request_unauthorized: The current user isn't authorized to see the main folder of Nextcloud or we couldn't acquire a token. Please check the server logs for further information.
- oauth_token_missing: OpenProject cannot test the user level communication with Nextcloud as the user did not yet link their Nextcloud account.
oidc_cant_acquire_token: Your OpenID Connect setup doesn't provide the necessary audience, nor provides token exchange capabilities. Please check out our documentation for more information.
oidc_cant_exchange_token: There seems to be a problem with the Token Exchange setup on your OpenID Connect Provider. Please check its configuration and try again.
oidc_cant_refresh_token: There was an error while trying to check your access to the storage. Please check the server logs for further information.
@@ -295,6 +295,9 @@ en:
drive_id_not_found: The configured drive id could not be found. Please check the configuration.
drive_id_wrong: The configured drive id seems invalid. Please check the configuration.
existing_test_folder: The folder %{folder_name} needed for testing already exists. Please delete it and try again.
+ oauth_request_not_found: OpenProject couldn't find the root folder in the drive using the current logged-in user. Please check the server logs for further information.
+ oauth_request_unauthorized: The current user isn't authorized to see the root folder of OneDrive or we couldn't acquire a token. Please check the server logs for further information.
+ oauth_token_missing: OpenProject cannot test the user level communication with OneDrive/SharePoint as the user did not yet link their Microsoft account.
unexpected_content: Unexpected content found in the drive.
placeholder: Check your connection against the server.
subtitle: Connection validation
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
index 547620bd4dd..70efd10f9d3 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/nextcloud/authentication_validator_spec.rb
@@ -56,7 +56,7 @@ module Storages
result = validator.call
expect(result[:existing_token]).to be_a_warning
- expect(result[:existing_token].message).to eq(I18n.t(i18n_key(:oauth_token_missing)))
+ expect(result[:existing_token].message).to eq(I18n.t(i18n_key("nextcloud.oauth_token_missing")))
expect(result[:user_bound_request]).to be_skipped
end
@@ -65,7 +65,7 @@ module Storages
result = validator.call
expect(result[:user_bound_request]).to be_a_failure
- expect(result[:user_bound_request].message).to eq(I18n.t(i18n_key(:oauth_request_unauthorized)))
+ expect(result[:user_bound_request].message).to eq(I18n.t(i18n_key("nextcloud.oauth_request_unauthorized")))
end
end
diff --git a/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/authentication_validator_spec.rb b/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/authentication_validator_spec.rb
index eea23f6958d..c479d9b47b6 100644
--- a/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/authentication_validator_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/connection_validators/one_drive/authentication_validator_spec.rb
@@ -53,7 +53,7 @@ module Storages
result = validator.call
expect(result[:existing_token]).to be_a_warning
- expect(result[:existing_token].message).to eq(I18n.t(i18n_key(:oauth_token_missing)))
+ expect(result[:existing_token].message).to eq(I18n.t(i18n_key("one_drive.oauth_token_missing")))
expect(result[:user_bound_request]).to be_skipped
end
@@ -62,7 +62,7 @@ module Storages
result = validator.call
expect(result[:user_bound_request]).to be_a_failure
- expect(result[:user_bound_request].message).to eq(I18n.t(i18n_key(:oauth_request_unauthorized)))
+ expect(result[:user_bound_request].message).to eq(I18n.t(i18n_key("one_drive.oauth_request_unauthorized")))
end
end