Home
last modified time | relevance | path

Searched full:token (Results 1 – 25 of 69) sorted by relevance

123

/dokuwiki/_test/tests/inc/
H A DJWTTest.php13 // no token file yet
17 // initialize a new token
21 $token = $jwt->getToken();
24 // validate the token
25 $jwt = JWT::validate($token);
30 // next access should get the same token
32 $this->assertEquals($token, $jwt->getToken());
35 // saving should create a new token
38 $this->assertNotEquals($token, $jwt->getToken());
52 $token = $jwt->getToken();
[all …]
/dokuwiki/inc/Search/Collection/
H A DDirectCollection.php11 * Abstract collection for direct 1:1 entity-token mappings
13 * In a direct collection each entity has exactly one token stored at the entity's position
14 * in the token index (entity.RID === token.RID). No frequency or reverse indexes are used.
34 "Entity count ($ec) != token count ($tc)"
41 * Store a single token for the given entity
43 * Takes the first token from the list and writes it directly at the entity's position
44 * in the token index. An empty list stores an empty string.
62 $token = $tokens[0] ?? ''; variable in dokuwiki\\Search\\Collection\\DirectCollection
64 $tokenIndex->changeRow($entityId, $token);
71 * Get the token stored for the given entity
[all …]
H A DAbstractCollection.php21 * Every collection works with four index types: entity, token, frequency, and reverse.
24 * token - the list of tokens (eg. words) assigned to entities (can be split into multiple files)
25 * frequency - how often a token appears on a entity (can be split into multiple files)
43 * Entity and token indexes can be passed as already instantiated AbstractIndex objects
50 * @param bool $splitByLength Whether to split token/frequency indexes by token length
61 … throw new IndexUsageException('Cannot split by length when using a pre-instantiated token index');
140 * @param int $group Index group (0 for non-split, token length for split)
153 * @param int $group Index group (0 for non-split, token length for split)
172 * Whether this collection splits token/frequency indexes by token length
203 * Resolve token IDs to entity frequencies
[all …]
H A DCollectionSearch.php25 /** @var ?int the maximum token index suffix as currently indexed */
94 * For each index group, scans the token index once testing all terms, then resolves
97 * each Term is populated with the final results: entity name → token name → frequency.
110 // single-pass token scan for all terms in this group
111 $tokenMatches = []; // [tokenId => [{term, token}, ...]]
116 $tokenMatches[$tokenId][] = ['term' => $term, 'token' => $tokenValue];
147 $match['term']->addMatch($entityName, $match['token'], $freq);
H A DFrequencyCollection.php8 …* In a frequency collection the same token can appear multiple times per entity. The frequency of …
9 * token per entity is tracked.
H A DTerm.php70 * The fulltext token index is already lowercased by the Tokenizer, so this is only
127 * Check if a token value matches this term
131 * When caseInsensitive() is set, the token value is lowercased before comparison.
155 * Record that a token matched an entity with a given frequency
157 * When called multiple times for the same entity/token pair, frequencies are summed.
198 * Return the matched token names per entity
208 * Return all unique matched token values
/dokuwiki/inc/
H A DJWT.php39 * Create a new instance from a token
41 * @param $token
45 public static function validate($token) argument
47 [$header, $payload, $signature] = sexplode('.', $token, 3, '');
84 if (file_get_contents($file) !== $token) {
94 * Loads an existing token if available
110 $token = new self($user, time());
111 $token->save();
112 return $token;
117 * Get the JWT token for this instance
[all …]
/dokuwiki/_test/tests/lib/exe/
H A Dfetch_imagetoken.test.php35 return '/lib/exe/fetch.php?'.$w.$h.'{%token%}media='.$this->media;
38 function fetchResponse($token){ argument
40 return $request->get(array(),str_replace('{%token%}',$token,$this->getUri()));
44 * modified image request with valid token
60 * fit=1 does not affect token validation; token is hashed over (id, w, h)
61 * only, so an existing token must still pass when the request adds fit=1.
72 * modified image request with invalid token
81 * modified image request with no token
90 * native image request which doesn't require a token
91 * try: with a token & without a token
[all …]
H A Dfetch_statuscodes_external.test.php34 return '/lib/exe/fetch.php?'.$w.$h.'{%token%}media='.rawurlencode($this->media);
37 function fetchResponse($token) { argument
39 return $request->get(array(), str_replace('{%token%}', $token, $this->getUri()));
43 * modified image request with valid token
44 * and not-modified image request with valid token
78 * modified image request with invalid token
94 * modified image request with no token
95 * and not modified image with no token
/dokuwiki/inc/Search/Query/
H A DQueryParser.php136 foreach ($tokens as $token) {
137 if ($token === '(') {
141 } elseif ($token === '-(') {
145 } elseif ($token === ')') {
150 } elseif ($token === 'and') {
152 } elseif ($token === 'or') {
155 } elseif (preg_match('/^(?:\^|-ns:)(.+)$/u', $token, $matches)) {
158 } elseif (preg_match('/^(?:@|ns:)(.+)$/u', $token, $matches)) {
161 } elseif (preg_match('/^-(.+)$/', $token, $matches)) {
166 $parsed .= $this->termParser($token);
[all …]
H A DQueryEvaluator.php20 /** @var string[] RPN token array from QueryParser */
30 * @param string[] $rpn RPN token array from QueryParser::convert()['parsed_ary']
47 * Evaluation uses a stack. Each token is processed left to right: operand tokens
66 foreach ($this->rpn as $token) {
67 switch (substr($token, 0, 3)) {
71 $word = substr($token, 3);
79 $phrase = substr($token, 3);
89 $ns = cleanID(substr($token, 3)) . ':';
/dokuwiki/_test/tests/Search/Collection/
H A DMockDirectCollection.php13 public function __construct($entity = 'entity', $token = 'token') argument
15 parent::__construct($entity, $token);
H A DMockLookupCollection.php13 …public function __construct($entity = 'entity', $token = 'token', $freq = 'freq', $reverse = 'reve… argument
15 parent::__construct($entity, $token, $freq, $reverse);
H A DMockFrequencyCollection.php13 …public function __construct($entity = 'entity', $token = 'token', $freq = 'freq', $reverse = 'reve… argument
15 parent::__construct($entity, $token, $freq, $reverse, true);
H A DDirectCollectionTest.php13 * Add a token and verify it's stored at the entity's position
30 * Updating an entity should overwrite the previous token
49 * Empty token list should store empty string
103 * resolveTokenFrequencies maps token RID = entity RID with frequency 1
162 * checkIntegrity detects entity/token line count mismatch
172 // corrupt: add extra line to token index
H A DFrequencyCollectionTest.php16 $index = new MockFrequencyCollection('entity', 'token', 'freq', 'reverse');
26 $idxToken = new MemoryIndex('token', '3');
64 * resolveTokens should count frequencies and group by token length
79 // token IDs are sequential: one=0, two=1, three=0 (in its own length group)
134 // token index (5-char group): alpha=0, gamma=1
139 // token index (4-char group): beta=0
143 // frequency index: beta (token 0 in 4-char group) is on both entities
149 // frequency index: alpha (token 0 in 5-char group) only on page1
235 * checkIntegrity detects missing token index for a group
246 // delete the token index for the shortest group (not the max)
H A DLookupCollectionTest.php26 // check token index (single file, no suffix)
115 * Adding empty token list should clear entity from indexes
131 // frequency index should be empty for this token
195 // token IDs are sequential: logo=0, banner=1
248 * resolveTokenFrequencies returns entity frequencies for given token IDs
258 // token ID 0 = wiki:syntax, referenced by both entities
261 $this->assertCount(2, $result[0]); // two entities have this token
289 * checkIntegrity detects token/frequency mismatch on non-split collection
299 // corrupt: add extra line to token index
325 * checkIntegrity detects missing frequency index when token index exists
/dokuwiki/inc/Action/
H A DResendpwd.php59 * - validating the password reset auth token
80 $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
82 if ($token) {
83 // we're in token phase - get user info from token
85 $tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth';
91 // token is only valid for 3 days
155 // generate auth token
156 $token = md5(auth_randombytes(16)); // random secret
157 $tfile = $conf['cachedir'] . '/' . $token[0] . '/' . $token . '.pwauth';
158 $url = wl('', ['do' => 'resendpwd', 'pwauth' => $token], true, '&');
H A DAuthtoken.php30 $token = JWT::fromUser($INPUT->server->str('REMOTE_USER'));
31 $token->save();
/dokuwiki/inc/Ui/
H A DUserResendPwd.php27 $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
33 if (!$conf['autopasswd'] && $token) {
34 $form = $this->formSetNewPassword($token);
47 * @params string $token cleaned pwauth request variable
50 protected function formSetNewPassword($token) argument
58 $form->setHiddenField('token', $token);
/dokuwiki/inc/Remote/OpenApiDoc/
H A DClassResolver.php110 foreach ($tokens as $token) {
111 if (!is_array($token)) {
123 $tokenname = token_name($token[0]);
125 if ($token[0] === T_CLASS) {
129 if ($token[0] === T_USE) {
134 if ($token[0] === T_AS) {
140 switch ($token[0]) {
144 $currentUse[$record] .= $token[1];
/dokuwiki/inc/Search/
H A DTokenizer.php11 // set the minimum token length to use in the index
23 /** @var int $MinWordLength minimum token length */
55 // set the minimum token length to use in the index
141 * @param string $token
146 public static function tokenLength(string $token): int argument
148 $length = strlen($token);
150 if (preg_match_all('/[\xE2-\xEF]/', $token, $leadbytes)) {
/dokuwiki/inc/Parsing/Lexer/
H A DLexer.php54 * Adds a token search pattern for a particular parsing mode.
107 * parser handler for this token only.
111 * @param string $special Use this mode for this one token.
136 * unparsed and parsed token invokes a call to the held listener.
179 * Sends the matched token and any leading unmatched
184 * @param string $matched Actual token match.
228 … * Test to see if the mode is one where this mode is entered for this token only and automatically
240 * Strips the magic underscore marking single token modes.
251 * Dispatches a token to the handler.
257 * @param boolean $is_match Token is recognised rather
[all …]
/dokuwiki/_test/tests/Search/
H A DIntegrityTest.php64 * Corrupted fulltext index (token/frequency mismatch) should throw
71 // Append an extra line to a token index to create a mismatch
101 * Corrupted title index (entity/token mismatch) should throw
/dokuwiki/inc/Parsing/
H A DHandler.php17 * The Handler receives token events from the Lexer and turns them into
38 /** @var string the original (pre-remap) mode name for the current token */
50 * Register a mode object for token dispatch.
63 * Get the original mode name for the current token.
77 * Dispatch a token to the appropriate handler.
79 * This is the single entry point called by the Lexer for every token.

123