Added support for Bearer token on Webhook class #1784
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.
Webhook class now supports the addition of an optional "token". It needs to be declared at the same level that "url" on the application.conf file. If the parameter exists within a webhook definition, its value will be added to an Authorization header. Else, the send() function of the Webhook class won't include this header on the POST request.
An example of configuration on the application.conf would be as follows:
So, in order to test this solution you should:
PR_Issue-1690-application.conf.txt
PR_Issue-1690-webhooktest_1.py.txt
PR_Issue-1690-webhooktest_2.py.txt
I am a beginner on Scala, so maybe there is an easier way to achieve this goal. In any case, I tested the code and seems to work on TheHive 3.5.0-1 which is the version that I could download from the build it yourself section.