Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed May 26, 2025
1 parent a6c77a2 commit deac87c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/plugins/CoreServer/resources/locales/en_US/core_server.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'
Expand All @@ -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'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* COmanage Registry Grand Types Enum
* COmanage Registry GrandTypes Enum
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand Down Expand Up @@ -31,7 +31,7 @@

use App\Lib\Enum\StandardEnum;

class Oauth2GrandTypesEnum extends StandardEnum
class GrandTypesEnum extends StandardEnum
{
const AuthorizationCode = 'AC';
const ClientCredentials = 'CC';
Expand Down
6 changes: 3 additions & 3 deletions app/plugins/CoreServer/src/Model/Table/Oauth2ServersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

use Cake\Routing\Router;
use Cake\Validation\Validator;
use CoreServer\Lib\Enum\Oauth2GrandTypesEnum;
use CoreServer\Lib\Enum\GrandTypesEnum;

class Oauth2ServersTable extends HttpServersTable {
use \App\Lib\Traits\PrimaryLinkTrait;
Expand Down Expand Up @@ -66,7 +66,7 @@ public function initialize(array $config): void {
$this->setAutoViewVars([
'types' => [
'type' => 'enum',
'class' => 'CoreServer.Oauth2GrandTypesEnum'
'class' => 'CoreServer.GrandTypesEnum'
]
]);

Expand Down Expand Up @@ -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');

Expand Down

0 comments on commit deac87c

Please sign in to comment.