Check signature token if secure URLs are enabled.

@throws \ADmad\Glide\Exception\SignatureException

@return void
549594
protected function _checkSignature()
    {
        if (!$this->getConfig('security.secureUrls')) {
            return;
        }

        $signKey = $this->getConfig('security.signKey') ?: Security::getSalt();
        try {
            SignatureFactory::create($signKey)->validateRequest(
                $this->_path,
                $this->_params
            );
        } catch (Exception $exception) {
            throw new SignatureException($exception->getMessage(), null, $exception);
        }
    }
538954
protected function signature()
    {
        $signature =     $this->settings['clientid']          .
                        ($this->settings['oid']       ?? NULL).
                         $this->settings['amount']            .
                         $this->settings['okUrl']             .
                         $this->settings['failUrl']           .
                         $this->settings['islemtipi']         .
                        ($this->settings['taksit']    ?? NULL).
                         $this->settings['rnd']               .
                         $this->settings['storeKey']          ;

        return $this->signatureEncoder($signature);
    }
339772
public function check(array $auth, array $signature, $prefix)
    {
        if (! isset($auth[$prefix . 'key'])) {
            throw new SignatureKeyException('The authentication key has not been set');
        }

        if ($auth[$prefix . 'key'] !== $signature[$prefix . 'key']) {
            throw new SignatureKeyException('The authentication key is not valid');
        }

        return true;
    }
1017944
private function shallAuthenticate()
    {
        $shallAuthenticate = true;
        if ( eZINI::instance( 'rest.ini' )->variable( 'Authentication', 'RequireAuthentication' ) !== 'enabled' )
        {
            $shallAuthenticate = false;
        }
        else
        {
            $routeFilter = ezpRestRouteFilterInterface::getRouteFilter();
            $shallAuthenticate = $routeFilter->shallDoActionWithRoute( $this->info );
        }

        return $shallAuthenticate;
    }
795164
private function checkForCorrectMessageType()
    {
        $type = $this->getMandatoryField("Type");
        if (strcasecmp($type, "Notification") != 0) {
            throw new \Exception("Error with SNS Notification - unexpected message with Type of " . $type);
        }

        if (strcmp($this->getMandatoryField("Type"), "Notification") != 0) {
            throw new \Exception("Error with signature verification - unable to verify " . $this->getMandatoryField("Type") . " message");
        } else {

            // Sort the fields into byte order based on the key name(A-Za-z)
            ksort($this->fields);

            // Extract the key value pairs and sort in byte order
            $signatureFields = array();
            foreach ($this->fields as $fieldName => $mandatoryField) {
                if ($mandatoryField) {
                    $value = $this->getMandatoryField($fieldName);
                } else {
                    $value = $this->getField($fieldName);
                }

                if (!is_null($value)) {
                    array_push($signatureFields, $fieldName);
                    array_push($signatureFields, $value);
                }
            }

            /* Create the signature string - key / value in byte order
             * delimited by newline character + ending with a new line character
             */
            $this->signatureFields = implode("\n", $signatureFields) . "\n";
        }
    }
308923
private function getSignableParameters()
    {
        // Grab all parameters
        $params = $this->request->getUri()->getQuery() . '&' . $this->request->getBody()->__toString();
        $params = Util::parseParameters($params);

        // Remove oauth_signature if present
        // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
        if (isset($params['oauth_signature'])) {
            unset($params['oauth_signature']);
        }

        $params = array_merge($params, $this->additionalParams);

        return Util::buildHttpQuery($params);
    }
1172874
public function __isAllowed()
    {
        if ($this->checkAuthentication !== true) {
            // this controller is not responsible for the authentication
            return false;
        }

        $this->typo3Loader->initializeFrontEndUser($this->determinePageIdFromArguments());

        $feUser = $this->typo3Loader->getFrontEndUser();
        if ($feUser->user === null) {
            return false;
        }
        return true;
    }
1249941
private function isUserTokenAuthenticated()
    {
        try
        {
            $token = $this->TokenUser->getTokenInterface()->get();
            $this->TokenUser->validate($token);
        }
        catch (Exception $exception)
        {
            // We will re-throw this error later if no other authentication types give a successful result
            return $exception;
        }

        return true;
    }
1050449
public function isBypassEnabled() {
        $cookieName = Mage::helper('turpentine/data')->getBypassCookieName();
        $cookieValue = Mage::getModel('core/cookie')->get($cookieName);

        return $cookieValue === $this->getSecretHandshake();
    }
1120672
public function __isAllowed()
    {
        if ($this->checkAuthentication !== true) {
            // this controller is not responsible for the authentication
            return false;
        }

        $this->typo3Loader->initializeBackendEndUser();

        $beUser = $this->typo3Loader->getBackEndUser();
        if (false === is_array($beUser->user) || empty($beUser->user['uid'])) {
            return false;
        }
        return true;
    }
489131
private function checkAndRegisterNoMultiLine(): void
    {
        $docCommentPos = $this->getDocCommentPos();
        $openingToken = $this->tokens[$docCommentPos];
        $closingToken = $this->tokens[$openingToken['comment_closer']];

        if ($openingToken['line'] === $closingToken['line']) {
            $tokenIdent = $this->getTokenName();

            $exception = (new CodeError(
                static::CODE_NO_MULTI_LINE_DOC_BLOCK_PREFIX . ucfirst($tokenIdent),
                self::MESSAGE_NO_MULTI_LINE_DOC_BLOCK_PREFIX,
                $docCommentPos
            ))->setPayload([lcfirst($tokenIdent)]);

            throw $exception;
        }
    }
537252
public function hasBeenSignaled()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);

        if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
            throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
        }

        return $this->processInformation['signaled'];
    }
1187375
public function actionForgottenPassword(): void
	{
		$session = $this->getSession('cms/forgottenPassword');
		if ($session->count >= self::MAX_TRY) {
			$this->flashNotifier->warning('cms.user.restorePasswordDisabledForHour');
			$this->redirect(":{$this->module}:Sign:in");
		}
	}
453691
protected function processToken(): void
    {
        try {
            $this->checkAndRegisterMissingDocBlock();
            $this->checkAndRegisterNoMultiLine();
        } catch (CodeWarning $error) {
            $this->getExceptionHandler()->handleException($error);
        }
    }
645033
protected function checkAuth()
	{
		try {

			// get the JWT from the headers
			list($jwt) = sscanf($_SERVER["HTTP_AUTHORIZATION"], 'Bearer %s');

			// init the jwt auth class
			$authenticator = new JWTAuthenticator(new User());

			// get the application secret key
			$config     = \Erdiko::getConfig();
			$secretKey  = $config["site"]["secret_key"];

			// collect login params
			$params = array(
				'secret_key'    =>  $secretKey,
				'jwt'           =>  $jwt
			);

			$user = $authenticator->verify($params, 'jwt_auth');

			//TODO check the user's permissions via Resource & Authorization

			// no exceptions? welp, this is a valid request
			return true;
		} catch (\Exception $e) {
			return true;
		}
	}
616256
private function checkSignature($request)
	{
		$serverToken = $this->_config['serverToken'];
		$sigature = $this->getSign($serverToken,$request['nonce'],$request['timestamp']);
		if($sigature == $request['signature'])
			return true;
		return false;
	}
464564
public function isStored()
    {
        foreach ($this->getKeys() as $key) {
            if (!$this->cookieBag->has($key)) {
                return false;
            }
        }

        // Now start checking the signature
        if (!$this->isValidSignature(
            $this->cookieBag->get(self::CLIENT_LOGIN_KEY), 
            $this->cookieBag->get(self::CLIENT_LOGIN_PASSWORD_HASH_KEY),
            $this->cookieBag->get(self::CLIENT_TOKEN_KEY)
        )) {
            return false;
        }

        return true;
    }