diff --git a/app/plugins/CoreServer/resources/locales/en_US/core_server.po b/app/plugins/CoreServer/resources/locales/en_US/core_server.po index 94e0a81bf..1df288f30 100644 --- a/app/plugins/CoreServer/resources/locales/en_US/core_server.po +++ b/app/plugins/CoreServer/resources/locales/en_US/core_server.po @@ -49,10 +49,10 @@ msgstr "Bearer" msgid "enumeration.HttpAuthTypeEnum.X" msgstr "None" -msgid "enumeration.Oauth2GrandTypesEnum.AC" +msgid "enumeration.GrandTypesEnum.AC" msgstr "Authorization Code" -msgid "enumeration.Oauth2GrandTypesEnum.CC" +msgid "enumeration.GrandTypesEnum.CC" msgstr "Client Credentials" msgid "enumeration.RdbmsTypeEnum.LT" @@ -128,7 +128,7 @@ msgid "field.Oauth2Servers.url" msgstr "Server URL" msgid "field.Oauth2Servers.redirect_uri" -msgstr "Redirect URI" +msgstr "Redirect URI" msgid "field.Oauth2Servers.scope" msgstr "Scopes" diff --git a/app/plugins/CoreServer/src/Controller/Oauth2ServersController.php b/app/plugins/CoreServer/src/Controller/Oauth2ServersController.php index e5ab958f5..b0340a8a4 100644 --- a/app/plugins/CoreServer/src/Controller/Oauth2ServersController.php +++ b/app/plugins/CoreServer/src/Controller/Oauth2ServersController.php @@ -31,7 +31,7 @@ use App\Controller\StandardPluginController; use Cake\Event\EventInterface; -use CoreServer\Lib\Enum\Oauth2GrandTypesEnum; +use CoreServer\Lib\Enum\GrandTypesEnum; class Oauth2ServersController extends StandardPluginController { @@ -125,7 +125,7 @@ public function token($id): void try { switch($osrvr->access_grant_type) { - case Oauth2GrandTypesEnum::AuthorizationCode: + case GrandTypesEnum::AuthorizationCode: // Issue a redirect to the server $targetUrl = $osrvr->url . '/authorize?response_type=code' @@ -139,7 +139,7 @@ public function token($id): void $this->redirect($targetUrl); break; - case Oauth2GrandTypesEnum::ClientCredentials: + case GrandTypesEnum::ClientCredentials: // Make a direct call to the server $this->Oauth2Servers->obtainToken((int)$id, 'client_credentials'); $this->Flash->success(__d('core_server', 'info.Oauth2Servers.access_token.ok')); diff --git a/app/plugins/CoreServer/src/Lib/Enum/Oauth2GrandTypesEnum.php b/app/plugins/CoreServer/src/Lib/Enum/GrandTypesEnum.php similarity index 93% rename from app/plugins/CoreServer/src/Lib/Enum/Oauth2GrandTypesEnum.php rename to app/plugins/CoreServer/src/Lib/Enum/GrandTypesEnum.php index a82e51111..ee5f76a1e 100644 --- a/app/plugins/CoreServer/src/Lib/Enum/Oauth2GrandTypesEnum.php +++ b/app/plugins/CoreServer/src/Lib/Enum/GrandTypesEnum.php @@ -1,6 +1,6 @@ setAutoViewVars([ 'types' => [ 'type' => 'enum', - 'class' => 'CoreServer.Oauth2GrandTypesEnum' + 'class' => 'CoreServer.GrandTypesEnum' ] ]); @@ -236,7 +236,7 @@ public function validationDefault(Validator $validator): Validator { $validator->notEmptyString('server_id'); $validator->add('access_grant_type', [ - 'content' => ['rule' => ['inList', Oauth2GrandTypesEnum::getConstValues()]] + 'content' => ['rule' => ['inList', GrandTypesEnum::getConstValues()]] ]); $validator->notEmptyString('access_grant_type');