Skip to content

Commit 72420c5

Browse files
committed
Add webhooks
1 parent 61569eb commit 72420c5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/Config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ public function showSystemInformations()
884884
RSSFeed::class => RSSFeed::getTypeName(),
885885
Planning::class => Planning::getTypeName(),
886886
OauthConfig::class => __('SMTP OAuth Authentication'),
887+
Webhook::class => Webhook::getTypeName(),
887888
],
888889
$CFG_GLPI['possible_proxy_exclusions']
889890
),

src/QueuedWebhook.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ public static function sendById(int $ID): bool
171171
$guzzle_options = [
172172
'timeout' => 5,
173173
];
174+
if (in_array(Webhook::class, $CFG_GLPI['proxy_exclusions'])) {
175+
$options['proxy_excluded'] = true;
176+
}
174177

175178
$webhook = new Webhook();
176179
if (!$webhook->getFromDB($queued_webhook->fields['webhooks_id'])) {

src/Webhook.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,11 +1050,16 @@ public static function getSignature($data, $secret): string
10501050
*/
10511051
public static function validateCRAChallenge(string $url, string $body, string $secret): array
10521052
{
1053+
global $CFG_GLPI;
1054+
10531055
$challenge_response = [];
10541056
$options = [
10551057
'base_uri' => $url,
10561058
'connect_timeout' => 1,
10571059
];
1060+
if (in_array(self::class, $CFG_GLPI['proxy_exclusions'])) {
1061+
$options['proxy_excluded'] = true;
1062+
}
10581063

10591064
// init guzzle client with base options
10601065
$httpClient = Toolbox::getGuzzleClient($options);

0 commit comments

Comments
 (0)