Skip to content

Commit 6c51982

Browse files
authored
Use Bearer token instead of token_auth, #PG-5027 (#24)
* Changed to bearer token for better security practices * remove token auth urls in response descriptions * Updated changelog
1 parent dd13be5 commit 6c51982

3 files changed

Lines changed: 5 additions & 15 deletions

File tree

Annotations/AnnotationGenerator.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,17 +1239,7 @@ protected function determineResponses(array $rules, string $plugin, string $meth
12391239
$successArray['schema'] = $responseSchema;
12401240
}
12411241

1242-
$tsvExampleLink = 'TSV (N/A)';
1243-
if (count($mediaTypes) > 2) {
1244-
$tsvExampleLink = "[TSV (Excel)]({$exampleUrls['tsv']})";
1245-
}
1246-
$descriptionLinks = empty($exampleUrls) ? '' : "[XML]({$exampleUrls['xml']}), [JSON]({$exampleUrls['json']}), $tsvExampleLink";
1247-
$descriptionLinks = !empty($descriptionLinks) ? 'Example links: ' . $descriptionLinks : $descriptionLinks;
1248-
1249-
// Append the links to the description with a prefix linebreak. If there's no description, skip the break
1250-
$successArray['description'] .= (!empty($successArray['description']) && !empty($descriptionLinks) ? '</br>' : '') . $descriptionLinks;
1251-
1252-
if (empty($successArray['ref']) && empty($descriptionLinks) && empty($successArray['schema'])) {
1242+
if (empty($successArray['ref']) && empty($successArray['schema'])) {
12531243
$this->addMissingImportantDataWarning($method, 'return', 'Type could not be determined via comment block or example.');
12541244
}
12551245

Annotations/GlobalApiComponents.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
*
3535
* @OA\SecurityScheme(
3636
* securityScheme="MatomoToken",
37-
* type="apiKey",
38-
* in="query",
39-
* name="token_auth",
40-
* description="Matomo API token passed as the 'token_auth' query parameter."
37+
* type="http",
38+
* scheme="bearer",
39+
* description="Matomo API token passed in the Authorization header as a bearer token. For demo.matomo.cloud requests, use the anonymous token value: anonymous."
4140
* )
4241
*
4342
* @OA\Server(

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Added support for string literal union types
55
- Added API endpoint to retrieve static matomo swagger file
66
- Added support for deactivated plugins
7+
- Removed token auth support
78

89
5.0.1-b1 - 2026-02-16
910
- Added class and function level docs

0 commit comments

Comments
 (0)