Skip to content

Commit

Permalink
validate incoming_auth_username and password (#1465)
Browse files Browse the repository at this point in the history
* validate gateways auth usernames and passwords
  • Loading branch information
dmitry-sinina authored Apr 24, 2024
1 parent b4e5f1e commit e3a5f8b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/gateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,11 @@ def normalize_host(value)

validates :diversion_domain, presence: true, if: proc { diversion_send_mode_id == 2 }

validates :auth_user, :auth_password, format: { without: /\s/, message: 'must contain no spaces' }

validates :incoming_auth_username, presence: true, if: proc { incoming_auth_password.present? }
validates :incoming_auth_password, presence: true, if: proc { incoming_auth_username.present? }
validates :incoming_auth_username, :incoming_auth_password, format: { without: /\s/, message: 'must contain no spaces' }

validates :transit_headers_from_origination, :transit_headers_from_termination,
format: { with: /\A[a-zA-Z\-\,\*]*\z/, message: 'Enter headers separated by comma. Header name can contain letters, * and -' }
Expand Down

0 comments on commit e3a5f8b

Please sign in to comment.