Merge branch '1.9.x' into feat-ser-401-custom-triggers

This commit is contained in:
Harsh Mahajan
2026-05-19 12:35:41 +05:30
committed by GitHub
5 changed files with 41 additions and 4 deletions
@@ -36,7 +36,7 @@ class Get extends Action
group: 'insights',
name: 'getInsight',
description: '/docs/references/advisor/get-insight.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
auth: [AuthType::ADMIN, AuthType::KEY],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -42,7 +42,7 @@ class XList extends Action
group: 'insights',
name: 'listInsights',
description: '/docs/references/advisor/list-insights.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
auth: [AuthType::ADMIN, AuthType::KEY],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -37,7 +37,7 @@ class Get extends Action
group: 'reports',
name: 'getReport',
description: '/docs/references/advisor/get-report.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
auth: [AuthType::ADMIN, AuthType::KEY],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
@@ -41,7 +41,7 @@ class XList extends Action
group: 'reports',
name: 'listReports',
description: '/docs/references/advisor/list-reports.md',
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
auth: [AuthType::ADMIN, AuthType::KEY],
responses: [
new SDKResponse(
code: Response::STATUS_CODE_OK,
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Tests\Unit\Advisor;
use Appwrite\Platform\Modules\Advisor\Http\Insights\Get as GetInsight;
use Appwrite\Platform\Modules\Advisor\Http\Insights\XList as ListInsights;
use Appwrite\Platform\Modules\Advisor\Http\Reports\Delete as DeleteReport;
use Appwrite\Platform\Modules\Advisor\Http\Reports\Get as GetReport;
use Appwrite\Platform\Modules\Advisor\Http\Reports\XList as ListReports;
use Appwrite\SDK\AuthType;
use Appwrite\SDK\Method;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Utopia\Platform\Action;
class AuthTest extends TestCase
{
#[DataProvider('advisorActionsProvider')]
public function testAdvisorApisOnlySupportAdminAndKeyAuth(Action $action): void
{
/** @var Method $method */
$method = $action->getLabels()['sdk'];
$this->assertSame([AuthType::ADMIN, AuthType::KEY], $method->getAuth());
}
public static function advisorActionsProvider(): array
{
return [
'get report' => [new GetReport()],
'list reports' => [new ListReports()],
'delete report' => [new DeleteReport()],
'get insight' => [new GetInsight()],
'list insights' => [new ListInsights()],
];
}
}