Skip to content
Snippets Groups Projects
Commit dd394774 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #56, re #58

parent 6b1d1079
No related branches found
No related tags found
No related merge requests found
......@@ -28,9 +28,12 @@ final class HooksController extends EventController
public function web_action()
{
if (!$this->verifySecret(Config::get()->getValue('TRAC2GITLAB_GITLAB_WEBHOOK_SECRET'))) {
$this->halt('Thou shalt not pass.', 403);
}
// if (!$this->verifySecret(Config::get()->getValue('TRAC2GITLAB_GITLAB_WEBHOOK_SECRET'))) {
// $this->halt('Thou shalt not pass.', 403);
// }
//
dd(app(EventHandlers\BranchDeleted::class));
$payload = $this->payload();
......
......@@ -13,9 +13,9 @@ abstract class EventController extends GitlabController
{
parent::before_filter($action, $args);
if (!Request::isPost()) {
$this->halt('Only POST requests are allowed');
}
// if (!Request::isPost()) {
// $this->halt('Only POST requests are allowed');
// }
}
protected function verifySecret(string $secret): bool
......
......@@ -13,9 +13,9 @@ final class AllAutomaticJobsHaveSucceeded extends Hooks\Pipeline
private Gitlab\Client $gitlab_client;
public function __construct(Gitlab\Client $client)
public function __construct()
{
$this->gitlab_client = $client;
$this->gitlab_client = app(Gitlab\Client::class);
}
public function __invoke(array $payload)
......
......@@ -9,9 +9,9 @@ final class BranchDeleted extends Hooks\Push
{
private BytistConnector $connector;
public function __construct(BytistConnector $connector)
public function __construct()
{
$this->connector = $connector;
$this->connector = app(BytistConnector::class);
}
public function __invoke(array $payload)
......
......@@ -13,15 +13,9 @@ final class BuildImageJobSucceeded extends Hooks\Pipeline
use GetBuildImageJob;
use BranchHasOpenMR;
private BytistConnector $connector;
private Gitlab\Client $gitlab_client;
public function __construct(
Gitlab\Client $client,
BytistConnector $connector
) {
$this->gitlab_client = $client;
$this->connector = $connector;
public function __construct() {
$this->gitlab_client = app(Gitlab\Client::class);
$this->connector = app(BytistConnector::class);
}
public function __invoke(array $payload)
......
......@@ -18,10 +18,10 @@ final class IssueCreated extends Hooks\Issue
private Gitlab\Client $gitlab_client;
private Parsedown $parsedown;
public function __construct(Gitlab\Client $gitlab_client, Parsedown $parsedown)
public function __construct()
{
$this->gitlab_client = $gitlab_client;
$this->parsedown = $parsedown;
$this->gitlab_client = app(Gitlab\Client::class);
$this->parsedown = app(Parsedown::class);
}
public function __invoke(array $payload)
......
......@@ -9,9 +9,9 @@ final class UserCreated extends Hooks\System
{
private Gitlab\Client $gitlab_client;
public function __construct(Gitlab\Client $client)
public function __construct()
{
$this->gitlab_client = $client;
$this->gitlab_client = app(Gitlab\Client::class);
}
public function shouldReactToEventType(string $event_type): bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment