From 1c11c66b9cbcf1d804c9277756266cf9c507b7d5 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 24 Dec 2024 01:20:58 +0100 Subject: [PATCH] Rename device code endpoint to /devicecode --- api/modules/oauth/controllers/AuthorizationController.php | 2 +- api/tests/functional/oauth/DeviceCodeCest.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/modules/oauth/controllers/AuthorizationController.php b/api/modules/oauth/controllers/AuthorizationController.php index 9b5c986..293a6ef 100644 --- a/api/modules/oauth/controllers/AuthorizationController.php +++ b/api/modules/oauth/controllers/AuthorizationController.php @@ -63,7 +63,7 @@ final class AuthorizationController extends Controller { return $this->oauthProcess->complete($this->getServerRequest()); } - public function actionDevice(): array { + public function actionDevicecode(): array { return $this->oauthProcess->deviceCode($this->getServerRequest()); } diff --git a/api/tests/functional/oauth/DeviceCodeCest.php b/api/tests/functional/oauth/DeviceCodeCest.php index 35410cd..500c765 100644 --- a/api/tests/functional/oauth/DeviceCodeCest.php +++ b/api/tests/functional/oauth/DeviceCodeCest.php @@ -10,7 +10,7 @@ use Codeception\Example; final class DeviceCodeCest { public function initiateFlow(FunctionalTester $I): void { - $I->sendPOST('/api/oauth2/v1/device', [ + $I->sendPOST('/api/oauth2/v1/devicecode', [ 'client_id' => 'ely', 'scope' => 'account_info minecraft_server_session', ]); @@ -56,7 +56,7 @@ final class DeviceCodeCest { #[Examples(false)] public function finishFlowWithApprovedCode(FunctionalTester $I, Example $case): void { // Initialize flow - $I->sendPOST('/api/oauth2/v1/device', [ + $I->sendPOST('/api/oauth2/v1/devicecode', [ 'client_id' => 'ely', 'scope' => 'account_info minecraft_server_session', ]); @@ -95,7 +95,7 @@ final class DeviceCodeCest { } public function getAnErrorForUnknownClient(FunctionalTester $I): void { - $I->sendPOST('/api/oauth2/v1/device', [ + $I->sendPOST('/api/oauth2/v1/devicecode', [ 'client_id' => 'invalid-client', 'scope' => 'account_info minecraft_server_session', ]); @@ -106,7 +106,7 @@ final class DeviceCodeCest { } public function getAnErrorForInvalidScopes(FunctionalTester $I): void { - $I->sendPOST('/api/oauth2/v1/device', [ + $I->sendPOST('/api/oauth2/v1/devicecode', [ 'client_id' => 'ely', 'scope' => 'unknown-scope', ]);