- Status changed to Fixed
about 2 years ago 1:52pm 16 January 2023 Automatically closed - issue fixed for 2 weeks with no activity.
The Signal's created_at should be the datetime of the alert and not the datetime of the push
CrowdSec SDK has been updated:
* creation of Watcher function buildSignal //more flexible than createSignal
* creation of Watcher function buildSimpleSignalForIp // for basic signals (see code bellow)
* deprecation of createSignal helper function
Because it's faster for this first interaction than to push the code (my account is allowed no fork yet):
// in addSignal(...)
// ...
$now = (new \DateTime('now', new \DateTimeZone('UTC')))->format('Y-m-d\TH:i:s.u\Z');
$signals[] = [
'scenario' => $scenario,
'ip' => $ip,
'duration' => $duration,
'created_at' => $now,
];
// ...
// in push()
// ...
try {
$pushSignals[] = buildSimpleSignalForIp(
$signal['ip'],
$signal['scenario'],
new DateTime($signal['created_at']),
'',
$signal['duration']
);
}
catch (ClientException $e) {
// ...
Fixed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.