Merge branch 'feature-workflow-module-msteams' into develop

pull/8568/head
Sami Mokaddem 2022-08-25 11:07:45 +02:00
commit 74830c5a42
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
3 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,45 @@
<?php
include_once APP . 'Model/WorkflowModules/action/Module_webhook.php';
class Module_ms_teams_webhook extends Module_webhook
{
public $id = 'ms-teams-webhook';
public $name = 'MS Teams Webhook';
public $description = 'Perform callbacks to the MS Teams webhook provided by the "Incoming Webhook" connector';
public $icon_path = 'MS_Teams.png';
public function __construct()
{
parent::__construct();
$this->params = [
[
'id' => 'url',
'label' => 'MS Teams Webhook URL',
'type' => 'input',
'placeholder' => 'https://example.com/test',
],
[
'id' => 'content_type',
'label' => 'Content type',
'type' => 'select',
'default' => 'form',
'options' => [
'form' => 'application/x-www-form-urlencoded',
],
],
[
'id' => 'data_extraction_path',
'label' => 'Data extraction path',
'type' => 'input',
'default' => '',
'placeholder' => 'Attribute.{n}.AttributeTag.{n}.Tag.name',
],
];
}
protected function doRequest($url, $contentType, $data)
{
$data = '{"text":"' . implode($data) . '"}';
return parent::doRequest($url, $contentType, $data);
}
}

View File

@ -82,7 +82,7 @@ class Module_webhook extends WorkflowBaseActionModule
return false;
}
private function doRequest($url, $contentType, array $data)
protected function doRequest($url, $contentType, $data)
{
$this->Event = ClassRegistry::init('Event'); // We just need a model to use AppModel functions
$version = implode('.', $this->Event->checkMISPVersion());

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB