Add the token (jti claim) to the blacklist.

@param  \Tymon\JWTAuth\Payload  $payload

@return bool
195861
public function add(Payload $payload)
    {
        // if there is no exp claim then add the jwt to
        // the blacklist indefinitely
        if (! $payload->hasKey('exp')) {
            return $this->addForever($payload);
        }

        // if we have already added this token to the blacklist
        if (! empty($this->storage->get($this->getKey($payload)))) {
            return true;
        }

        $this->storage->add(
            $this->getKey($payload),
            ['valid_until' => $this->getGraceTimestamp()],
            $this->getMinutesUntilExpired($payload)
        );

        return true;
    }
799633
public function compileInsert(CompilerPayload $payload)
    {
        $builder = $payload->getBuilder();

        if ($builder instanceof AbstractInsertBuilder) {
            $actualSQL = 'INSERT INTO';
            $payload = $payload->updateSQL($actualSQL);
        }

        return $payload;
    }
1362732
public function packPayload($payload)
    {
        $payload = JsonEncoder::jsonEncode($payload);

        /** @var APNSMessage $message */
        $message = $this->message;

        $recipientId = $message->getRecipientDeviceCollection()->current()->getIdentifier();

        $messageRecipientId = $this->notificationId . '_' . $recipientId;

        $packedPayload =
            pack('C', 1). // Command push
            pack('N', $messageRecipientId).
            pack('N', $message->getExpirationTime()->format('U')).
            pack('n', 32). // Token binary length
            pack('H*', $recipientId);
        pack('n', strlen($payload));

        $packedPayload .= $payload;

        return $packedPayload;
    }
1287803
public function processStack($payload, PipeChainCollectionInterface $pipeChainCollection)
    {
        foreach ( $pipeChainCollection as $stage => $fallback ) {
            $payload = $this->process($payload, $stage, $fallback);
        }

        return $payload;
    }
147008
public static function json($payload){
        static::type(static::TYPE_JSON);
        static::$payload[] = json_encode($payload, Options::get('core.response.json_flags',JSON_NUMERIC_CHECK|JSON_BIGINT_AS_STRING));
    }
1195574
public function verify($expected, $payload, $key)
    {
        return $this->signer->verify($expected, $payload, $key);
    }
1066647
public function setPayload(string $payload): self
    {
        $this->checkContentType();
        $this->isValidString($payload, 1000);

        $this->payload = $payload;

        return $this;
    }
1108357
public function sendPayload($payload, $callback)
    {
        if (!is_string($payload)) {
            throw new \InvalidArgumentException('Payload must be string.');
        }

        try {
            $res = $this->client->post($this->host, [
                'headers' => [
                    'content-type' => 'application/json'
                ],
                'body' => $payload,
                'timeout' => $this->timeout,
                'connect_timeout' => $this->timeout
            ]);
            /**
             * @var StreamInterface $stream ;
             */
            $stream = $res->getBody();
            $json = json_decode($stream);
            $stream->close();

            if (JSON_ERROR_NONE !== json_last_error()) {
                call_user_func($callback, new InvalidArgumentException('json_decode error: ' . json_last_error_msg()), null);
            }
            if (is_array($json)) {
                // batch results
                $results = [];
                $errors = [];

                foreach ($json as $result) {
                    if (property_exists($result,'result')) {
                        $results[] = $result->result;
                    } else {
                        if (isset($json->error)) {
                            $error = $json->error;
                            $errors[] = new RPCException(mb_ereg_replace('Error: ', '', $error->message), $error->code);
                        } else {
                            $results[] = null;
                        }
                    }
                }
                if (count($errors) > 0) {
                    call_user_func($callback, $errors, $results);
                } else {
                    call_user_func($callback, null, $results);
                }
            } elseif (property_exists($json,'result')) {
                call_user_func($callback, null, $json->result);
            } else {
                if (isset($json->error)) {
                    $error = $json->error;

                    call_user_func($callback, new RPCException(mb_ereg_replace('Error: ', '', $error->message), $error->code), null);
                } else {
                    call_user_func($callback, new RPCException('Something wrong happened.'), null);
                }
            }
        } catch (RequestException $err) {
            call_user_func($callback, $err, null);
        }
    }
158833
public function withPayload(string $payload, bool $isPayloadDetached = false): self
    {
        if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
            throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
        }
        $clone = clone $this;
        $clone->payload = $payload;
        $clone->isPayloadDetached = $isPayloadDetached;

        return $clone;
    }
1181324
function put($id, $payload)
    {
        $this->requestDecorator->setId($id);
        $this->requestDecorator->setPayload($payload);
        if ((is_array($payload)) && (!empty($payload['sys']['version']))) {
            $this->requestDecorator->addHeader('X-Contentful-Version', $payload['sys']['version']);
        }
        $result = $this->client->put($this->requestDecorator->makeResource(), $this->requestDecorator->makePayload(), $this->requestDecorator->makeHeaders());
        $this->refresh();
        return $result;
    }
986290
protected function withCreatePayloadHooks($queue, array $payload)
    {
        if (! empty(static::$createPayloadCallbacks)) {
            foreach (static::$createPayloadCallbacks as $callback) {
                $payload = array_merge($payload, call_user_func(
                    $callback, $this->getConnectionName(), $queue, $payload
                ));
            }
        }

        return $payload;
    }
901983
protected function validateSynchronizerToken(array $payload=null)
    {
        if ($this->configuration->get('csrf_protection')) {
            if (!is_null($payload) && isset($payload[$this->configuration->get('csrf_parameter')])) {

                $this->logger->debug('validate synchronizer token', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                $token = $payload[$this->configuration->get('csrf_parameter')];

                if ($this->synchronizerToken->validate($this->getName(), $token)) {
                    $this->logger->debug('valid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                    return true;
                } else {
                    $this->logger->debug('invalid synchronizer token given', array('name' => $this->getName(), 'token' => $payload[$this->configuration->get('csrf_parameter')]));
                }
            } else {
                $this->logger->debug('no valid synchronizer token given', array('name' => $this->getName()));
            }
            return false;
        } else {
            $this->logger->debug('skip synchronizer token validation', array('name' => $this->getName()));
        }
        return true;
    }
273448
public function addPayload(callable $payload, $isAReturningVal, $isATraversable = false)
    {
        $node = PayloadNodeFactory::create($payload, $isAReturningVal, $isATraversable);

        $this->add($node);

        return $this;
    }
1024281
protected function buildRefreshClaims(Payload $payload)
    {
        // assign the payload values as variables for use later
        extract($payload->toArray());

        // persist the relevant claims
        return array_merge(
            $this->customClaims,
            compact($this->persistentClaims, 'sub', 'iat')
        );
    }
161792
protected function verifyGroup(&$payload){
        
        // 消息格式如果错误不继续.
        if(!$this->verifyMessage($payload)){
            // 错误信息应有verifyMessage中生成.
            
            return false;
        }
            
        // 没有type,认为是push/tags的简单调用方式, 需要将type置为1
        $payload['type'] = array_key_exists('type', $payload) ? $payload['type'] : 1;
        
        if($payload['type']  === 1){
            // 必须要求有tag.
            if(!array_key_exists('tag', $payload)){
                $this->onError(null,3,'SDK params invalid, [tag] is required,  when the [type] not 2 ~ 6');
                return false;
            }
        }
        // type不等于1, 必须有selector
        else if(array_key_exists('selector', $payload)){             

            if(is_array($payload['selector'])){
                $payload['selector'] = json_encode($payload['selector']);
            }
            
        }
        // 其它情况,直接认为错误.
        else{
            $this->onError(null,3,'SDK params invalid, [selector] is required,  when the [type] between 2 and 6');
            return false;
        }
        
        return true;
    }
365772
public function create(string $payload, array $signatures, string $jws_serialization_mode, array $jweSharedProtectedHeader, array $jweSharedHeader, array $recipients, string $jwe_serialization_mode, ?string $aad = null): string
    {
        $jws = $this->jwsBuilder->create()->withPayload($payload);
        foreach ($signatures as $signature) {
            if (!\is_array($signature) || !\array_key_exists('key', $signature)) {
                throw new \InvalidArgumentException('The signatures must be an array of arrays containing a key, a protected header and a header');
            }
            $signature['protected_header'] = \array_key_exists('protected_header', $signature) ? $signature['protected_header'] : [];
            $signature['header'] = \array_key_exists('header', $signature) ? $signature['header'] : [];
            $jws = $jws->addSignature($signature['key'], $signature['protected_header'], $signature['header']);
        }
        $jws = $jws->build();
        $token = $this->jwsSerializerManager->serialize($jws_serialization_mode, $jws);

        $jweSharedProtectedHeader['cty'] = 'JWT';

        $jwe = $this->jweBuilder
            ->create()
            ->withPayload($token)
            ->withSharedProtectedHeader($jweSharedProtectedHeader)
            ->withSharedHeader($jweSharedHeader)
            ->withAAD($aad);
        foreach ($recipients as $recipient) {
            if (!\is_array($recipient) || !\array_key_exists('key', $recipient)) {
                throw new \InvalidArgumentException('The recipients must be an array of arrays containing a key and a header');
            }
            $recipient['header'] = \array_key_exists('header', $recipient) ? $recipient['header'] : [];
            $jwe = $jwe->addRecipient($recipient['key'], $recipient['header']);
        }
        $jwe = $jwe->build();
        $token = $this->jweSerializerManager->serialize($jwe_serialization_mode, $jwe);

        return $token;
    }
1113513
protected function validateTimestamps(array $payload)
    {
        if (isset($payload['nbf']) && Utils::timestamp($payload['nbf'])->isFuture()) {
            throw new TokenInvalidException('Not Before (nbf) timestamp cannot be in the future', 400);
        }

        if (isset($payload['iat']) && Utils::timestamp($payload['iat'])->isFuture()) {
            throw new TokenInvalidException('Issued At (iat) timestamp cannot be in the future', 400);
        }

        if (Utils::timestamp($payload['exp'])->isPast()) {
            throw new TokenExpiredException('Token has expired');
        }

        return true;
    }