mirror of https://github.com/MISP/MISP
commit
83ca1efd87
|
@ -537,6 +537,7 @@ class ACLComponent extends Component
|
|||
'resetRemoteAuthKey' => array(),
|
||||
'removeOrphanedCorrelations' => array('perm_site_admin'),
|
||||
'rest' => array('perm_auth'),
|
||||
'openapi' => array('*'),
|
||||
'restartDeadWorkers' => array(),
|
||||
'restartWorkers' => array(),
|
||||
'serverSettings' => array(),
|
||||
|
|
|
@ -2527,4 +2527,7 @@ misp.direct_call(relative_path, body)
|
|||
$syncFilteringRules = $this->Server->getAvailableSyncFilteringRules($this->Auth->user());
|
||||
return $this->RestResponse->viewData($syncFilteringRules);
|
||||
}
|
||||
|
||||
public function openapi() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class Organisation extends AppModel
|
|||
'uuid' => '0',
|
||||
'contacts' => '',
|
||||
'local' => true,
|
||||
'restricted_to_domain' => '[]',
|
||||
'restricted_to_domain' => [],
|
||||
'landingpage' => null
|
||||
);
|
||||
|
||||
|
|
|
@ -1556,6 +1556,23 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider');
|
|||
));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'api':
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'openapi',
|
||||
'url' => $baseurl . '/servers/openapi',
|
||||
'text' => __('OpenAPI')
|
||||
));
|
||||
if ($isAclAdd) {
|
||||
if ($canAccess('servers', 'rest')) {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'rest',
|
||||
'url' => $baseurl . '/servers/rest',
|
||||
'text' => __('REST client')
|
||||
));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
@ -33,11 +33,6 @@
|
|||
'text' => __('Search Attributes'),
|
||||
'url' => $baseurl . '/attributes/search'
|
||||
),
|
||||
array(
|
||||
'text' => __('REST client'),
|
||||
'url' => $baseurl . '/servers/rest',
|
||||
'requirement' => $canAccess('servers', 'rest'),
|
||||
),
|
||||
array(
|
||||
'type' => 'separator'
|
||||
),
|
||||
|
@ -476,6 +471,21 @@
|
|||
'url' => $baseurl . '/admin/logs/search'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'root',
|
||||
'text' => __('API'),
|
||||
'children' => array(
|
||||
array(
|
||||
'text' => __('OpenAPI'),
|
||||
'url' => $baseurl . '/servers/openapi'
|
||||
),
|
||||
array(
|
||||
'text' => __('REST client'),
|
||||
'url' => $baseurl . '/servers/rest',
|
||||
'requirement' => $canAccess('servers', 'rest')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$menu_right = array(
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
?>
|
||||
<div class="event index">
|
||||
<h2><?php echo __('Automation');?></h2>
|
||||
<p class="bold"><?php echo __('Check out the OpenAPI spec of the MISP Automation API <a href="%s">here</a>.', $baseurl . '/servers/openapi');?></p>
|
||||
<p><?php echo __('Automation functionality is designed to automatically feed other tools and systems with the data in your MISP repository.
|
||||
To to make this functionality available for automated tools an authentication key is used.');?>
|
||||
<br /><?php echo __('You can use the <a href="' . $baseurl . '/servers/rest">REST client</a> to test your API queries against your MISP and export the resulting tuned queries as curl or python scripts.');?>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
echo $this->element('genericElements/assetLoader', array(
|
||||
'js' => array('redoc.standalone')
|
||||
));
|
||||
?>
|
||||
<div id="redoc-container"></div>
|
||||
<script>
|
||||
Redoc.init('/doc/openapi.yaml', {
|
||||
fontFamily: "inherit",
|
||||
disableSearch: true,
|
||||
expandResponses: "200"
|
||||
}, document.getElementById('redoc-container'))
|
||||
</script>
|
|
@ -189,7 +189,7 @@
|
|||
</div>
|
||||
|
||||
<?php
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'rest'));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'api', 'menuItem' => 'rest'));
|
||||
echo $this->element('genericElements/assetLoader', array(
|
||||
'js' => array(
|
||||
'moment.min',
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue