mirror of https://github.com/MISP/MISP
Merge branch 'feature-workflow-module-msteams' into develop
commit
74830c5a42
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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 |
Loading…
Reference in New Issue