Returns a list of field names that should be set in a newly inserted token.

Adds the fields without default new in 2.00

@param \Gems_Tracker_Token $token
@return array Of fieldname => value type
497677
protected function _fillAttributeMap(\Gems_Tracker_Token $token)
    {
        $values = parent::_fillAttributeMap($token);

        return self::addnewAttributeDefaults($values);
    }
163607
private function verify(string $token): array
    {
        $jsonConverter = new StandardConverter();
        $serializer = new JWSCompactSerializer($jsonConverter);
        $jws = $serializer->unserialize($token);
        $this->signatureHeaderCheckerManager->check($jws, 0);
        if (false === $this->jwsLoader->verifyWithKeySet($jws, $this->signatureKeyset, 0)) {
            throw new JWTDecodeFailureException('decoding_error', 'An error occurred while trying to verify the JWT token.');
        }
        $payload = $jsonConverter->decode($jws->getPayload());
        $this->claimCheckerManager->check($payload);

        return $payload;
    }
1332253
public function getField($field, $token = null)
    {
        $session = $this->app->tokens->get($token);
        return ($session && isset($session[$field]))? $session[$field] : null;
    }
1109431
public function processTokenData(\Gems_Tracker_Token $token)
    {
        if ($token->getReceptionCode()->isSuccess() && $token->isCompleted()) {
            $respTrack = $token->getRespondentTrack();
            $fields    = $respTrack->getCodeFields();
            $answers   = $token->getRawAnswers();
            $newFields = [];

            foreach ($fields as $code => $value) {
                if (isset($answers[$code]) && ($answers[$code] != $value)) {
                    $newFields[$code] = $answers[$code];
                }
            }

            if ($newFields) {
                // \MUtil_Echo::track($answers, $newFields);
                $respTrack->setFieldData($newFields);
            }
        }

        return false;
    }
1337651
protected function _fillAttributeMap(\Gems_Tracker_Token $token)
    {
        $values[$this->_attributeMap['respondentid']]   =
                substr($token->getRespondentId(), 0, $this->attributeSize);
        $values[$this->_attributeMap['organizationid']] =
                substr($token->getOrganizationId(), 0, $this->attributeSize);
        $values[$this->_attributeMap['consentcode']]    =
                substr($token->getConsentCode(), 0, $this->attributeSize);
        $values[$this->_attributeMap['resptrackid']]    =
                substr($token->getRespondentTrackId(), 0, $this->attributeSize);

        return $values;
    }
289147
public function getTransactionResult($token)
    {
        $transactionResult = new TransactionResult();
        $transactionResult->tokenInput = $token;

        return $this->callSoapMethod('getTransactionResult', $transactionResult);
    }
612950
public function getTokens($refresh = false)
    {
        if (! $this->_tokens || $refresh) {
            if ($refresh) {
                $this->_firstToken = null;
            }
            $this->_tokens       = array();
            $this->_activeTokens = array();
            $tokenSelect = $this->tracker->getTokenSelect();
            $tokenSelect->andReceptionCodes()
                ->forRespondentTrack($this->_respTrackId);

            $tokenRows = $tokenSelect->fetchAll();
            $prevToken = null;
            foreach ($tokenRows as $tokenData) {

                $token = $this->tracker->getToken($tokenData);

                $this->_tokens[$token->getTokenId()] = $token;

                // While we are busy, set this
                if ($token->hasSuccesCode()) {
                    $this->_activeTokens[$token->getRoundId()] = $token;
                }

                // Link the tokens
                if ($prevToken) {
                    $prevToken->setNextToken($token);
                }
                $prevToken = $token;
            }
        }

        return $this->_tokens;
    }
1123612
protected function getItemName($token)
    {
        $name = $this->prefixKey($token);

        if ($this->isItemNameValid($name)) {
            return $name;
        }

        return false;
    }
86410
private function parseTokens(array $tokens)
    {
        return array_map(function ($token, $key) {
            return ['name' => $key, 'value' => $token];
        }, $tokens, array_keys($tokens));
    }
1227085
public function setNextToken(\Gems_Tracker_Token $token)
    {
        $this->_nextToken = $token;

        $token->_previousToken = $this;

        return $this;
    }
1136121
public function generateTokenValues(TokenInterface $token): array
    {
        $tokenValue     = bin2hex(random_bytes(16)) . uniqid();
        $tokenType      = 'bearer';
        $tokenExpiresIn = $this->getTokenExpirationPeriod();
        $refreshValue   = bin2hex(random_bytes(16)) . uniqid();

        assert(is_string($tokenValue) === true && empty($tokenValue) === false);
        assert(is_string($tokenType) === true && empty($tokenType) === false);
        assert(is_int($tokenExpiresIn) === true && $tokenExpiresIn > 0);
        assert($refreshValue === null || (is_string($refreshValue) === true && empty($refreshValue) === false));

        return [$tokenValue, $tokenType, $tokenExpiresIn, $refreshValue];
    }
1105950
public function processTokenData(\Gems_Tracker_Token $token)
    {
        $result = var_export($token->getRawAnswers(), true);
        \MUtil_Echo::r($result, $token->getTokenId());
        return false;
    }
209470
public function getToken()
    {
        static $token;

        if ($token instanceof \Gems_Tracker_Token) {
            return $token;
        }

        $token   = null;
        $tokenId = $this->getTokenId();

        if ($tokenId) {
            $token = $this->loader->getTracker()->getToken($tokenId);
        }
        if ($token && $token->exists) {
            // Set variables for the menu
            $token->applyToMenuSource($this->menu->getParameterSource());

            return $token;
        }

        throw new \Gems_Exception($this->_('No existing token specified!'));
    }
1360686
protected function parseToken($token)
    {
        [$id, $content] = $token;

        if ($id == T_INLINE_HTML) {
            foreach ($this->compilers as $type) {
                $content = $this->{"compile{$type}"}($content);
            }
        }

        return $content;
    }
364504
public function actionIndex($token)
    {
        if (empty(Yii::$app->remoteToken) || sha1(Yii::$app->remoteToken) !== $token) {
            throw new Exception('The provided remote token is wrong.');
        }
        
        UserOnline::clearList($this->module->userIdleTimeout);

        return [
            'yii_version' => Yii::getVersion(),
            'luya_version' => Boot::VERSION,
            'app_title' => Yii::$app->siteTitle,
            'app_debug' => (int) YII_DEBUG,
            'app_env' => YII_ENV,
            'app_transfer_exceptions' => (int) Yii::$app->errorHandler->transferException,
            'admin_online_count' => UserOnline::find()->count(),
            'app_elapsed_time' => Yii::getLogger()->getElapsedTime(),
            'packages' => Yii::$app->getPackageInstaller()->getConfigs(),
            'packages_update_timestamp' => Yii::$app->getPackageInstaller()->getTimestamp(),
        ];
    }
222660
public function getAllowedMethods($token) {
        $token = (string)$token;
        $array = (isset($this->config['tokens'][$token]))?$this->config['tokens'][$token]:array();
        $allowed = array_merge_recursive(
            $this->config['tokens']['*'],
            $array
        );
        $allowed = array_change_key_case($allowed);
        array_walk_recursive($allowed,function(&$value,$key){$value=mb_strtolower($value);});
        return $allowed;
    }
859191
public static function getTokenName($token)
    {
        if (is_int($token[self::T_KEY])) {
            return token_name($token[self::T_KEY]);
        } else {
            return $token[self::T_KEY];
        }
    }