From 5bce7ce476c019a5eaf96f34abfc547ee01861bd Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Mon, 21 Mar 2022 17:18:51 +1100 Subject: [PATCH] fix: ensure database and basic auth credentials are not coerced to arrays if they contain commas --- lib/pact_broker/config/basic_auth_configuration.rb | 7 +++++++ .../config/runtime_configuration_database_methods.rb | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/lib/pact_broker/config/basic_auth_configuration.rb b/lib/pact_broker/config/basic_auth_configuration.rb index 5a046bab0..5946beebf 100644 --- a/lib/pact_broker/config/basic_auth_configuration.rb +++ b/lib/pact_broker/config/basic_auth_configuration.rb @@ -20,6 +20,13 @@ def self.included(anyway_config) sensitive_values(:basic_auth_password, :basic_auth_read_only_password) + coerce_types( + basic_auth_username: :string, + basic_auth_password: :string, + basic_auth_read_only_username: :string, + basic_auth_read_only_password: :string + ) + def basic_auth_credentials_provided? basic_auth_username&.not_blank? && basic_auth_password&.not_blank? end diff --git a/lib/pact_broker/config/runtime_configuration_database_methods.rb b/lib/pact_broker/config/runtime_configuration_database_methods.rb index fd674b454..2bc499e7a 100644 --- a/lib/pact_broker/config/runtime_configuration_database_methods.rb +++ b/lib/pact_broker/config/runtime_configuration_database_methods.rb @@ -31,6 +31,11 @@ def self.included(anyway_config) database_connection_validation_timeout: nil ) + coerce_types( + database_username: :string, + database_password: :string + ) + def database_configuration database_credentials .merge(