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

[#67071] improve error message for app password validation

Eric Schubert7b150b8f2f52
diff --git a/modules/storages/config/locales/en.yml b/modules/storages/config/locales/en.yml
index 40620ddfd7d..653cd3e3ddb 100644
--- a/modules/storages/config/locales/en.yml
+++ b/modules/storages/config/locales/en.yml
@@ -33,6 +33,7 @@ en:
drive: Drive ID
host: Host
name: Name
+ password: Application password
provider_type: Provider type
tenant: Directory (tenant) ID
errors:
@@ -63,7 +64,7 @@ en:
op_application_not_installed: appears to not have the app "OpenProject integration" installed. Please install it first and then try again.
password:
invalid_password: is not valid.
- unknown_error: could not be validated. Please check your storage connection and try again.
+ unknown_error: could not be validated with the file storage provider. Please verify that the connection is functioning properly.
models:
file_link: File
storages/storage: Storage
diff --git a/modules/storages/spec/common/storages/adapters/providers/nextcloud/contracts/storage_contract_spec.rb b/modules/storages/spec/common/storages/adapters/providers/nextcloud/contracts/storage_contract_spec.rb
index c8fa2c6a15a..ae89c97cdf5 100644
--- a/modules/storages/spec/common/storages/adapters/providers/nextcloud/contracts/storage_contract_spec.rb
+++ b/modules/storages/spec/common/storages/adapters/providers/nextcloud/contracts/storage_contract_spec.rb
@@ -91,8 +91,9 @@ module Storages
credentials_request = mock_nextcloud_application_credentials_validation(storage.host, timeout: true)
expect(subject).not_to be_valid
- expect(subject.errors.to_hash)
- .to eq({ password: ["could not be validated. Please check your storage connection and try again."] })
+ message = "could not be validated with the file storage provider. " \
+ "Please verify that the connection is functioning properly."
+ expect(subject.errors.to_hash).to eq({ password: [message] })
# twice due to HTTPX retry plugin being enabled.
expect(credentials_request).to have_been_made.twice
@@ -106,8 +107,9 @@ module Storages
credentials_request = mock_nextcloud_application_credentials_validation(storage.host, response_code: 500)
expect(subject).not_to be_valid
- expect(subject.errors.to_hash)
- .to eq({ password: ["could not be validated. Please check your storage connection and try again."] })
+ message = "could not be validated with the file storage provider. " \
+ "Please verify that the connection is functioning properly."
+ expect(subject.errors.to_hash).to eq({ password: [message] })
expect(credentials_request).to have_been_made.once
end
diff --git a/modules/storages/spec/requests/api/v3/storages/storages_api_spec.rb b/modules/storages/spec/requests/api/v3/storages/storages_api_spec.rb
index 53ab7bb4c1d..147a637b448 100644
--- a/modules/storages/spec/requests/api/v3/storages/storages_api_spec.rb
+++ b/modules/storages/spec/requests/api/v3/storages/storages_api_spec.rb
@@ -380,7 +380,7 @@ RSpec.describe "API v3 storages resource", :storage_server_helpers, :webmock, co
subject { last_response.body }
- it { is_expected.to be_json_eql("Password is not valid.".to_json).at_path("message") }
+ it { is_expected.to be_json_eql("Application password is not valid.".to_json).at_path("message") }
end
end
end