Skip to content

Commit 7b97e2e

Browse files
committed
CABPI-465:Add new Default Role for imported Users with no Permissions by default Merged with 2.4-develop with latest changes of IMS
2 parents 672d90e + bcb0fea commit 7b97e2e

File tree

385 files changed

+9705
-128770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+9705
-128770
lines changed

app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Api\Data;

app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiSearchResultsInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Api\Data;

app/code/Magento/AdminAdobeIms/Api/ImsLogOutInterface.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

app/code/Magento/AdminAdobeIms/Api/ImsWebapiRepositoryInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Api;

app/code/Magento/AdminAdobeIms/App/Action/Plugin/Authentication.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\App\Action\Plugin;

app/code/Magento/AdminAdobeIms/Block/Adminhtml/System/Config/Form/Field/Disabled.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Block\Adminhtml\System\Config\Form\Field;

app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsDisableCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Console\Command;

app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsEnableCommand.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Console\Command;
109

11-
use Magento\AdminAdobeIms\Model\ImsConnection;
1210
use Magento\AdminAdobeIms\Service\ImsCommandOptionService;
1311
use Magento\AdminAdobeIms\Service\ImsConfig;
1412
use Magento\AdminAdobeIms\Service\UpdateTokensService;
13+
use Magento\AdobeImsApi\Api\AuthorizationInterface;
1514
use Magento\Authorization\Model\Acl\Role\Group;
1615
use Magento\Authorization\Model\ResourceModel\Role\CollectionFactory;
1716
use Magento\Authorization\Model\Role;
@@ -58,11 +57,6 @@ class AdminAdobeImsEnableCommand extends Command
5857
*/
5958
private ImsConfig $adminImsConfig;
6059

61-
/**
62-
* @var ImsConnection
63-
*/
64-
private ImsConnection $adminImsConnection;
65-
6660
/**
6761
* @var ImsCommandOptionService
6862
*/
@@ -88,30 +82,35 @@ class AdminAdobeImsEnableCommand extends Command
8882
*/
8983
private CollectionFactory $roleCollection;
9084

85+
/**
86+
* @var AuthorizationInterface
87+
*/
88+
private AuthorizationInterface $authorization;
89+
9190
/**
9291
* @param ImsConfig $adminImsConfig
93-
* @param ImsConnection $adminImsConnection
9492
* @param ImsCommandOptionService $imsCommandOptionService
9593
* @param TypeListInterface $cacheTypeList
9694
* @param UpdateTokensService $updateTokensService
95+
* @param AuthorizationInterface $authorization
9796
* @param Role|null $role
9897
* @param CollectionFactory|null $roleCollection
9998
*/
10099
public function __construct(
101100
ImsConfig $adminImsConfig,
102-
ImsConnection $adminImsConnection,
103101
ImsCommandOptionService $imsCommandOptionService,
104102
TypeListInterface $cacheTypeList,
105103
UpdateTokensService $updateTokensService,
104+
AuthorizationInterface $authorization,
106105
Role $role = null,
107106
CollectionFactory $roleCollection = null
108107
) {
109108
parent::__construct();
110109
$this->adminImsConfig = $adminImsConfig;
111-
$this->adminImsConnection = $adminImsConnection;
112110
$this->imsCommandOptionService = $imsCommandOptionService;
113111
$this->cacheTypeList = $cacheTypeList;
114112
$this->updateTokensService = $updateTokensService;
113+
$this->authorization = $authorization;
115114
$this->role = $role ?: ObjectManager::getInstance()->get(Role::class);
116115
$this->roleCollection = $roleCollection ?: ObjectManager::getInstance()->get(CollectionFactory::class);
117116

@@ -242,7 +241,7 @@ private function enableModule(
242241
string $organizationId,
243242
bool $isTwoFactorAuthEnabled
244243
): bool {
245-
$testAuth = $this->adminImsConnection->testAuth($clientId);
244+
$testAuth = $this->authorization->testAuth($clientId);
246245
if ($testAuth) {
247246
$this->adminImsConfig->enableModule($clientId, $clientSecret, $organizationId, $isTwoFactorAuthEnabled);
248247
$this->cacheTypeList->cleanType(Config::TYPE_IDENTIFIER);

app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsInfoCommand.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Console\Command;
109

11-
use Magento\AdminAdobeIms\Model\ImsConnection;
1210
use Magento\AdminAdobeIms\Service\ImsConfig;
11+
use Magento\AdobeImsApi\Api\AuthorizationInterface;
1312
use Magento\Framework\Console\Cli;
1413
use Symfony\Component\Console\Command\Command;
1514
use Symfony\Component\Console\Input\InputInterface;
@@ -41,21 +40,21 @@ class AdminAdobeImsInfoCommand extends Command
4140
private ImsConfig $adminImsConfig;
4241

4342
/**
44-
* @var ImsConnection
43+
* @var AuthorizationInterface
4544
*/
46-
private ImsConnection $adminImsConnection;
45+
private AuthorizationInterface $authorization;
4746

4847
/**
4948
* @param ImsConfig $adminImsConfig
50-
* @param ImsConnection $adminImsConnection
49+
* @param AuthorizationInterface $authorization
5150
*/
5251
public function __construct(
5352
ImsConfig $adminImsConfig,
54-
ImsConnection $adminImsConnection
53+
AuthorizationInterface $authorization
5554
) {
5655
parent::__construct();
5756
$this->adminImsConfig = $adminImsConfig;
58-
$this->adminImsConnection = $adminImsConnection;
57+
$this->authorization = $authorization;
5958

6059
$this->setName('admin:adobe-ims:info')
6160
->setDescription('Information of Adobe IMS Module configuration');
@@ -69,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int
6968
try {
7069
if ($this->adminImsConfig->enabled()) {
7170
$clientId = $this->adminImsConfig->getApiKey();
72-
if ($this->adminImsConnection->testAuth($clientId)) {
71+
if ($this->authorization->testAuth($clientId)) {
7372
$clientSecret = $this->adminImsConfig->getPrivateKey() ? 'configured' : 'not configured';
7473
$output->writeln(self::CLIENT_ID_NAME . ': ' . $clientId);
7574
$output->writeln(self::ORGANIZATION_ID_NAME . ': ' . $this->adminImsConfig->getOrganizationId());

app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsStatusCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
namespace Magento\AdminAdobeIms\Console\Command;

0 commit comments

Comments
 (0)