Skip to content

Conversation

@superchilled
Copy link
Contributor

@superchilled superchilled commented Oct 26, 2023

This PR adds functionality to the SDK to verify JWTs included in Vonage webhooks. Specifically it:

  • Updates the gemspec dependency for vonage-jwt to the new package
  • Adds an SDK-specific verify_hs256_signature method to the Vonage::JWT class
  • Adds verify_webhook_token wrapper methods to Voice and Messaging
  • Adds a verify_webhook_sig wrapper method to SMS
  • Adds tests for the new functionality
  • Updates the README to explain the new functionality

@superchilled
Copy link
Contributor Author

superchilled commented Oct 26, 2023

WIP. Do not merge.

Ready to merge

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

Merging #291 (2f2b46b) into main (e456fd3) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 2f2b46b differs from pull request most recent head 34e8f9e. Consider uploading reports for the commit 34e8f9e to get more accurate results

@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   97.93%   97.94%   +0.01%     
==========================================
  Files         108      108              
  Lines        1988     1999      +11     
==========================================
+ Hits         1947     1958      +11     
  Misses         41       41              
Files Coverage Δ
lib/vonage/jwt.rb 100.00% <100.00%> (ø)
lib/vonage/messaging.rb 100.00% <100.00%> (ø)
lib/vonage/signature.rb 100.00% <100.00%> (ø)
lib/vonage/sms.rb 100.00% <100.00%> (ø)
lib/vonage/voice.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@superchilled superchilled marked this pull request as ready for review November 1, 2023 11:13
@superchilled superchilled merged commit df15bf1 into main Nov 1, 2023
@superchilled superchilled deleted the devx-7707-add-jwt-verification branch November 1, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants