Skip to content

Commit

Permalink
fix: ensure database and basic auth credentials are not coerced to ar…
Browse files Browse the repository at this point in the history
…rays if they contain commas
  • Loading branch information
bethesque committed Mar 21, 2022
1 parent aebb6bd commit 5bce7ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/pact_broker/config/basic_auth_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5bce7ce

Please sign in to comment.