Skip to content

Commit

Permalink
Delete some code that should be unused now
Browse files Browse the repository at this point in the history
  • Loading branch information
blagh committed Oct 22, 2021
1 parent 78bc94a commit aebee37
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions LibreNMS/Alert/Transport/Pagerduty.php
Expand Up @@ -35,7 +35,6 @@
class Pagerduty extends Transport
{
protected $name = 'PagerDuty';
public static $integrationKey = '2fc7c9f3c8030e74aae6';

public function deliverAlert($obj, $opts)
{
Expand Down Expand Up @@ -133,32 +132,4 @@ public static function configTemplate()
],
];
}

public function handleOauth(Request $request)
{
$validator = Validator::make($request->all(), [
'account' => 'alpha_dash',
'service_key' => 'regex:/^[a-fA-F0-9]+$/',
'service_name' => 'string',
]);

if ($validator->fails()) {
Log::error('Pagerduty oauth failed validation.', ['request' => $request->all()]);

return false;
}

$config = json_encode($request->only('account', 'service_key', 'service_name'));

if ($id = $request->get('id')) {
return (bool) dbUpdate(['transport_config' => $config], 'alert_transports', 'transport_id=?', [$id]);
} else {
return (bool) dbInsert([
'transport_name' => $request->get('service_name', 'PagerDuty'),
'transport_type' => 'pagerduty',
'is_default' => 0,
'transport_config' => $config,
], 'alert_transports');
}
}
}

0 comments on commit aebee37

Please sign in to comment.