protected function authentication(): bool
	{
		if ($this->url === null) {
			throw new InvalidArgumentException('Project URL is not set');
		}

		$payload = file_get_contents('php://input');

		switch ($this->type) {
			case 'gitlab':
				$authenticated = $this->authenticateGitlab($payload);
				break;

			case 'github':
				$authenticated = $this->authenticateGithub($payload);
				break;

			case 'bitbucket':
				$authenticated = $this->authenticateBitbucket($payload);
				break;

			default:
				throw new InvalidArgumentException("Unsupported type '$this->type'");
		}

		if ($authenticated) {
			return true;
		} else {
			Debugger::log('Unknown access from ' . $this->request->getRemoteHost() . '(' . $this->request->getRemoteAddress() . ')', 'deploy');
			return false;
		}
	}