You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the docs, we should reject requests older than 5 minutes. 5 minutes is 300 seconds or 300,000 milliseconds, but Signature::MAX_ALLOWED_TIMESTAMP is neither (3000)
If the timestamp argument is the value of the x-hubspot-request-timestamp header then we should be using milliseconds all over the place (MAX_ALLOWED_TIMESTAMP = 300_000).
Then, this comparison
current_time = DateTime.now.strftime("%s").to_i
if current_time - timestamp.to_i > MAX_ALLOWED_TIMESTAMP
raise InvalidSignatureTimestampError.new(timestamp)
end
should become
current_time = DateTime.now.to_i * 1_000
if current_time - timestamp.to_i > MAX_ALLOWED_TIMESTAMP
raise InvalidSignatureTimestampError.new(timestamp)
end
The text was updated successfully, but these errors were encountered:
About https://github.com/HubSpot/hubspot-api-ruby/blob/master/lib/hubspot/helpers/signature.rb
According to the docs, we should reject requests older than 5 minutes. 5 minutes is 300 seconds or 300,000 milliseconds, but
Signature::MAX_ALLOWED_TIMESTAMP
is neither (3000
)If the
timestamp
argument is the value of thex-hubspot-request-timestamp
header then we should be using milliseconds all over the place (MAX_ALLOWED_TIMESTAMP = 300_000
).Then, this comparison
should become
The text was updated successfully, but these errors were encountered: