Skip to content

Commit

Permalink
GC-1725: attempting to fix url regex
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthpant92 committed Oct 25, 2023
1 parent d4b3484 commit b2012e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/openapi_client/models/bank_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def list_invalid_properties
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
end

pattern = Regexp.new(/^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|_thumb_[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$/)
pattern = Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
if !@signature_url.nil? && @signature_url !~ pattern
invalid_properties.push("invalid value for \"signature_url\", must conform to the pattern #{pattern}.")
end
Expand Down Expand Up @@ -293,7 +293,7 @@ def valid?
return false if @signatory.to_s.length > 30
return false if @id.nil?
return false if @id !~ Regexp.new(/^bank_[a-zA-Z0-9]+$/)
return false if !@signature_url.nil? && @signature_url !~ Regexp.new(/^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|_thumb_[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$/)
return false if !@signature_url.nil? && @signature_url !~ Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
return false if @date_created.nil?
return false if @date_modified.nil?
return false if @object.nil?
Expand Down Expand Up @@ -392,7 +392,7 @@ def id=(id)
# Custom attribute writer method with validation
# @param [Object] signature_url Value to be assigned
def signature_url=(signature_url)
pattern = Regexp.new(/^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|_thumb_[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$/)
pattern = Regexp.new(/^https:\/\/lob-assets.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(''|_signature)(.pdf|_thumb_[a-z]+_[0-9]+.png|.png)\?(version=[a-z0-9]*&)expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+/)
if !signature_url.nil? && signature_url !~ pattern
fail ArgumentError, "invalid value for \"signature_url\", must conform to the pattern #{pattern}."
end
Expand Down
2 changes: 1 addition & 1 deletion lib/openapi_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Lob
VERSION = '6.0.3'
VERSION = '6.0.4'
end

0 comments on commit b2012e0

Please sign in to comment.