{{ message }}
Tornando Webhook mais seguro com JWT token#1318
Merged
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom May 10, 2025
Merged
Tornando Webhook mais seguro com JWT token#1318DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom
Conversation
Contributor
Contributor
There was a problem hiding this comment.
Hey @victoreduardo - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a configuration option for the JWT expiration time, instead of hardcoding it to 10 minutes.
- The addition of the
jsonwebtokendependency should be noted in the description.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
4b25e84 to
cee2bc4
Compare
Contributor
|
Se possivel deixar esse tipo de autenticação opcional. Nem todo mundo vai usar. |
a autenticação só é aplicada se existir |
Collaborator
|
Ajuste os conflitos e lint por favor, estava para a branch main, o correto é para a develop, rode o compando |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Objetivo:
Validar se a mensagem está sendo enviada por um remetente autentico, evitando que requisições maliciosas utilizem a URL para enviar informações fraudulentas. Para isso, ao enviar a requisição para a URL do webhook, adicionamos uma camada de autenticação utilizando JWT token. Para quem utiliza n8n, por exemplo, conseguirá adicionar a autenticação por JWT no webhook, protegendo-o de requisições maliciosas.
Mudanças:
jsonwebtokenpara gerar o tokenjwt_keydentro do campoheadersda tabelaWebhooks, então utilizaremos essa key para gerar o JWT token e encaminha-lo via requisição.Summary by Sourcery
Enhance webhook security by adding JWT authentication. This ensures that webhook requests originate from an authenticated source, preventing malicious requests and fraudulent information.
Enhancements: