diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
index 4e82725a7fb0..c2e9fa9cef24 100644
--- a/.github/CODE_OF_CONDUCT.md
+++ b/.github/CODE_OF_CONDUCT.md
@@ -1,46 +1,80 @@
-# Contributor Covenant Code of Conduct
+# Magento Code of Conduct
## Our Pledge
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+We as members, contributors, and leaders pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
+
## Our Standards
-Examples of behavior that contributes to creating a positive environment include:
+Examples of behavior that contribute to a positive environment for our project and community include:
+
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+* Focusing on what is best, not just for us as individuals but for the overall community
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
+* The use of sexualized language or imagery and sexual attention or advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Publishing others’ private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
+
## Our Responsibilities
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+This Code of Conduct applies when an individual is representing the project or its community both within project spaces and in public spaces. Examples of representing a project or community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by first contacting the project team at engcom@adobe.com. Oversight of Adobe projects is handled by the Adobe Open Source Office, which has final say in any violations and enforcement of this Code of Conduct and can be reached at Grp-opensourceoffice@adobe.com. All complaints will be reviewed and investigated promptly and fairly.
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+The project team must respect the privacy and security of the reporter of any incident.
-## Attribution
+Project maintainers who do not follow or enforce the Code of Conduct may face temporary or permanent repercussions as determined by other members of the project's leadership or the Adobe Open Source Office.
+
+
+## Enforcement Guidelines
+
+Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem to be in violation of this Code of Conduct:
+
+### 1. Correction
+
+Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
+Consequence: A private, written warning from project maintainers describing the violation and why the behavior was unacceptable. A public apology may be requested from the violator before any further involvement in the project by violator.
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+### 2. Warning
+
+Community Impact: A relatively minor violation through a single incident or series of actions.
+
+Consequence: A written warning from project maintainers that includes stated consequences for continued unacceptable behavior. Violator must refrain from interacting with the people involved for a specified period of time as determined by the project maintainers, including, but not limited to, unsolicited interaction with those enforcing the Code of Conduct through channels such as community spaces and social media. Continued violations may lead to a temporary or permanent ban.
+
+### 3. Temporary Ban
+
+Community Impact: A more serious violation of community standards, including sustained unacceptable behavior.
+
+Consequence: A temporary ban from any interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Failure to comply with the temporary ban may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+Community Impact: Demonstrating a consistent pattern of violation of community standards or an egregious violation of community standards, including, but not limited to, sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
+
+Consequence: A permanent ban from any interaction with the community.
+
+
+## Attribution
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 61e14fd02b22..ec7ddb4085f2 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -15,7 +15,7 @@ For more detailed information on contribution please read our [beginners guide](
## Contribution requirements
-1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
+1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
@@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 development team, fork the
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3. Create and test your work.
-4. Follow the [Forks And Pull Requests Instructions](https://devdocs.magento.com/contributor-guide/contributing.html#forks-and-pull-requests) to fork the Magento 2 repository and send us a pull request.
+4. Follow the [Forks And Pull Requests Instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) to fork the Magento 2 repository and send us a pull request.
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
## Code of Conduct
diff --git a/.github/workflows/coding-standard-baseline.yml b/.github/workflows/coding-standard-baseline.yml
new file mode 100644
index 000000000000..cc7d9cfc61fe
--- /dev/null
+++ b/.github/workflows/coding-standard-baseline.yml
@@ -0,0 +1,14 @@
+name: Coding Standard With Baseline
+on:
+ pull_request:
+ branches:
+ - 2.4-develop
+permissions:
+ contents: read
+jobs:
+ coding-standard:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Run Coding Standard Baseline
+ uses: mage-os/github-actions/coding-standard-baseline@main
+
diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml
deleted file mode 100644
index 512b23f8bddd..000000000000
--- a/.github/workflows/coding-standard.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Coding Standard
-
-on:
- pull_request:
- branches:
- - 2.4-develop
-
-permissions:
- contents: read
-
-jobs:
- coding-standard:
- runs-on: ubuntu-latest
- steps:
- - name: Run Coding Standard
- uses: graycoreio/github-actions-magento2/coding-standard@main
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
new file mode 100644
index 000000000000..dd29dfcb9b02
--- /dev/null
+++ b/.github/workflows/unit-tests.yml
@@ -0,0 +1,13 @@
+name: Unit Tests
+run-name: ${{ github.actor }} is running Unit Tests
+on:
+ pull_request:
+ branches:
+ - 2.4-develop
+
+permissions:
+ contents: write
+
+jobs:
+ run-unit-tests:
+ uses: mage-os/infrastructure/.github/workflows/unit-tests.yml@main
diff --git a/README.md b/README.md
index 46c9fc128c00..a02a955a9ebb 100644
--- a/README.md
+++ b/README.md
@@ -15,10 +15,10 @@ However, for those who need a full-featured eCommerce solution, we recommend [Ad
## Get started
-- [Quick start install](https://devdocs.magento.com/guides/v2.4/install-gde/composer.html)
-- [System requirements](https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html)
-- [Prerequisites](https://devdocs.magento.com/guides/v2.4/install-gde/prereq/prereq-overview.html)
-- [More installation options](https://devdocs.magento.com/guides/v2.4/install-gde/bk-install-guide.html)
+- [Quick start install](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/composer.html)
+- [System requirements](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html)
+- [Prerequisites](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/prerequisites/overview.html)
+- [More installation options](https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/overview.html)
## Get help
@@ -26,20 +26,20 @@ However, for those who need a full-featured eCommerce solution, we recommend [Ad
## Contribute
-Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://devdocs.magento.com/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.
+Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://developer.adobe.com/commerce/docs/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.
-- [Contribute to the code](https://devdocs.magento.com/contributor-guide/contributing.html)
-- [Report an issue](https://devdocs.magento.com/contributor-guide/contributing.html#report)
+- [Contribute to the code](https://developer.adobe.com/commerce/contributor/guides/code-contributions/)
+- [Report an issue](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report)
- [Improve the developer documentation](https://github.com/magento/devdocs)
- [Improve the end-user documentation](https://github.com/magento/merchdocs)
- [Shape the future of Magento Open Source](https://developer.adobe.com/open/magento)
### Maintainers
-We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.
+We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.
-- [Learn more about the Maintainer role](https://devdocs.magento.com/contributor-guide/maintainers.html)
-- [Maintainer's Handbook](https://devdocs.magento.com/contributor-guide/maintainer-handbook.html)
+- [Learn more about the Maintainer role](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
+- [Maintainer's Handbook](https://developer.adobe.com/commerce/contributor/guides/maintainers/handbook/)
[![](https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png)](https://magento.com/magento-contributors#maintainers)
@@ -53,25 +53,25 @@ Adobe highly appreciates contributions that help us to improve the code, clarify
We use labels in the GitHub issues and pull requests to help the participants retrieve additional information such as progress, component assignments, or release lines.
-- [Labels applied by the Community Engineering team](https://devdocs.magento.com/contributor-guide/contributing.html#labels)
+- [Labels applied by the Community Engineering team](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#labels)
## Security
-[Security](https://devdocs.magento.com/guides/v2.4/architecture/security_intro.html) is one of the highest priorities at Adobe. To learn more about reporting security concerns, visit the [Adobe Bug Bounty Program](https://hackerone.com/adobe).
+[Security](https://developer.adobe.com/commerce/php/architecture/basics/security/) is one of the highest priorities at Adobe. To learn more about reporting security concerns, visit the [Adobe Bug Bounty Program](https://hackerone.com/adobe).
Stay up-to-date on the latest security news and patches by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).
## Licensing
Each Magento source file included in this distribution is licensed under OSL 3.0 or the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento).
-
+
[Open Software License (OSL 3.0)](https://opensource.org/licenses/osl-3.0.php) – Please see [LICENSE.txt](LICENSE.txt) for the full text of the OSL 3.0 license.
-
+
Subject to Licensee's/Customer's payment of fees and compliance with the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento), the terms and conditions of the applicable ordering between Licensee/Customer and Adobe (or Magento) supersede the OSL 3.0 license for each source file.
## Communications
-We are dedicated to our Community and encourage your contributions and welcome feedback through [events](https://www.adobe.io/open/magento/calendar), our [DevBlog](https://community.magento.com/t5/Magento-DevBlog/bg-p/devblog), Twitter and YouTube channels, and [other Community resources](https://devdocs.magento.com/community/resources.html).
+We are dedicated to our Community and encourage your contributions and welcome feedback through [events](https://www.adobe.io/open/magento/calendar), our [DevBlog](https://community.magento.com/t5/Magento-DevBlog/bg-p/devblog), Twitter and YouTube channels, and [other Community resources](https://developer.adobe.com/commerce/contributor/community/).
To connect with people from the Community and Adobe engineering, [join us in Slack](https://magentocommeng.slack.com). We have a channel for every project. To join a particular channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com), or [sign up](https://opensource.magento.com/slack).
diff --git a/app/bootstrap.php b/app/bootstrap.php
index 8fbe2f770f53..a7aea8094f81 100644
--- a/app/bootstrap.php
+++ b/app/bootstrap.php
@@ -17,12 +17,12 @@
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80100) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports PHP 8.1.0 or later. ' .
- 'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html';
+ 'Please read https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html';
} else {
echo <<
Magento supports PHP 8.1.0 or later. Please read
-
+
Magento System Requirements.
HTML;
diff --git a/app/code/Magento/AdminAdobeIms/.gitignore b/app/code/Magento/AdminAdobeIms/.gitignore
deleted file mode 100644
index c620230282e1..000000000000
--- a/app/code/Magento/AdminAdobeIms/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-view/adminhtml/web/node_modules/
diff --git a/app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiInterface.php b/app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiInterface.php
deleted file mode 100644
index e3c5d1120285..000000000000
--- a/app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiInterface.php
+++ /dev/null
@@ -1,144 +0,0 @@
-_openActions[] = ImsCallback::ACTION_NAME;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Block/Adminhtml/ImsReAuth.php b/app/code/Magento/AdminAdobeIms/Block/Adminhtml/ImsReAuth.php
deleted file mode 100644
index 7fd8a59c255d..000000000000
--- a/app/code/Magento/AdminAdobeIms/Block/Adminhtml/ImsReAuth.php
+++ /dev/null
@@ -1,121 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->serializer = $json;
- parent::__construct($context, $data);
- }
-
- /**
- * Get configuration for UI component
- *
- * @return string
- */
- public function getComponentJsonConfig(): string
- {
- return $this->serializer->serialize(
- array_replace_recursive(
- $this->getDefaultComponentConfig(),
- ...$this->getExtendedComponentConfig()
- )
- );
- }
-
- /**
- * Get default UI component configuration
- *
- * @return array
- */
- private function getDefaultComponentConfig(): array
- {
- return [
- 'component' => self::ADOBE_IMS_JS_REAUTH,
- 'template' => self::ADOBE_IMS_REAUTH,
- 'loginConfig' => [
- 'url' => $this->adminImsConfig->getAdminAdobeImsReAuthUrl(),
- 'callbackParsingParams' => [
- 'regexpPattern' => self::RESPONSE_REGEXP_PATTERN,
- 'codeIndex' => self::RESPONSE_CODE_INDEX,
- 'messageIndex' => self::RESPONSE_MESSAGE_INDEX,
- 'successCode' => self::RESPONSE_SUCCESS_CODE,
- 'errorCode' => self::RESPONSE_ERROR_CODE
- ]
- ]
- ];
- }
-
- /**
- * Get UI component configuration extension specified in layout configuration for block instance
- *
- * @return array
- */
- private function getExtendedComponentConfig(): array
- {
- $configProviders = $this->getData(self::DATA_ARGUMENT_KEY_CONFIG_PROVIDERS);
- if (empty($configProviders)) {
- return [];
- }
-
- $configExtensions = [];
- foreach ($configProviders as $configProvider) {
- if ($configProvider instanceof ConfigProviderInterface) {
- $configExtensions[] = $configProvider->get();
- }
- }
- return $configExtensions;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Block/Adminhtml/System/Config/Form/Field/Disabled.php b/app/code/Magento/AdminAdobeIms/Block/Adminhtml/System/Config/Form/Field/Disabled.php
deleted file mode 100644
index 3568f17e1215..000000000000
--- a/app/code/Magento/AdminAdobeIms/Block/Adminhtml/System/Config/Form/Field/Disabled.php
+++ /dev/null
@@ -1,50 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Return an empty string for the render if our module is enabled
- *
- * @param AbstractElement $element
- * @return string
- */
- public function render(AbstractElement $element): string
- {
- if ($this->adminImsConfig->enabled() === false) {
- return parent::render($element);
- }
- return '';
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsDisableCommand.php b/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsDisableCommand.php
deleted file mode 100755
index f299c87e35fd..000000000000
--- a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsDisableCommand.php
+++ /dev/null
@@ -1,68 +0,0 @@
-adminImsConfig = $adminImsConfig;
-
- $this->setName('admin:adobe-ims:disable')
- ->setDescription('Disable Adobe IMS Module');
- $this->cacheTypeList = $cacheTypeList;
- }
-
- /**
- * @inheritdoc
- */
- protected function execute(InputInterface $input, OutputInterface $output): ?int
- {
- try {
- $this->adminImsConfig->disableModule();
- $this->cacheTypeList->cleanType(Config::TYPE_IDENTIFIER);
- $output->writeln(__('Admin Adobe IMS integration is disabled'));
-
- return Cli::RETURN_SUCCESS;
- } catch (\Exception $e) {
- $output->writeln('' . $e->getMessage() . '');
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $output->writeln($e->getTraceAsString());
- }
- return Cli::RETURN_FAILURE;
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsEnableCommand.php b/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsEnableCommand.php
deleted file mode 100755
index 036a1abe01f8..000000000000
--- a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsEnableCommand.php
+++ /dev/null
@@ -1,255 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->imsCommandOptionService = $imsCommandOptionService;
- $this->cacheTypeList = $cacheTypeList;
- $this->updateTokensService = $updateTokensService;
- $this->authorization = $authorization;
- $this->role = $role ?: ObjectManager::getInstance()->get(Role::class);
- $this->roleCollection = $roleCollection ?: ObjectManager::getInstance()->get(CollectionFactory::class);
-
- $this->setName('admin:adobe-ims:enable')
- ->setDescription('Enable Adobe IMS Module.')
- ->setDefinition([
- new InputOption(
- self::ORGANIZATION_ID_ARGUMENT,
- 'o',
- InputOption::VALUE_OPTIONAL,
- 'Set Organization ID for Adobe IMS configuration. Required when enabling the module'
- ),
- new InputOption(
- self::CLIENT_ID_ARGUMENT,
- 'c',
- InputOption::VALUE_OPTIONAL,
- 'Set the client ID for Adobe IMS configuration. Required when enabling the module'
- ),
- new InputOption(
- self::CLIENT_SECRET_ARGUMENT,
- 's',
- InputOption::VALUE_OPTIONAL,
- 'Set the client Secret for Adobe IMS configuration. Required when enabling the module'
- ),
- new InputOption(
- self::TWO_FACTOR_AUTH_ARGUMENT,
- 't',
- InputOption::VALUE_OPTIONAL,
- 'Check if 2FA is enabled for Organization in Adobe Admin Console. ' .
- 'Required when enabling the module'
- )
- ]);
- }
-
- /**
- * @inheritdoc
- */
- protected function execute(InputInterface $input, OutputInterface $output): ?int
- {
- try {
- $helper = $this->getHelper('question');
-
- $organizationId = $this->imsCommandOptionService->getOrganizationId(
- $input,
- $output,
- $helper,
- self::ORGANIZATION_ID_ARGUMENT
- );
-
- $clientId = $this->imsCommandOptionService->getClientId(
- $input,
- $output,
- $helper,
- self::CLIENT_ID_ARGUMENT
- );
-
- $clientSecret = $this->imsCommandOptionService->getClientSecret(
- $input,
- $output,
- $helper,
- self::CLIENT_SECRET_ARGUMENT
- );
-
- $isTwoFactorAuthEnabled = $this->imsCommandOptionService->isTwoFactorAuthEnabled(
- $input,
- $output,
- $helper,
- self::TWO_FACTOR_AUTH_ARGUMENT
- );
-
- if ($clientId && $clientSecret && $organizationId && $isTwoFactorAuthEnabled) {
- $enabled = $this->enableModule($clientId, $clientSecret, $organizationId, $isTwoFactorAuthEnabled);
- if ($enabled) {
- $this->saveImsAuthorizationRole();
- $output->writeln(__('Admin Adobe IMS integration is enabled'));
- return Cli::RETURN_SUCCESS;
- }
- }
-
- throw new LocalizedException(
- __('The Client ID, Client Secret, Organization ID and 2FA are required ' .
- 'when enabling the Admin Adobe IMS Module')
- );
- } catch (\Exception $e) {
- $output->writeln('' . $e->getMessage() . '');
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $output->writeln($e->getTraceAsString());
- }
- return Cli::RETURN_FAILURE;
- }
- }
-
- /**
- * Save new Adobe IMS role
- *
- * @return bool
- * @throws \Exception
- */
- private function saveImsAuthorizationRole(): bool
- {
- $roleCollection = $this->roleCollection->create()->addFieldToFilter('role_name', 'Adobe Ims');
- if (!$roleCollection->getSize()) {
- $this->role->setRoleName('Adobe Ims')
- ->setUserType((string)UserContextInterface::USER_TYPE_ADMIN)
- ->setUserId(0)
- ->setRoleType(Group::ROLE_TYPE)
- ->setParentId(0)
- ->save();
- }
-
- return true;
- }
-
- /**
- * Enable Admin Adobe IMS Module when testConnection was successfully
- *
- * @param string $clientId
- * @param string $clientSecret
- * @param string $organizationId
- * @param bool $isTwoFactorAuthEnabled
- * @return bool
- * @throws LocalizedException
- * @throws InvalidArgumentException
- */
- private function enableModule(
- string $clientId,
- string $clientSecret,
- string $organizationId,
- bool $isTwoFactorAuthEnabled
- ): bool {
- $testAuth = $this->authorization->testAuth($clientId);
- if ($testAuth) {
- $this->adminImsConfig->enableModule($clientId, $clientSecret, $organizationId, $isTwoFactorAuthEnabled);
- $this->cacheTypeList->cleanType(Config::TYPE_IDENTIFIER);
- $this->updateTokensService->execute();
-
- return true;
- }
-
- return false;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsInfoCommand.php b/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsInfoCommand.php
deleted file mode 100755
index 6fe3a8c6aeca..000000000000
--- a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsInfoCommand.php
+++ /dev/null
@@ -1,90 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->authorization = $authorization;
-
- $this->setName('admin:adobe-ims:info')
- ->setDescription('Information of Adobe IMS Module configuration');
- }
-
- /**
- * @inheritdoc
- */
- protected function execute(InputInterface $input, OutputInterface $output): ?int
- {
- try {
- if ($this->adminImsConfig->enabled()) {
- $clientId = $this->adminImsConfig->getApiKey();
- if ($this->authorization->testAuth($clientId)) {
- $clientSecret = $this->adminImsConfig->getPrivateKey() ? 'configured' : 'not configured';
- $output->writeln(self::CLIENT_ID_NAME . ': ' . $clientId);
- $output->writeln(self::ORGANIZATION_ID_NAME . ': ' . $this->adminImsConfig->getOrganizationId());
- $output->writeln(self::CLIENT_SECRET_NAME . ' ' . $clientSecret);
- }
- } else {
- $output->writeln(__('Module is disabled'));
- }
-
- return Cli::RETURN_SUCCESS;
- } catch (\Exception $e) {
- $output->writeln('' . $e->getMessage() . '');
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $output->writeln($e->getTraceAsString());
- }
- return Cli::RETURN_FAILURE;
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsStatusCommand.php b/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsStatusCommand.php
deleted file mode 100755
index 93ea97959ec1..000000000000
--- a/app/code/Magento/AdminAdobeIms/Console/Command/AdminAdobeImsStatusCommand.php
+++ /dev/null
@@ -1,70 +0,0 @@
-adminImsConfig = $adminImsConfig;
-
- $this->setName('admin:adobe-ims:status')
- ->setDescription('Status of Adobe IMS Module');
- }
-
- /**
- * @inheritdoc
- */
- protected function execute(InputInterface $input, OutputInterface $output): ?int
- {
- try {
- $status = $this->getModuleStatus();
- $output->writeln(__('Admin Adobe IMS integration is %1', $status));
-
- return Cli::RETURN_SUCCESS;
- } catch (\Exception $e) {
- $output->writeln('' . $e->getMessage() . '');
- if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
- $output->writeln($e->getTraceAsString());
- }
- return Cli::RETURN_FAILURE;
- }
- }
-
- /**
- * Get Admin Adobe IMS Module status
- *
- * @return string
- */
- private function getModuleStatus(): string
- {
- return $this->adminImsConfig->enabled() ? self::MODE_ENABLE .'d' : self::MODE_DISABLE.'d';
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsCallback.php b/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsCallback.php
deleted file mode 100755
index 10d43b155276..000000000000
--- a/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsCallback.php
+++ /dev/null
@@ -1,112 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->logger = $logger;
- $this->userContext = $userContext;
- }
-
- /**
- * Execute AdobeIMS callback
- *
- * @return Redirect
- */
- public function execute(): Redirect
- {
- /** @var Redirect $resultRedirect */
- $resultRedirect = $this->resultRedirectFactory->create();
- $resultRedirect->setPath($this->_helper->getHomePageUrl());
-
- if (!$this->adminImsConfig->enabled()) {
- $this->getMessageManager()->addErrorMessage('Adobe Sign-In is disabled.');
- return $resultRedirect;
- }
-
- try {
- if ($this->userContext->getUserId()
- && $this->userContext->getUserType() === UserContextInterface::USER_TYPE_ADMIN
- ) {
- return $resultRedirect;
- }
- } catch (Exception $e) {
- $this->logger->error($e->getMessage());
-
- $this->imsErrorMessage(
- 'Error signing in',
- 'Something went wrong and we could not sign you in. ' .
- 'Please try again or contact your administrator.'
- );
- }
-
- return $resultRedirect;
- }
-
- /**
- * Add AdminAdobeIMS Error Message
- *
- * @param string $headline
- * @param string $message
- * @return void
- */
- private function imsErrorMessage(string $headline, string $message): void
- {
- $this->messageManager->addComplexErrorMessage(
- 'adminAdobeImsMessage',
- [
- 'headline' => __($headline)->getText(),
- 'message' => __($message)->getText()
- ]
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsReauthCallback.php b/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsReauthCallback.php
deleted file mode 100755
index 209b2078b175..000000000000
--- a/app/code/Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsReauthCallback.php
+++ /dev/null
@@ -1,115 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->adminTokenUserService = $adminTokenUserService;
- $this->logger = $logger;
- }
-
- /**
- * Execute AdobeIMS callback
- *
- * @return ResultInterface
- */
- public function execute(): ResultInterface
- {
- /** @var Raw $resultRaw */
- $resultRaw = $this->resultFactory->create(ResultFactory::TYPE_RAW);
-
- if (!$this->adminImsConfig->enabled()) {
- $this->getMessageManager()->addErrorMessage('Adobe Sign-In is disabled.');
-
- $response = sprintf(
- self::RESPONSE_TEMPLATE,
- self::RESPONSE_ERROR_CODE,
- __('Adobe Sign-In is disabled.')
- );
-
- $resultRaw->setContents($response);
-
- return $resultRaw;
- }
-
- try {
- $this->adminTokenUserService->processLoginRequest(true);
-
- $response = sprintf(
- self::RESPONSE_TEMPLATE,
- self::RESPONSE_SUCCESS_CODE,
- __('Authorization was successful')
- );
- } catch (Exception $e) {
- $this->logger->error($e->getMessage());
-
- $response = sprintf(
- self::RESPONSE_TEMPLATE,
- self::RESPONSE_ERROR_CODE,
- $e->getMessage()
- );
- }
-
- $resultRaw->setContents($response);
-
- return $resultRaw;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Exception/AdobeImsAuthorizationException.php b/app/code/Magento/AdminAdobeIms/Exception/AdobeImsAuthorizationException.php
deleted file mode 100755
index a3435ef5f13d..000000000000
--- a/app/code/Magento/AdminAdobeIms/Exception/AdobeImsAuthorizationException.php
+++ /dev/null
@@ -1,19 +0,0 @@
-" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
\ No newline at end of file
diff --git a/app/code/Magento/AdminAdobeIms/Logger/AdminAdobeImsLogger.php b/app/code/Magento/AdminAdobeIms/Logger/AdminAdobeImsLogger.php
deleted file mode 100644
index 2c651543acd7..000000000000
--- a/app/code/Magento/AdminAdobeIms/Logger/AdminAdobeImsLogger.php
+++ /dev/null
@@ -1,53 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Log error message and check if logging is enabled
- *
- * @param string|Stringable $message
- * @param array $context
- * @return void
- */
- public function error($message, array $context = []): void
- {
- if ($this->adminImsConfig->loggingEnabled()) {
- parent::error($message, $context);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/Auth.php b/app/code/Magento/AdminAdobeIms/Model/Auth.php
deleted file mode 100644
index 0c3d13fab3e9..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/Auth.php
+++ /dev/null
@@ -1,75 +0,0 @@
-errorMessage)
- );
- }
-
- try {
- $this->_initCredentialStorage();
- $this->getCredentialStorage()->loginByUsername($username);
- if ($this->getCredentialStorage()->getId()) {
- $this->getAuthStorage()->setUser($this->getCredentialStorage());
- $this->getAuthStorage()->processLogin();
-
- $this->_eventManager->dispatch(
- 'backend_auth_user_login_success',
- ['user' => $this->getCredentialStorage()]
- );
- }
-
- if (!$this->getAuthStorage()->getUser()) {
- parent::throwException(
- __($this->errorMessage)
- );
- }
- } catch (PluginAuthenticationException $e) {
- $this->_eventManager->dispatch(
- 'backend_auth_user_login_failed',
- ['user_name' => $username, 'exception' => $e]
- );
- throw $e;
- } catch (LocalizedException $e) {
- $this->_eventManager->dispatch(
- 'backend_auth_user_login_failed',
- ['user_name' => $username, 'exception' => $e]
- );
- parent::throwException(
- __(
- $e->getMessage()? : $this->errorMessage
- )
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserContext.php b/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserContext.php
deleted file mode 100644
index c85f138669dc..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserContext.php
+++ /dev/null
@@ -1,106 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->auth = $auth;
- $this->isTokenValid = $isTokenValid;
- $this->adminTokenUserService = $adminTokenUserService;
- }
-
- /**
- * @inheritdoc
- */
- public function getUserId(): ?int
- {
- if (!$this->adminImsConfig->enabled() || $this->isRequestProcessed) {
- return $this->userId;
- }
-
- $session = $this->auth->getAuthStorage();
-
- if (!empty($session->getAdobeAccessToken())) {
- $isTokenValid = $this->isTokenValid->validateToken($session->getAdobeAccessToken());
- if (!$isTokenValid) {
- throw new AuthenticationException(__('Session Access Token is not valid'));
- }
- } else {
- try {
- $this->adminTokenUserService->processLoginRequest();
- } catch (\Exception $e) {
- throw new AuthenticationException(__('Login request error %1', $e->getMessage()), $e, 0);
- }
- }
-
- $this->userId = (int) $session->getUser()->getUserId();
- $this->isRequestProcessed = true;
-
- return $this->userId;
- }
-
- /**
- * @inheritdoc
- */
- public function getUserType(): ?int
- {
- return UserContextInterface::USER_TYPE_ADMIN;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserService.php b/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserService.php
deleted file mode 100644
index 9ee688720bed..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserService.php
+++ /dev/null
@@ -1,205 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->organizationMembership = $organizationMembership;
- $this->adminLoginProcessService = $adminLoginProcessService;
- $this->adminReauthProcessService = $adminReauthProcessService;
- $this->request = $request;
- $this->token = $token;
- $this->profile = $profile;
- $this->tokenResponseFactory = $tokenResponseFactory;
- $this->saveImsUser = $saveImsUser;
- }
-
- /**
- * Process login request to Admin Adobe IMS.
- *
- * @param bool $isReauthorize
- * @return void
- * @throws AdobeImsAuthorizationException
- * @throws AdobeImsOrganizationAuthorizationException
- * @throws AuthenticationException
- * @throws AuthorizationException
- */
- public function processLoginRequest(bool $isReauthorize = false): void
- {
- if ($this->adminImsConfig->enabled()
- && $this->request->getModuleName() === self::ADOBE_IMS_MODULE_NAME) {
- try {
- if ($this->request->getHeader('Authorization')) {
- $tokenResponse = $this->getRequestedToken();
- } elseif ($this->request->getParam('code')) {
- $code = $this->request->getParam('code');
- $tokenResponse = $this->token->getTokenResponse($code);
- } else {
- throw new AuthenticationException(__('Unable to get Access Token. Please try again.'));
- }
-
- $this->getLoggedIn($isReauthorize, $tokenResponse);
- } catch (AdobeImsAuthorizationException $e) {
- throw new AdobeImsAuthorizationException(
- __('You don\'t have access to this Commerce instance')
- );
- } catch (AdobeImsOrganizationAuthorizationException $e) {
- throw new AdobeImsOrganizationAuthorizationException(
- __('Unable to sign in with the Adobe ID')
- );
- }
- } else {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
- }
-
- /**
- * Get requested token using Authorization header
- *
- * @return TokenResponseInterface
- * @throws AuthenticationException
- */
- private function getRequestedToken(): TokenResponseInterface
- {
- $authorizationHeaderValue = $this->request->getHeader('Authorization');
- if (!$authorizationHeaderValue) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
-
- $headerPieces = explode(" ", $authorizationHeaderValue);
- if (count($headerPieces) !== 2) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
-
- $tokenType = strtolower($headerPieces[0]);
- if ($tokenType !== self::AUTHORIZATION_METHOD_HEADER_BEARER) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
-
- $tokenResponse['access_token'] = $headerPieces[1];
- return $this->tokenResponseFactory->create(['data' => $tokenResponse]);
- }
-
- /**
- * Responsible for logging in to Admin Panel
- *
- * @param bool $isReauthorize
- * @param TokenResponseInterface $tokenResponse
- * @return void
- * @throws AdobeImsAuthorizationException
- * @throws AuthenticationException
- * @throws AuthorizationException
- */
- private function getLoggedIn(bool $isReauthorize, TokenResponseInterface $tokenResponse): void
- {
- $profile = $this->profile->getProfile($tokenResponse->getAccessToken());
- if (empty($profile['email'])) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
-
- $this->organizationMembership->checkOrganizationMembership($tokenResponse->getAccessToken());
-
- if ($isReauthorize) {
- $this->adminReauthProcessService->execute($tokenResponse);
- } else {
- $this->saveImsUser->save($profile);
- $this->adminLoginProcessService->execute($tokenResponse, $profile);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserContext.php b/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserContext.php
deleted file mode 100644
index e2c9b93cf7b1..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserContext.php
+++ /dev/null
@@ -1,138 +0,0 @@
-request = $request;
- $this->adminImsConfig = $adminImsConfig;
- $this->tokenUserService = $tokenUserService;
- }
-
- /**
- * @inheritdoc
- */
- public function getUserId(): ?int
- {
- $this->processRequest();
- return $this->userId;
- }
-
- /**
- * @inheritdoc
- */
- public function getUserType(): ?int
- {
- return UserContextInterface::USER_TYPE_ADMIN;
- }
-
- /**
- * Finds the bearer token and looks up the value.
- *
- * @return void
- * @throws AuthorizationException
- * @throws CouldNotSaveException
- * @throws InvalidArgumentException
- */
- private function processRequest()
- {
- if (!$this->adminImsConfig->enabled() || $this->isRequestProcessed) {
- return;
- }
-
- if (!$bearerToken = $this->getRequestedToken()) {
- return;
- }
-
- try {
- $adminUserId = $this->tokenUserService->getAdminUserIdByToken($bearerToken);
- } catch (AuthenticationException $e) {
- $this->isRequestProcessed = true;
- return;
- }
-
- $this->userId = $adminUserId;
- $this->isRequestProcessed = true;
- }
-
- /**
- * Getting requested token
- *
- * @return false|string
- */
- private function getRequestedToken()
- {
- $authorizationHeaderValue = $this->request->getHeader('Authorization');
- if (!$authorizationHeaderValue) {
- $this->isRequestProcessed = true;
- return false;
- }
-
- $headerPieces = explode(" ", $authorizationHeaderValue);
- if (count($headerPieces) !== 2) {
- $this->isRequestProcessed = true;
- return false;
- }
-
- $tokenType = strtolower($headerPieces[0]);
- if ($tokenType !== self::AUTHORIZATION_METHOD_HEADER_BEARER) {
- $this->isRequestProcessed = true;
- return false;
- }
-
- return $headerPieces[1];
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserService.php b/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserService.php
deleted file mode 100644
index 23239e382ac1..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsTokenUserService.php
+++ /dev/null
@@ -1,243 +0,0 @@
-tokenReader = $tokenReader;
- $this->imsWebapiFactory = $imsWebapiFactory;
- $this->adminUser = $adminUser;
- $this->isTokenValid = $isTokenValid;
- $this->imsWebapiRepository = $imsWebapiRepository;
- $this->encryptor = $encryptor;
- $this->dateTime = $dateTime;
- $this->profile = $profile;
- }
-
- /**
- * Retrieve admin user id by token
- *
- * @param string $bearerToken
- * @return int
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws CouldNotSaveException
- * @throws InvalidArgumentException
- * @throws NoSuchEntityException
- */
- public function getAdminUserIdByToken(string $bearerToken): int
- {
- $imsWebapiEntity = $this->imsWebapiRepository->getByAccessTokenHash(
- $this->encryptor->getHash($bearerToken)
- );
- $this->validateToken($bearerToken, $imsWebapiEntity);
- $dataFromToken = $this->tokenReader->read($bearerToken);
-
- if ($imsWebapiEntity->getId()) {
- $adminUserId = $imsWebapiEntity->getAdminUserId();
- } else {
- $profile = $this->getUserProfile($bearerToken);
- if (empty($profile['email'])) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
- $adminUser = $this->adminUser->loadByEmail($profile['email']);
- if (empty($adminUser['user_id'])) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
-
- $adminUserId = (int) $adminUser['user_id'];
- $profile['access_token'] = $bearerToken;
- $profile['created_at'] = $dataFromToken['created_at'] ?? 0;
- $profile['expires_in'] = $dataFromToken['expires_in'] ?? 0;
-
- $imsWebapiInterface = $this->createImsWebapiInterface($adminUserId);
- $this->imsWebapiRepository->save($this->setImsWebapiData($imsWebapiInterface, $profile));
- }
-
- return $adminUserId;
- }
-
- /**
- * Always validate new tokens and validate existing token with interval
- *
- * @param string $token
- * @param ImsWebapiInterface $imsWebapiEntity
- * @return void
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws CouldNotSaveException
- */
- private function validateToken(string $token, ImsWebapiInterface $imsWebapiEntity)
- {
- $isTokenValid = true;
- if ($imsWebapiEntity->getId()) {
- $lastCheckTimestamp = $this->dateTime->gmtTimestamp($imsWebapiEntity->getLastCheckTime());
- if (($lastCheckTimestamp + self::ACCESS_TOKEN_INTERVAL_CHECK) <= $this->dateTime->gmtTimestamp()) {
- $isTokenValid = $this->isTokenValid->validateToken($token);
- $imsWebapiEntity->setLastCheckTime($this->dateTime->gmtDate(self::DATE_FORMAT));
- $this->imsWebapiRepository->save($imsWebapiEntity);
- }
- } else {
- $isTokenValid = $this->isTokenValid->validateToken($token);
- }
-
- if (!$isTokenValid) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
- }
-
- /**
- * Get adobe user profile
- *
- * @param string $bearerToken
- * @return array
- * @throws AuthenticationException
- */
- private function getUserProfile(string $bearerToken): array
- {
- try {
- return $this->profile->getProfile($bearerToken);
- } catch (\Exception $exception) {
- throw new AuthenticationException(__('An authentication error occurred. Verify and try again.'));
- }
- }
-
- /**
- * Create new ims webapi entity
- *
- * @param int $adminUserId
- * @return ImsWebapiInterface
- */
- private function createImsWebapiInterface(int $adminUserId): ImsWebapiInterface
- {
- return $this->imsWebapiFactory->create(
- [
- 'data' => [
- 'admin_user_id' => $adminUserId
- ]
- ]
- );
- }
-
- /**
- * Update admin adobe ims webapi entity
- *
- * @param ImsWebapiInterface $imsWebapiInterface
- * @param array $profile
- * @return ImsWebapiInterface
- */
- private function setImsWebapiData(
- ImsWebapiInterface $imsWebapiInterface,
- array $profile
- ): ImsWebapiInterface {
- $imsWebapiInterface->setAccessTokenHash($this->encryptor->getHash($profile['access_token']));
- $imsWebapiInterface->setAccessToken($this->encryptor->encrypt($profile['access_token']));
- $imsWebapiInterface->setLastCheckTime($this->dateTime->gmtDate(self::DATE_FORMAT));
- $imsWebapiInterface->setAccessTokenExpiresAt(
- $this->getExpiresTime($profile['created_at'], $profile['expires_in'])
- );
-
- return $imsWebapiInterface;
- }
-
- /**
- * Retrieve token expires date
- *
- * @param int $createdAt
- * @param int $expiresIn
- * @return string
- */
- private function getExpiresTime(int $createdAt, int $expiresIn): string
- {
- return $this->dateTime->gmtDate(
- self::DATE_FORMAT,
- round(($createdAt + $expiresIn) / 1000)
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/FlushUserTokens.php b/app/code/Magento/AdminAdobeIms/Model/FlushUserTokens.php
deleted file mode 100644
index e4f80e1ed926..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/FlushUserTokens.php
+++ /dev/null
@@ -1,110 +0,0 @@
-imsWebapiRepository = $imsWebapiRepository;
- $this->userContext = $userContext;
- $this->logOut = $logOut;
- $this->encryptor = $encryptor;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(int $adminUserId = null): void
- {
- try {
- $adminUserId = $adminUserId ?? (int) $this->userContext->getUserId();
-
- $this->revokeTokenForAdobeIms($adminUserId);
- $this->removeTokensFromTable($adminUserId);
- } catch (Exception $exception) { //phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch
- // User profile and tokens are not present in the system
- }
- }
-
- /**
- * Revoke tokens for adobe
- *
- * Get list of all tokens for adminUserId and invalidate them on adobe side
- *
- * @param int|null $adminUserId
- * @return void
- * @throws NoSuchEntityException
- * @throws Exception
- */
- private function revokeTokenForAdobeIms(int $adminUserId = null): void
- {
- $list = $this->imsWebapiRepository->getByAdminUserId($adminUserId);
- foreach ($list as $entity) {
- if ($entity->getAccessToken() !== null) {
- $this->logOut->execute(
- $this->encryptor->decrypt($entity->getAccessToken())
- );
- }
- }
- }
-
- /**
- * Remove tokens from webapi table
- *
- * @param int|null $adminUserId
- * @return void
- * @throws NoSuchEntityException
- * @throws LocalizedException
- */
- private function removeTokensFromTable(int $adminUserId = null): void
- {
- $this->imsWebapiRepository->deleteByAdminUserId($adminUserId);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenProxy.php b/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenProxy.php
deleted file mode 100644
index 960bcf92bb52..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenProxy.php
+++ /dev/null
@@ -1,60 +0,0 @@
-getAccessTokenFromDb = $getAccessTokenFromDb;
- $this->getAccessTokenFromSession = $getAccessTokenFromSession;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(int $adminUserId = null): ?string
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- return $this->getAccessTokenFromSession->execute($adminUserId);
- }
-
- return $this->getAccessTokenFromDb->execute($adminUserId);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenSession.php b/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenSession.php
deleted file mode 100644
index 142de4df4d57..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/GetAccessTokenSession.php
+++ /dev/null
@@ -1,37 +0,0 @@
-auth = $auth;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(int $adminUserId = null): ?string
- {
- return $this->auth->getAuthStorage()->getAdobeAccessToken() ?? null;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ImsEmailNotification.php b/app/code/Magento/AdminAdobeIms/Model/ImsEmailNotification.php
deleted file mode 100644
index 4ced72c6b754..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ImsEmailNotification.php
+++ /dev/null
@@ -1,112 +0,0 @@
-transportBuilder = $transportBuilder;
- $this->config = $config;
- $this->assetRepo = $assetRepo;
- }
-
- /**
- * Send email notification
- *
- * @param string $emailTemplate
- * @param array $templateVars
- * @param string $toEmail
- * @param string $toName
- * @return void
- * @throws LocalizedException
- *
- * @throws MailException
- */
- public function sendNotificationEmail(
- string $emailTemplate,
- array $templateVars,
- string $toEmail,
- string $toName
- ): void {
-
- $templateVars = $this->addTemplateVars($templateVars);
-
- $transport = $this->transportBuilder
- ->setTemplateIdentifier($emailTemplate)
- ->setTemplateModel(BackendTemplate::class)
- ->setTemplateOptions([
- 'area' => FrontNameResolver::AREA_CODE,
- 'store' => Store::DEFAULT_STORE_ID
- ])
- ->setTemplateVars($templateVars)
- ->setFromByScope(
- $this->config->getValue('adobe_ims/email/new_user_email_identity'),
- Store::DEFAULT_STORE_ID
- )
- ->addTo($toEmail, $toName)
- ->getTransport();
- $transport->sendMessage();
- }
-
- /**
- * Add additional (default) template variables like current_year and logo if not already set
- *
- * @param array $templateVars
- * @return array
- */
- private function addTemplateVars(array $templateVars): array
- {
- if (!isset($templateVars['current_year'])) {
- $templateVars['current_year'] = date('Y');
- }
-
- if (!isset($templateVars['logo_url'])) {
- $logo = $this->assetRepo->getUrlWithParams(
- 'Magento_AdminAdobeIms::images/adobe-commerce-light.png',
- []
- );
-
- $templateVars['logo_url'] = $logo;
- }
-
- return $templateVars;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ImsWebapi.php b/app/code/Magento/AdminAdobeIms/Model/ImsWebapi.php
deleted file mode 100644
index 3a8c7648ed08..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ImsWebapi.php
+++ /dev/null
@@ -1,182 +0,0 @@
-_init(ImsWebapiResource::class);
- }
-
- /**
- * @inheritdoc
- */
- public function getAdminUserId(): ?int
- {
- return (int) $this->getData(self::ADMIN_USER_ID);
- }
-
- /**
- * @inheritdoc
- */
- public function setAdminUserId(int $value): ImsWebapiInterface
- {
- $this->setData(self::ADMIN_USER_ID, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getAccessTokenHash(): ?string
- {
- return $this->getData(self::ACCESS_TOKEN_HASH);
- }
-
- /**
- * @inheritdoc
- */
- public function setAccessTokenHash(string $value): ImsWebapiInterface
- {
- $this->setData(self::ACCESS_TOKEN_HASH, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getAccessToken(): ?string
- {
- return $this->getData(self::ACCESS_TOKEN);
- }
-
- /**
- * @inheritdoc
- */
- public function setAccessToken(string $value): ImsWebapiInterface
- {
- $this->setData(self::ACCESS_TOKEN, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getCreatedAt(): ?string
- {
- return $this->getData(self::CREATED_AT);
- }
-
- /**
- * @inheritdoc
- */
- public function setCreatedAt(string $value): ImsWebapiInterface
- {
- $this->setData(self::CREATED_AT, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getUpdatedAt(): ?string
- {
- return $this->getData(self::UPDATED_AT);
- }
-
- /**
- * @inheritdoc
- */
- public function setUpdatedAt(string $value): ImsWebapiInterface
- {
- $this->setData(self::UPDATED_AT, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getLastCheckTime(): ?string
- {
- return $this->getData(self::LAST_CHECK_TIME);
- }
-
- /**
- * @inheritdoc
- */
- public function setLastCheckTime(string $value): ImsWebapiInterface
- {
- $this->setData(self::LAST_CHECK_TIME, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getAccessTokenExpiresAt(): ?string
- {
- return $this->getData(self::ACCESS_TOKEN_EXPIRES_AT);
- }
-
- /**
- * @inheritdoc
- */
- public function setAccessTokenExpiresAt(string $value): ImsWebapiInterface
- {
- $this->setData(self::ACCESS_TOKEN_EXPIRES_AT, $value);
-
- return $this;
- }
-
- /**
- * @inheritdoc
- */
- public function getExtensionAttributes(): ImsWebapiExtensionInterface
- {
- return $this->_getExtensionAttributes();
- }
-
- /**
- * @inheritdoc
- */
- public function setExtensionAttributes(ImsWebapiExtensionInterface $extensionAttributes): ImsWebapiInterface
- {
- $this->_setExtensionAttributes($extensionAttributes);
-
- return $this;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ImsWebapiRepository.php b/app/code/Magento/AdminAdobeIms/Model/ImsWebapiRepository.php
deleted file mode 100644
index f1caba6fa5b4..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ImsWebapiRepository.php
+++ /dev/null
@@ -1,201 +0,0 @@
-resource = $resource;
- $this->entityFactory = $entityFactory;
- $this->logger = $logger;
- $this->entityCollectionFactory = $entityCollectionFactory;
- $this->collectionProcessor = $collectionProcessor;
- $this->searchResultsFactory = $searchResultsFactory;
- $this->searchCriteriaBuilder = $searchCriteriaBuilder;
- }
-
- /**
- * @inheritdoc
- */
- public function save(ImsWebapiInterface $entity): void
- {
- try {
- $this->resource->save($entity);
- $this->loadedEntities[$entity->getId()] = $entity;
- } catch (Exception $exception) {
- $this->logger->critical($exception);
- throw new CouldNotSaveException(__('Could not save ims token.'), $exception);
- }
- }
-
- /**
- * @inheritdoc
- */
- public function get(int $entityId): ImsWebapiInterface
- {
- if (isset($this->loadedEntities[$entityId])) {
- return $this->loadedEntities[$entityId];
- }
-
- $entity = $this->entityFactory->create();
- $this->resource->load($entity, $entityId);
- if (!$entity->getId()) {
- throw new NoSuchEntityException(__('Could not find ims token id: %id.', ['id' => $entityId]));
- }
-
- return $this->loadedEntities[$entity->getId()] = $entity;
- }
-
- /**
- * @inheritdoc
- */
- public function getByAdminUserId(int $adminUserId): array
- {
- $searchCriteria = $this->searchCriteriaBuilder
- ->addFilter(self::ADMIN_USER_ID, $adminUserId)
- ->create();
-
- return $this->getList($searchCriteria)->getItems();
- }
-
- /**
- * @inheritdoc
- */
- public function getByAccessTokenHash(string $tokenHash): ImsWebapiInterface
- {
- $entity = $this->entityFactory->create();
- $this->resource->load($entity, $tokenHash, 'access_token_hash');
-
- return $entity;
- }
-
- /**
- * @inheritdoc
- */
- public function getList(SearchCriteriaInterface $searchCriteria): ImsWebapiSearchResultsInterface
- {
- /** @var Collection $collection */
- $collection = $this->entityCollectionFactory->create();
-
- /** @var $searchResults */
- $searchResults = $this->searchResultsFactory->create();
- $searchResults->setSearchCriteria($searchCriteria);
-
- $this->collectionProcessor->process($searchCriteria, $collection);
-
- if ($searchCriteria->getPageSize()) {
- $searchResults->setTotalCount($collection->getSize());
- } else {
- $searchResults->setTotalCount(count($collection));
- }
-
- $searchResults->setItems($collection->getItems());
-
- return $searchResults;
- }
-
- /**
- * @inheritdoc
- */
- public function deleteByAdminUserId(int $adminUserId): bool
- {
- try {
- $entities = $this->getByAdminUserId($adminUserId);
-
- foreach ($entities as $entity) {
- $this->resource->delete($entity);
- }
- return true;
- } catch (Exception $exception) {
- $this->logger->critical($exception);
- throw new CouldNotDeleteException(
- __('Could not delete ims tokens for admin user id %1.', $adminUserId),
- $exception
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ImsWebapiSearchResults.php b/app/code/Magento/AdminAdobeIms/Model/ImsWebapiSearchResults.php
deleted file mode 100644
index f1594f55f61b..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ImsWebapiSearchResults.php
+++ /dev/null
@@ -1,18 +0,0 @@
-_init(self::ADMIN_ADOBE_IMS_WEBAPI, self::ENTITY_ID);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ResourceModel/ImsWebapi/Collection.php b/app/code/Magento/AdminAdobeIms/Model/ResourceModel/ImsWebapi/Collection.php
deleted file mode 100644
index d2784c5bed3c..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ResourceModel/ImsWebapi/Collection.php
+++ /dev/null
@@ -1,26 +0,0 @@
-_init(ImsWebapiModel::class, ImsWebapiResource::class);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/ResourceModel/User.php b/app/code/Magento/AdminAdobeIms/Model/ResourceModel/User.php
deleted file mode 100644
index 8f33a5abc338..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/ResourceModel/User.php
+++ /dev/null
@@ -1,38 +0,0 @@
-getConnection();
-
- $select = $connection->select()->from($this->getMainTable())->where('email=:email');
-
- $binds = ['email' => $email];
-
- $result = $connection->fetchRow($select, $binds);
-
- if (!is_array($result)) {
- return [];
- }
-
- return $result;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/SaveImsUser.php b/app/code/Magento/AdminAdobeIms/Model/SaveImsUser.php
deleted file mode 100644
index 43183f10f6eb..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/SaveImsUser.php
+++ /dev/null
@@ -1,151 +0,0 @@
-user = $user;
- $this->userCollectionFactory = $userCollectionFactory;
- $this->roleCollectionFactory = $roleCollectionFactory;
- $this->logger = $logger;
- $this->adminImsConfig = $adminImsConfig;
- }
-
- /**
- * @inheritdoc
- */
- public function save(array $profile): void
- {
- if (!$this->adminImsConfig->enabled() || empty($profile['email'])) {
- throw new CouldNotSaveException(__('Could not save ims user.'));
- }
-
- $username = strtolower(strstr($profile['email'], '@', true));
- $userCollection = $this->userCollectionFactory->create()
- ->addFieldToFilter('email', ['eq' => $profile['email']])
- ->addFieldToFilter('username', ['eq' => $username]);
-
- if (!$userCollection->getSize()) {
- $roleId = $this->getImsDefaultRole();
- if ($roleId > 0) {
- try {
- $this->user->setFirstname($profile['first_name'])
- ->setLastname($profile['last_name'])
- ->setUsername($username)
- ->setPassword($this->generateRandomPassword())
- ->setEmail($profile['email'])
- ->setRoleType(UserRoleType::ROLE_TYPE)
- ->setPrivileges("")
- ->setAssertId(0)
- ->setRoleId((int)$roleId)
- ->setPermission('allow')
- ->save();
- unset($this->user);
- } catch (Exception $e) {
- $this->logger->critical($e->getMessage());
- throw new CouldNotSaveException(__('Could not save ims user.'));
- }
- }
- }
- $userCollection->clear();
- }
-
- /**
- * Fetch Default Role "Adobe Ims"
- *
- * @return int
- */
- private function getImsDefaultRole(): int
- {
- $roleId = 0;
- $roleCollection = $this->roleCollectionFactory->create()
- ->addFieldToFilter('role_name', ['eq' => self::ADMIN_IMS_ROLE])
- ->addFieldToSelect('role_id');
-
- if ($roleCollection->getSize() > 0) {
- $objRole = $roleCollection->fetchItem();
- $roleId = (int) $objRole->getId();
- }
- $roleCollection->clear();
-
- return $roleId;
- }
-
- /**
- * Generate random password string
- *
- * @return string
- */
- private function generateRandomPassword(): string
- {
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.';
- $pass = [];
- $alphaLength = strlen($characters) - 1;
- for ($i = 0; $i < 100; $i++) {
- $n = random_int(0, $alphaLength);
- $pass[] = $characters[$n];
- }
- return implode($pass);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/User.php b/app/code/Magento/AdminAdobeIms/Model/User.php
deleted file mode 100644
index b8ec54c171af..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/User.php
+++ /dev/null
@@ -1,117 +0,0 @@
-_init(AdminResourceUser::class);
- }
-
- /**
- * Load user by email
- *
- * @param string $email
- * @return array
- */
- public function loadByEmail(string $email): array
- {
- return $this->getResource()->loadByEmail($email);
- }
-
- /**
- * Login user
- *
- * @param string $username
- * @return User
- * @throws LocalizedException
- */
- public function loginByUsername($username): User
- {
- if ($this->authenticateByUsername($username)) {
- $this->getResource()->recordLogin($this);
- }
- return $this;
- }
-
- /**
- * Authenticate username and save loaded record
- *
- * @param string $username
- * @return bool
- * @throws LocalizedException
- */
- private function authenticateByUsername(string $username): bool
- {
- $config = $this->_config->isSetFlag('admin/security/use_case_sensitive_login');
- $result = false;
-
- try {
- $this->_eventManager->dispatch(
- 'admin_user_authenticate_before',
- ['username' => $username, 'user' => $this]
- );
- $this->loadByUsername($username);
- $sensitive = !$config || $username === $this->getUserName();
- if ($sensitive && $this->getId()) {
- $result = $this->verifyIdentityWithoutPassword();
- }
-
- /**
- * Dispatch admin_user_authenticate_after but with an empty password
- */
- $this->_eventManager->dispatch(
- 'admin_adobe_ims_user_authenticate_after',
- ['username' => $username, 'user' => $this, 'result' => $result]
- );
-
- } catch (LocalizedException $e) {
- $this->unsetData();
- throw $e;
- }
-
- if (!$result) {
- $this->unsetData();
- }
- return $result;
- }
-
- /**
- * Check if the current user account is active.
- *
- * @return bool
- * @throws AuthenticationException
- */
- private function verifyIdentityWithoutPassword(): bool
- {
- if ((bool)$this->getIsActive() === false) {
- throw new AuthenticationException(
- __(
- 'The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.'
- )
- );
- }
- if (!$this->hasAssigned2Role($this->getId())) {
- throw new AuthenticationException(__('More permissions are needed to access this.'));
- }
-
- return true;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedProxy.php b/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedProxy.php
deleted file mode 100644
index cc3087d02b25..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedProxy.php
+++ /dev/null
@@ -1,60 +0,0 @@
-userAuthorizedDb = $userAuthorizedDb;
- $this->userAuthorizedSession = $userAuthorizedSession;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(int $adminUserId = null): bool
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- return $this->userAuthorizedSession->execute($adminUserId);
- }
-
- return $this->userAuthorizedDb->execute($adminUserId);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedSession.php b/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedSession.php
deleted file mode 100644
index 5c2ff966f05a..000000000000
--- a/app/code/Magento/AdminAdobeIms/Model/UserAuthorizedSession.php
+++ /dev/null
@@ -1,58 +0,0 @@
-auth = $auth;
- $this->isTokenValid = $isTokenValid;
- }
-
- /**
- * @inheritdoc
- */
- public function execute(int $adminUserId = null): bool
- {
- $token = $this->auth->getAuthStorage()->getAdobeAccessToken();
-
- if (empty($token) || empty($this->auth->getUser()->getId())) {
- return false;
- }
-
- try {
- return $this->isTokenValid->validateToken($token);
- } catch (AuthorizationException $e) {
- return false;
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Observer/AdminAccountCreatedObserver.php b/app/code/Magento/AdminAdobeIms/Observer/AdminAccountCreatedObserver.php
deleted file mode 100644
index e2cc99e5a4cc..000000000000
--- a/app/code/Magento/AdminAdobeIms/Observer/AdminAccountCreatedObserver.php
+++ /dev/null
@@ -1,56 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->adminNotificationService = $adminNotificationService;
- }
-
- /**
- * @inheritDoc
- */
- public function execute(Observer $observer)
- {
- if (!$this->adminImsConfig->enabled()) {
- return;
- }
-
- /** @var User $user */
- $user = $observer->getObject();
-
- if ($user->isObjectNew()) {
- $this->adminNotificationService->sendWelcomeMailToAdminUser($user);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Observer/AdminLogoutObserver.php b/app/code/Magento/AdminAdobeIms/Observer/AdminLogoutObserver.php
deleted file mode 100644
index afded17121c5..000000000000
--- a/app/code/Magento/AdminAdobeIms/Observer/AdminLogoutObserver.php
+++ /dev/null
@@ -1,42 +0,0 @@
-logOut = $logOut;
- }
-
- /**
- * Perform logout action
- *
- * @param Observer $observer
- * @return $this
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function execute(Observer $observer)
- {
- $this->logOut->execute();
- return $this;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Observer/AuthObserver.php b/app/code/Magento/AdminAdobeIms/Observer/AuthObserver.php
deleted file mode 100644
index bb0cf7bf1257..000000000000
--- a/app/code/Magento/AdminAdobeIms/Observer/AuthObserver.php
+++ /dev/null
@@ -1,129 +0,0 @@
-observerConfig = $observerConfig;
- $this->userResource = $userResource;
- }
-
- /**
- * Admin locking logic implementation
- *
- * @param EventObserver $observer
- * @return void
- * @throws LocalizedException
- * @throws Exception
- */
- public function execute(EventObserver $observer): void
- {
- /** @var User $user */
- $user = $observer->getEvent()->getUser();
- $authResult = $observer->getEvent()->getResult();
-
- if (!$authResult && $user->getId()) {
- // update locking information regardless whether user locked or not
- $this->updateLockingInformation($user);
- }
-
- // check whether user is locked
- $lockExpires = $user->getLockExpires();
- if ($lockExpires) {
- $lockExpires = new DateTime($lockExpires);
- if ($lockExpires > new DateTime()) {
- throw new UserLockedException(
- __(
- 'The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.'
- )
- );
- }
- }
-
- if (!$authResult) {
- return;
- }
-
- $this->userResource->unlock($user->getId());
- }
-
- /**
- * Update locking information for the user
- *
- * @param User $user
- * @return void
- * @throws Exception
- */
- private function updateLockingInformation(User $user): void
- {
- $now = new DateTime();
- $lockThreshold = $this->observerConfig->getAdminLockThreshold();
- $maxFailures = $this->observerConfig->getMaxFailures();
- if (!($lockThreshold && $maxFailures)) {
- return;
- }
- $failuresNum = (int)$user->getFailuresNum() + 1;
- /** @noinspection PhpAssignmentInConditionInspection */
- if ($firstFailureDate = $user->getFirstFailure()) {
- $firstFailureDate = new DateTime($firstFailureDate);
- }
-
- $newFirstFailureDate = false;
- $updateLockExpires = false;
- $lockThreshInterval = new DateInterval('PT' . $lockThreshold . 'S');
- // set first failure date when this is first failure or last first failure expired
- if (1 === $failuresNum
- || !$firstFailureDate
- || ($now->getTimestamp() - $firstFailureDate->getTimestamp()) > $lockThreshold
- ) {
- $newFirstFailureDate = $now;
- // otherwise lock user
- } elseif ($failuresNum >= $maxFailures) {
- $updateLockExpires = $now->add($lockThreshInterval);
- }
- $this->userResource->updateFailure($user, $updateLockExpires, $newFirstFailureDate);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/AddAdobeImsLayoutHandlePlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/AddAdobeImsLayoutHandlePlugin.php
deleted file mode 100644
index a6eb22aeaafb..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/AddAdobeImsLayoutHandlePlugin.php
+++ /dev/null
@@ -1,50 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Add our admin hand only when on the login page and module is active
- *
- * @param Layout $subject
- * @param Layout $result
- * @return Layout
- */
- public function afterAddDefaultHandle(Layout $subject, Layout $result): Layout
- {
- if ($subject->getDefaultLayoutHandle() !== 'adminhtml_auth_login') {
- return $result;
- }
-
- if ($this->adminImsConfig->enabled() !== true) {
- return $result;
- }
-
- $result->addHandle('adobe_ims_login');
- return $result;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/AdminForgotPasswordPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/AdminForgotPasswordPlugin.php
deleted file mode 100644
index 32255faf3450..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/AdminForgotPasswordPlugin.php
+++ /dev/null
@@ -1,66 +0,0 @@
-redirectFactory = $redirectFactory;
- $this->adminImsConfig = $adminImsConfig;
- $this->messageManager = $messageManager;
- }
-
- /**
- * Disable forgot password method when AdminAdobeIMS Module is enabled
- *
- * @param Forgotpassword $subject
- * @param callable $proceed
- * @return Redirect|void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundExecute(Forgotpassword $subject, callable $proceed)
- {
- if ($this->adminImsConfig->enabled() === false) {
- return $proceed();
- }
-
- $resultRedirect = $this->redirectFactory->create();
- $this->messageManager->addErrorMessage(__('Please sign in with Adobe ID'));
- return $resultRedirect->setPath('admin');
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/AdminTokenPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/AdminTokenPlugin.php
deleted file mode 100644
index 543e3940d770..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/AdminTokenPlugin.php
+++ /dev/null
@@ -1,51 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Disable generation of admin token if AdminAdobeIms module is enabled
- *
- * @param AdminTokenService $subject
- * @param callable $proceed
- * @param string $username
- * @param string $password
- * @return string
- * @throws AuthenticationException
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundCreateAdminAccessToken(AdminTokenService $subject, callable $proceed, $username, $password)
- {
- if (!$this->adminImsConfig->enabled()) {
- return $proceed($username, $password);
- }
-
- throw new AuthenticationException(
- __(
- 'Admin token generation is disabled. Please use Adobe IMS ACCESS_TOKEN.'
- )
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/AdobeImsReauth/AddAdobeImsReAuthButton.php b/app/code/Magento/AdminAdobeIms/Plugin/AdobeImsReauth/AddAdobeImsReAuthButton.php
deleted file mode 100644
index 95c274bf1418..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/AdobeImsReauth/AddAdobeImsReAuthButton.php
+++ /dev/null
@@ -1,52 +0,0 @@
-setLegend(__('Identity Verification'));
-
- $fieldset->addField(
- 'ims_verification',
- 'button',
- [
- 'name' => 'ims_verification',
- 'label' => __('Verify Identity with Adobe IMS'),
- 'id' => 'ims_verification',
- 'class' => 'ims_verification',
- 'title' => __('Verify Identity with Adobe IMS'),
- 'required' => true,
- 'value' => __('Confirm Identity'),
- 'note' => __('To apply changes you need to verify your Adobe identity.'),
- ]
- );
-
- $fieldset->addField(
- 'ims_verified',
- 'hidden',
- [
- 'name' => 'ims_verified',
- 'label' => __('Identity Verified with Adobe IMS'),
- 'id' => 'ims_verified',
- 'class' => 'ims_verified',
- 'title' => __('Identity Verified with Adobe IMS'),
- 'required' => true,
- ]
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/BackendAuthSessionPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/BackendAuthSessionPlugin.php
deleted file mode 100644
index 434a953544db..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/BackendAuthSessionPlugin.php
+++ /dev/null
@@ -1,77 +0,0 @@
-isTokenValid = $isTokenValid;
- $this->dateTime = $dateTime;
- $this->adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Check if access token still valid
- *
- * @param Session $subject
- * @param callable $proceed
- * @return void
- * @throws \Magento\Framework\Exception\AuthorizationException
- */
- public function aroundProlong(Session $subject, callable $proceed): void
- {
- if ($this->adminImsConfig->enabled()) {
- $lastCheckTime = $subject->getTokenLastCheckTime();
- if ($lastCheckTime + self::ACCESS_TOKEN_INTERVAL_CHECK <= $this->dateTime->gmtTimestamp()) {
- $accessToken = $subject->getAdobeAccessToken();
- if ($this->isTokenValid->validateToken($accessToken)) {
- $subject->setTokenLastCheckTime($this->dateTime->gmtTimestamp());
- } else {
- $subject->destroy();
- return;
- }
- }
- }
-
- $proceed();
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/Integration/Edit/Tab/AddReAuthVerification.php b/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/Integration/Edit/Tab/AddReAuthVerification.php
deleted file mode 100644
index b781f3f87429..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/Integration/Edit/Tab/AddReAuthVerification.php
+++ /dev/null
@@ -1,57 +0,0 @@
-adobeImsReAuthButton = $adobeImsReAuthButton;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * Add adobeIms reAuth button to integration new/edit form
- *
- * @param Info $subject
- * @return void
- */
- public function beforeGetFormHtml(Info $subject): void
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- $form = $subject->getForm();
- if (is_object($form)) {
- $verificationFieldset = $form->getElement('current_user_verification_fieldset');
- if ($verificationFieldset !== null) {
- $this->adobeImsReAuthButton->addAdobeImsReAuthButton($verificationFieldset);
- $subject->setForm($form);
- }
- }
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/SignInPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/SignInPlugin.php
deleted file mode 100644
index 95fdc5e5f025..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/SignInPlugin.php
+++ /dev/null
@@ -1,177 +0,0 @@
-adminAdobeImsConfig = $adminAdobeImsConfig;
- $this->auth = $auth;
- $this->userAuthorized = $userAuthorized;
- $this->serializer = $serializer;
- $this->config = $config;
- }
-
- /**
- * Get authentication component configuration if Admin Adobe IMS is enabled
- *
- * @param SignIn $subject
- * @param callable $proceed
- * @return string
- */
- public function aroundGetComponentJsonConfig(SignIn $subject, callable $proceed): string
- {
- if (!$this->adminAdobeImsConfig->enabled()) {
- return $proceed();
- }
-
- return $this->serializer->serialize(
- array_replace_recursive(
- $this->getDefaultComponentConfig($subject),
- ...$this->getExtendedComponentConfig($subject)
- )
- );
- }
-
- /**
- * Get default UI component configuration
- *
- * @param SignIn $subject
- * @return array
- */
- private function getDefaultComponentConfig(SignIn $subject): array
- {
- return [
- 'component' => SignIn::ADOBE_IMS_JS_SIGNIN,
- 'template' => SignIn::ADOBE_IMS_SIGNIN,
- 'profileUrl' => $subject->getUrl(SignIn::ADOBE_IMS_USER_PROFILE),
- 'logoutUrl' => $subject->getUrl(SignIn::ADOBE_IMS_USER_LOGOUT),
- 'user' => $this->getUserData(),
- 'isGlobalSignInEnabled' => true,
- 'loginConfig' => [
- 'url' => $this->config->getAuthUrl(),
- 'callbackParsingParams' => [
- 'regexpPattern' => SignIn::RESPONSE_REGEXP_PATTERN,
- 'codeIndex' => SignIn::RESPONSE_CODE_INDEX,
- 'messageIndex' => SignIn::RESPONSE_MESSAGE_INDEX,
- 'successCode' => SignIn::RESPONSE_SUCCESS_CODE,
- 'errorCode' => SignIn::RESPONSE_ERROR_CODE
- ]
- ]
- ];
- }
-
- /**
- * Get UI component configuration extension specified in layout configuration for block instance
- *
- * @param SignIn $subject
- * @return array
- */
- private function getExtendedComponentConfig(SignIn $subject): array
- {
- $configProviders = $subject->getData(SignIn::DATA_ARGUMENT_KEY_CONFIG_PROVIDERS);
- if (empty($configProviders)) {
- return [];
- }
-
- $configExtensions = [];
- foreach ($configProviders as $configProvider) {
- if ($configProvider instanceof ConfigProviderInterface) {
- $configExtensions[] = $configProvider->get();
- }
- }
- return $configExtensions;
- }
-
- /**
- * Get user profile information
- *
- * @return array
- */
- private function getUserData(): array
- {
- if (!$this->userAuthorized->execute()) {
- return $this->getDefaultUserData();
- }
-
- $user = $this->auth->getUser();
-
- return [
- 'isAuthorized' => true,
- 'name' => $user->getName(),
- 'email' => $user->getEmail(),
- 'image' => ''
- ];
- }
-
- /**
- * Get default user data for not authenticated or missing user profile
- *
- * @return array
- */
- private function getDefaultUserData(): array
- {
- return [
- 'isAuthorized' => false,
- 'name' => '',
- 'email' => '',
- 'image' => '',
- ];
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/System/Account/Edit/AddReAuthVerification.php b/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/System/Account/Edit/AddReAuthVerification.php
deleted file mode 100644
index b5c134d91da3..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/System/Account/Edit/AddReAuthVerification.php
+++ /dev/null
@@ -1,57 +0,0 @@
-adobeImsReAuthButton = $adobeImsReAuthButton;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * Add adobeIms reAuth button to account edit form
- *
- * @param Form $subject
- * @return void
- */
- public function beforeGetFormHtml(Form $subject): void
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- $form = $subject->getForm();
- if (is_object($form)) {
- $verificationFieldset = $form->getElement('current_user_verification_fieldset');
- if ($verificationFieldset !== null) {
- $this->adobeImsReAuthButton->addAdobeImsReAuthButton($verificationFieldset);
- $subject->setForm($form);
- }
- }
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Edit/Tab/AddReAuthVerification.php b/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Edit/Tab/AddReAuthVerification.php
deleted file mode 100644
index eab147edea7e..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Edit/Tab/AddReAuthVerification.php
+++ /dev/null
@@ -1,57 +0,0 @@
-adobeImsReAuthButton = $adobeImsReAuthButton;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * Add adobeIms reAuth button to user edit and create form
- *
- * @param Main $subject
- * @return void
- */
- public function beforeGetFormHtml(Main $subject): void
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- $form = $subject->getForm();
- if (is_object($form)) {
- $verificationFieldset = $form->getElement('current_user_verification_fieldset');
- if ($verificationFieldset !== null) {
- $this->adobeImsReAuthButton->addAdobeImsReAuthButton($verificationFieldset);
- $subject->setForm($form);
- }
- }
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Role/Tab/AddReAuthVerification.php b/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Role/Tab/AddReAuthVerification.php
deleted file mode 100644
index 9a6656e269fa..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/Block/Adminhtml/User/Role/Tab/AddReAuthVerification.php
+++ /dev/null
@@ -1,57 +0,0 @@
-adobeImsReAuthButton = $adobeImsReAuthButton;
- $this->adminAdobeImsConfig = $adminAdobeImsConfig;
- }
-
- /**
- * Add adobeIms reAuth button to role edit and create form
- *
- * @param Info $subject
- * @return void
- */
- public function beforeGetFormHtml(Info $subject): void
- {
- if ($this->adminAdobeImsConfig->enabled()) {
- $form = $subject->getForm();
- if (is_object($form)) {
- $verificationFieldset = $form->getElement('current_user_verification_fieldset');
- if ($verificationFieldset !== null) {
- $this->adobeImsReAuthButton->addAdobeImsReAuthButton($verificationFieldset);
- $subject->setForm($form);
- }
- }
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/CheckUserLoginBackendObserverPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/CheckUserLoginBackendObserverPlugin.php
deleted file mode 100644
index 52ae88888507..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/CheckUserLoginBackendObserverPlugin.php
+++ /dev/null
@@ -1,47 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Disable login captcha when AdminAdobeIMS Module is enabled
- *
- * @param CheckUserLoginBackendObserver $subject
- * @param callable $proceed
- * @param Observer $observer
- * @return CheckUserLoginBackendObserver|void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundExecute(
- CheckUserLoginBackendObserver $subject,
- callable $proceed,
- Observer $observer
- ) {
- if (!$this->adminImsConfig->enabled()) {
- return $proceed($observer);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/DisableAdminLoginAuthPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/DisableAdminLoginAuthPlugin.php
deleted file mode 100644
index ac2c7d58aa77..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/DisableAdminLoginAuthPlugin.php
+++ /dev/null
@@ -1,64 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->redirectFactory = $redirectFactory;
- $this->messageManager = $messageManager;
- }
-
- /**
- * When trying to call the login but IMS is enabled redirect to the main page with error message
- *
- * @param Auth $subject
- * @param callable $proceed
- * @param string $username
- * @param string $password
- * @return void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundLogin(Auth $subject, callable $proceed, string $username, string $password): void
- {
- if ($this->adminImsConfig->enabled() === false) {
- $proceed($username, $password);
- return;
- }
-
- /** @var Redirect $resultRedirect */
- $resultRedirect = $this->redirectFactory->create();
- $this->messageManager->addErrorMessage(__('Please sign in with Adobe ID'));
- $resultRedirect->setPath('admin');
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/DisableForcedPasswordChangePlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/DisableForcedPasswordChangePlugin.php
deleted file mode 100644
index b7db1ef86b81..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/DisableForcedPasswordChangePlugin.php
+++ /dev/null
@@ -1,42 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Disable forced password change when our module is active
- *
- * @param ObserverConfig $subject
- * @param bool $result
- * @return bool
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function afterIsPasswordChangeForced(ObserverConfig $subject, bool $result): bool
- {
- if ($this->adminImsConfig->enabled() === false) {
- return $result;
- }
- return false;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/DisablePasswordResetPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/DisablePasswordResetPlugin.php
deleted file mode 100644
index 2465c6dcd6d6..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/DisablePasswordResetPlugin.php
+++ /dev/null
@@ -1,42 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Since the password reset module treats 0 as disabled we can just return 0 when our module is enabled
- *
- * @param ObserverConfig $subject
- * @param int $result
- * @return int
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function afterGetAdminPasswordLifetime(ObserverConfig $subject, int $result): int
- {
- if ($this->adminImsConfig->enabled() === false) {
- return $result;
- }
- return 0;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/OtherUserSessionPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/OtherUserSessionPlugin.php
deleted file mode 100644
index 9e501a10e7eb..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/OtherUserSessionPlugin.php
+++ /dev/null
@@ -1,58 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->scopeConfig = $scopeConfig;
- }
-
- /**
- * Allow to have multiple sessions when AdminAdobeIms Module and account sharing is enabled
- *
- * @param AdminSessionsManager $subject
- * @param callable $proceed
- * @return AdminSessionsManager
- */
- public function aroundLogoutOtherUserSessions(
- AdminSessionsManager $subject,
- callable $proceed
- ): AdminSessionsManager {
- if ($this->adminImsConfig->enabled() === false
- || (bool) $this->scopeConfig->getValue(Config::XML_PATH_ADMIN_ACCOUNT_SHARING) === false
- ) {
- return $proceed();
- }
-
- return $subject;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php
deleted file mode 100644
index 7cc18b4e213b..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php
+++ /dev/null
@@ -1,54 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Change Exception message when performIdentityCheck fails
- *
- * @param User $subject
- * @param callable $proceed
- * @param string $passwordString
- * @return mixed
- * @throws AuthenticationException
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundPerformIdentityCheck(User $subject, callable $proceed, string $passwordString)
- {
- if ($this->adminImsConfig->enabled() === false) {
- return $proceed($passwordString);
- }
-
- try {
- return $proceed($passwordString);
- } catch (AuthenticationException $exception) {
- throw new AuthenticationException(
- __('Please perform the AdobeIms reAuth and try again.')
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
deleted file mode 100644
index 4e1b49465821..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/RemovePasswordAndUserConfirmationFormFieldsPlugin.php
+++ /dev/null
@@ -1,77 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Remove user password and confirmation field and hide the user verification fieldset
- *
- * @param WidgetForm $subject
- * @param DataForm $result
- * @return DataForm
- * @SuppressWarnings(PHPMD.CyclomaticComplexity)
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function afterGetForm(WidgetForm $subject, DataForm $result): DataForm
- {
- if ($this->adminImsConfig->enabled() === false) {
- return $result;
- }
-
- if ($result->getElement('base_fieldset')) {
- foreach ($result->getElement('base_fieldset')->getElements() as $element) {
- if ($element->getId() === 'email') {
- $element->setData('note', __('Use the same email user has in Adobe IMS organization.'));
- }
- if ($element->getId() === 'password') {
- $result->getElement('base_fieldset')->removeField($element->getId());
- }
-
- if ($element->getId() === 'confirmation') {
- $result->getElement('base_fieldset')->removeField($element->getId());
- }
- }
- }
-
- if ($result->getElement('current_user_verification_fieldset')) {
- foreach ($result->getElement('current_user_verification_fieldset')->getElements() as $element) {
- if ($element->getId() === 'current_password') {
- $element->setType('hidden');
- $element->setClass('');
-
- /**
- * We can set the value to "randomPassword", because it must just pass the input validation rules
- * we also don't use this value anymore and also don't save this anywhere
- * because we are using the access_token for the verification and not the current user password
- */
- $element->setData('value', 'randomPassword');
- }
- }
- }
-
- return $result;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/RemoveUserValidationRulesPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/RemoveUserValidationRulesPlugin.php
deleted file mode 100644
index 40eee6271dd0..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/RemoveUserValidationRulesPlugin.php
+++ /dev/null
@@ -1,71 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Remove password rule for validator
- *
- * @param UserValidationRules $subject
- * @param callable $proceed
- * @param DataObject $validator
- * @return DataObject
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundAddPasswordRules(
- UserValidationRules $subject,
- callable $proceed,
- DataObject $validator
- ): DataObject {
- if ($this->adminImsConfig->enabled() !== true) {
- return $proceed($validator);
- }
-
- return $validator;
- }
-
- /**
- * Remove password confirmation rule for validator
- *
- * @param UserValidationRules $subject
- * @param callable $proceed
- * @param DataObject $validator
- * @param string $passwordConfirmation
- * @return DataObject
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundAddPasswordConfirmationRule(
- UserValidationRules $subject,
- callable $proceed,
- DataObject $validator,
- string $passwordConfirmation
- ): DataObject {
- if ($this->adminImsConfig->enabled() !== true) {
- return $proceed($validator, $passwordConfirmation);
- }
-
- return $validator;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/ReplaceVerifyIdentityWithImsPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/ReplaceVerifyIdentityWithImsPlugin.php
deleted file mode 100644
index 168b69e37cdd..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/ReplaceVerifyIdentityWithImsPlugin.php
+++ /dev/null
@@ -1,109 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->isTokenValid = $isTokenValid;
- $this->auth = $auth;
- }
-
- /**
- * Verify if the current user has a valid access_token as we do not ask for a password
- *
- * @param User $subject
- * @param callable $proceed
- * @param string $password
- * @return bool
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundVerifyIdentity(User $subject, callable $proceed, string $password): bool
- {
- if ($this->adminImsConfig->enabled() !== true) {
- return $proceed($password);
- }
-
- $valid = $this->verifyImsToken();
-
- $session = $this->auth->getAuthStorage();
- $session->setAdobeReAuthToken(null);
-
- if ($valid) {
- return true;
- }
-
- throw new AuthenticationException(
- __(
- 'The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.'
- )
- );
- }
-
- /**
- * Get and verify IMS Token for current user
- *
- * @return bool
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- */
- private function verifyImsToken(): bool
- {
- $session = $this->auth->getAuthStorage();
- $accessToken = $session->getAdobeAccessToken();
- $reAuthToken = $session->getAdobeReAuthToken();
- if (!$accessToken || !$reAuthToken) {
- throw new AuthenticationException(
- __(
- 'The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.'
- )
- );
- }
-
- return $this->isTokenValid->validateToken($reAuthToken);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/ResetAttemptForBackendObserverPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/ResetAttemptForBackendObserverPlugin.php
deleted file mode 100644
index 66ecb1cea73a..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/ResetAttemptForBackendObserverPlugin.php
+++ /dev/null
@@ -1,44 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Reset Login attempts for backend only if AdminAdobeIms is disabled
- *
- * @param ResetAttemptForBackendObserver $subject
- * @param callable $proceed
- * @param Observer $observer
- * @return void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function aroundExecute(ResetAttemptForBackendObserver $subject, callable $proceed, Observer $observer): void
- {
- if (!$this->adminImsConfig->enabled()) {
- $proceed($observer);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/RevokeAdminAccessTokenPlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/RevokeAdminAccessTokenPlugin.php
deleted file mode 100644
index e8a7f74f3f56..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/RevokeAdminAccessTokenPlugin.php
+++ /dev/null
@@ -1,68 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->flushUserTokens = $flushUserTokens;
- }
-
- /**
- * Get access token(s) by admin id and logout user from Adobe IMS
- *
- * @param AdminTokenService $subject
- * @param bool $result
- * @param int $adminId
- * @return bool
- * @throws LocalizedException
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function afterRevokeAdminAccessToken(
- AdminTokenService $subject,
- bool $result,
- int $adminId
- ): bool {
-
- if ($this->adminImsConfig->enabled() !== true) {
- return $result;
- }
-
- try {
- $this->flushUserTokens->execute($adminId);
- } catch (Exception $exception) {
- throw new LocalizedException(__('The tokens couldn\'t be revoked.'), $exception);
- }
-
- return $result;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Plugin/UserSavePlugin.php b/app/code/Magento/AdminAdobeIms/Plugin/UserSavePlugin.php
deleted file mode 100644
index ea4bfa01797d..000000000000
--- a/app/code/Magento/AdminAdobeIms/Plugin/UserSavePlugin.php
+++ /dev/null
@@ -1,71 +0,0 @@
-adminImsConfig = $adminImsConfig;
- }
-
- /**
- * Generate a random password for new user when AdminAdobeIMS Module is enabled
- *
- * We create a random password for the user, because User Object needs to have a password
- * and this way we do not need to update the db_schema or add a lot of complex preferences
- *
- * @param User $subject
- * @return array
- * @throws Exception
- */
- public function beforeBeforeSave(User $subject): array
- {
- if ($this->adminImsConfig->enabled() !== true) {
- return [];
- }
-
- if (!$subject->getId()) {
- $subject->setPassword($this->generateRandomPassword());
- }
-
- return [];
- }
-
- /**
- * Generate random password string
- *
- * @return string
- * @throws Exception
- */
- private function generateRandomPassword(): string
- {
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.';
-
- $pass = [];
- $alphaLength = strlen($characters) - 1;
- for ($i = 0; $i < 100; $i++) {
- $n = random_int(0, $alphaLength);
- $pass[] = $characters[$n];
- }
- return implode($pass);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/README.md b/app/code/Magento/AdminAdobeIms/README.md
deleted file mode 100644
index 461ac95d7aec..000000000000
--- a/app/code/Magento/AdminAdobeIms/README.md
+++ /dev/null
@@ -1,219 +0,0 @@
-# Magento_Admin_Adobe_Ims module
-The Magento_Admin_Adobe_Ims module contains integration with Adobe IMS for backend authentication.
-
-For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html).
-
-# CLI command usage:
-## bin/magento admin:adobe-ims:enable
-Enables the AdminAdobeIMS Module. \
-Required values are `Organization ID`, `Client ID`, `Client Secret` and `2FA enabled`
-
-### Argument Validation
-On enabling the AdminAdobeIMS Module, the input arguments will be validated. \
-The pattern for the validation are configured in the di.xml
-
-```xml
-
-
-
-
-
-
-
-
-```
-
-We check if the arguments are not empty, as they are all required.
-
-For the Organization ID, Client ID and Client Secret, we check if they contain only alphanumeric characters. \
-Additionally for the Organization ID, we check if it matches 24 characters and optional has the suffix `@AdobeOrg`. But we only store the ID and ignore the suffix.
-Also make sure 2FA is enabled for the Organization in Adobe Admin Console.
-
-## bin/magento admin:adobe-ims:disable
-Disables the AdminAdobeIMS Module.
-When disabling, the `Organization ID`, `Client ID` and `Client Secret` values will be deleted from the config.
-
-## bin/magento admin:adobe-ims:status
-Shows if the AdminAdobeIMS Module is enabled or disabled
-
-## bin/magento admin:adobe-ims:info
-Example of getting data if Admin Adobe Ims module is enabled:\
-Client ID: 1234567890a \
-Organization ID: 1234567890@org \
-Client Secret configured
-
-If Admin Adobe Ims module is disabled, cli command will show message "Module is disabled"
-
-# Admin Login design
-The admin login design changes when the AdminAdobeIms module is enabled and configured correctly via the CLI command.
-We have added the customer layout handle `adobe_ims_login` to deal with all the design changes.
-This handle is added via `\Magento\AdminAdobeIms\Plugin\AddAdobeImsLayoutHandlePlugin::afterAddDefaultHandle`.
-
-The layout file `view/adminhtml/layout/adobe_ims_login.xml` adds:
-* The bundled [Adobe Spectrum CSS](https://opensource.adobe.com/spectrum-css/).
-* New classes to current Magento html items,
-* Our new "Login with Adobe ID" button template,
-* A custom error message wrapper,
-
-We have included the minified css and the used svgs from Spectrum CSS with our module, but you can also use npm to install the latest versions.
-To rebuild the minified css run the command `./node_modules/.bin/postcss -o dist/index.min.css index.css` after npm install from inside the web directory.
-
-# AdminAdobeIMS Callback
-For the AdobeIMS Login we provide a redirect_uri on the request. After a successful Login in AdobeIMS, we get redirected to provided redirect_uri.
-
-In the ImsCallback Controller we get the access_token and then the user profile.
-We then check if the assigned organization is valid and if the user does exist in the Magento database, before we complete the user login in Magento.
-
-If there went something wrong during the authorization, the user gets redirected to the admin login page and an error message is shown.
-
-# Organization ID Validation
-During the authorization we check if the configured `Organization ID` provided on the enabling CLI command is assigned to the user.
-
-In the profile response from Adobe IMS must be a `roles` array. There we have all assigned organizations to the user.
-
-We compare if the configured organization ID does exist in this array and also the structure of the organization ID is valid.
-
-# Admin Backend Login
-Login with the help Adobe IMS Service is implemented. The redirect to Adobe IMS Service is performed-
-The redirect from Adobe IMS is done to \Magento\AdminAdobeIms\Controller\Adminhtml\OAuth\ImsCallback controller.
-
-The access code comes from Adobe, the token response is got on the basis of the access code,
-client id (api key) and client secret (private key).
-The token response access token is used for getting user profile information.
-If this is successful, the admin user will be logged in and the access tokens is added to session as well as token_last_check_time value.
-
-# ACCESS_TOKEN saving in session and validation
-When AdminAdobeIms module is enabled, we check each 10 minutes if ACCESS_TOKEN is still valid.
-For this when admin user login and when session is started, we add 2 extra variables to the session:
-token_last_check_time is current time
-adobe_access_token is ACCESS_TOKEN that we receive during authorization
-
-There is a plugin \Magento\AdminAdobeIms\Plugin\BackendAuthSessionPlugin where we check if token_last_check_time was updated 10 min ago.
-If yes, then we make call to IMS to validate access_token.
-If token is valid, value token_last_check_time will be updated to current time and session prolong.
-If token is not valid, session will be destroyed.
-
-# Admin Backend Logout
-The logout from Adobe IMS Service is performed when Magento Admin User is logged out.
-It's triggered by the event `controller_action_predispatch_adminhtml_auth_logout`
-
-We do external LogOut by call to IMS. Session revoke is standard Magento behavior
-
-# Admin Created Email
-We created an Observer for the `admin_user_save_after` event. \
-There we check if the customer object is newly created or not. \
-When a new admin user got created in Magento, he will then receive an email with further information on how to login.
-
-We use the `admin_emails_new_user_created_template` Template for the content, and also created a new header and footer template for the Admin Adobe IMS module templates.
-They are called `admin_adobe_ims_email_header_template` and `admin_adobe_ims_email_footer_template`.
-
-The notification mail will be sent inside our `AdminNotificationService` where we can add and modify the template variables.
-
-# Error Handling
-For the AdminAdobeIms Module we have two specific error messages and one general error message which are shown on the Admin Login page when an error occured.
-
-### AdobeImsTokenAuthorizationException
-Will be thrown when there was an error during the authorization. \
-e. g. a call to AdobeIMS fails or there was no matching admin found in the Magento database.
-
-### AdobeImsOrganizationAuthorizationException
-Will be thrown when the admin user who wants to log in does not have the configured organization ID assigned to his AdobeIMS Profile.
-
-### Error logging
-Whenever an exception is thrown during the Adobe IMS Login, we will log the specific exception message but show a general error message on the admin login form.
-
-Errors are logged into the `/var/log/admin_adobe_ims.log` file.
-
-Logging can be enabled or disabled in the config on changing the value for `adobe_ims\integration\logging_enabled` or in the Magento Admin Configuration under `Advanced > Developer > Debug`. \
-There you can switch the toggle for `Enable Logging for Admin Adobe IMS Module`
-
-# Password usage in Admin UI
-When the AdobeAdminIMS Module is enabled, we do not need any password fields in the Magento admin backend anymore.
-
-So we removed the "Password" and "Password Confirmation" fields of the user forms.
-This is done by the plugin `\Magento\AdminAdobeIms\Plugin\RemovePasswordAndUserConfirmationFormFieldsPlugin`.
-Here we remove the password and password confirmation field.
-As the verification field is just hidden, we set a random password to bypass the input filters of the Save and Delete user Classes.
-The `\Magento\AdminAdobeIms\Plugin\RemoveUserValidationRulesPlugin` plugin is required to remove the password fields from the form validation.
-We update the "Current User Identity Verification" fieldset to add "Verify Identity with Adobe IMS" button instead "Your Password" field.
-This is done by the plugins: `Magento\AdminAdobeIms\Plugin\Block\Adminhtml\User\Edit\Tab\AddReAuthVerification`, `Magento\AdminAdobeIms\Plugin\Block\Adminhtml\System\Account\Edit\AddReAuthVerification`, `Magento\AdminAdobeIms\Plugin\Block\Adminhtml\User\Role\Tab\AddReAuthVerification` and `Magento\AdminAdobeIms\Plugin\Block\Adminhtml\Integration\Edit\Tab\AddReAuthVerification`.
-
-As we update the current user verification field, we have the `\Magento\AdminAdobeIms\Plugin\ReplaceVerifyIdentityWithImsPlugin` plugin to verify the `AdobeReAuthToken` of the current admin user in AdobeIMS and only proceed when it is valid.
-
-For the newly created user will be a random password generated, as we did not modify the admin_user table, where the password field can not be null.
-This is done in the `\Magento\AdminAdobeIms\Plugin\UserSavePlugin`.
-
-We also disabled the "Change password in 30 days" functionally, as we don't need the Magento admin user password for the login.
-This can be found in the `\Magento\AdminAdobeIms\Plugin\DisableForcedPasswordChangePlugin` and `\Magento\AdminAdobeIms\Plugin\DisablePasswordResetPlugin` Plugins.
-
-When the AdminAdobeIMS Module is disabled, the user can not be log in when using an empty password.
-Instead, the forgot password function must be used to reset the password.
-
-# WEB API authentication using IMS ACCESS_TOKEN
-When Admin Adobe IMS is enabled, Adobe Commerce admin users will stop having credentials (username and password).
-These admin user credentials are needed for getting token that can be used to make requests to admin web APIs.
-It means that will be not possible to create token because admin doesn't have credentials. In these case we have to use IMS access token.
-
-`\Magento\AdminAdobeIms\Model\Authorization\AdobeImsTokenUserContext` new implementation for `\Magento\Authorization\Model\UserContextInterface` was created.
-In the implementation IMS access token is validated and read to get created_at and expires_in data.
-If access_token_hash already exists in admin_adobe_ims_webapi table, then we can get admin_user_id.
-If access_token_hash does not exist in admin_adobe_ims_webapi table, then we have to make request to IMS service to get Adobe user profile, that contain email.
-Using email from Adobe user profile we can check if admin user with these email exists in Magento. If so, we save relevant data into admin_adobe_ims_webapi table.
-If admin user with the email is not found, authentication will fail.
-
-Web Api Token validation via IMS request.
-Each new token (access_token_hash is not exist in admin_adobe_ims_webapi) is validated by using Adobe IMS endpoint validate_token.
-For already existing access_token_hash in admin_adobe_ims_webapi table, validation happens only if last validation was more than 10 min ago.
-Last time validation is saved as last_check_time in admin_adobe_ims_webapi table.
-
-Check if token has expired.
-Access token itself has expires_in value (by default is 24h, but can be adjusted in Adobe side settings).
-Magento has setting: Stores > Settings > Configuration > Services > OAuth > Access Token Expiration (default is 4h).
-Both of values are checked in function isTokenExpired \Magento\AdminAdobeIms\Model\TokenReader.
-it means that with default values is not possible to use tokens that older than 4h.
-
-### IMS access token verification.
-To verify token a public key is required. For more info https://wiki.corp.adobe.com/display/ims/IMS+public+key+retrieval
-In Admin Adobe Ims module was defined path where certificate has to be downloaded from.
-By default, in config.xml, these value for production.
-For testing reasons, developers can override this value, for example in env.php file like this:
-```
-'system' => [
- 'default' => [
- 'adobe_ims' => [
- 'integration' => [
- 'certificate_path' => 'https://static.adobelogin.com/keys/nonprod/',
- ]
- ]
- ]
- ]
-```
-Certificate value is cached.
-
-This authentication mechanism enabled for REST and SOAP web API areas.
-
-Examples, how developers can test functionality:
-curl -X GET "{domain}/rest/V1/customers/2" -H "Authorization: Bearer AddAdobeImsAccessToken"
-curl -X GET "{domain}/rest/V1/products/24-MB01" -H "Authorization: Bearer AddAdobeImsAccessToken"
-
-### Two-factor authentication.
-During CLI enablement of the module, the admin user is asked, whether 2FA is enabled for Organization in Adobe Admin Console.
-If the answer is yes, Magento TFA module (if it's present in the code base), should be disable.
-
-For this purpose the additional config value was added, this config value is read by Magento_TwoFactorAuth module.
-If the config value is not there, the Magento_TwoFactorAuth functionality works by default.
-
-# Updated Current User Identity Verification
-The AdobeAdminIms Module updates the handling of the current user identity verification.
-
-Instead of providing the current user password, the user needs to call the AdobeIms reAuth function.
-We replaced the password field with a "verify identity" button.
-
-By clicking on this button a popup opens with the AdobeIms Login, where the current user must enter his adobe ims password again to verify his identity.
-After successfully validate his identity, we are redirecting to the `Magento/AdminAdobeIms/Controller/Adminhtml/OAuth/ImsReauthCallback.php` Controller and update the `ims_verified` field.
-
-When the form will be submitted, we verify the identity with the `Magento/AdminAdobeIms/Plugin/ReplaceVerifyIdentityWithImsPlugin.php` Plugin.
-Here the existens of the `AdobeAccessToken` and `AdobeReAuthToken` will be checked.
-The reauth_token will be used to call the AdobeIms validateToken Endpoint.
-
-When this call is successful, the form will be submitted, otherwise we update the Message of the thrown `AuthenticationException` to return a matching error message, done by the `Magento/AdminAdobeIms/Plugin/PerformIdentityCheckMessagePlugin.php` Plugin.
diff --git a/app/code/Magento/AdminAdobeIms/Service/AbstractAdminBaseProcessService.php b/app/code/Magento/AdminAdobeIms/Service/AbstractAdminBaseProcessService.php
deleted file mode 100644
index b1ad7bbc19a5..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/AbstractAdminBaseProcessService.php
+++ /dev/null
@@ -1,86 +0,0 @@
-adminUser = $adminUser;
- $this->auth = $auth;
- $this->logOut = $logOut;
- $this->dateTime = $dateTime;
- }
-
- /**
- * Perform login/reauth
- *
- * @param TokenResponseInterface $tokenResponse
- * @param array $profile
- * @return void
- * @throws AdobeImsAuthorizationException
- */
- abstract public function execute(TokenResponseInterface $tokenResponse, array $profile = []): void;
-
- /**
- * If log in attempt failed, we should clean the Adobe IMS Session
- *
- * @param string $accessToken
- * @return void
- * @throws AdobeImsAuthorizationException
- */
- protected function externalLogout(string $accessToken): void
- {
- try {
- $this->logOut->execute($accessToken);
- } catch (Exception $exception) {
- throw new AdobeImsAuthorizationException(
- __($exception->getMessage())
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/AdminLoginProcessService.php b/app/code/Magento/AdminAdobeIms/Service/AdminLoginProcessService.php
deleted file mode 100644
index 6face4e362e5..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/AdminLoginProcessService.php
+++ /dev/null
@@ -1,59 +0,0 @@
-getAdminUser($profile);
- $this->auth->loginByUsername($adminUser['username']);
- $session = $this->auth->getAuthStorage();
- $session->setAdobeAccessToken($tokenResponse->getAccessToken());
- $session->setTokenLastCheckTime($this->dateTime->gmtTimestamp());
- } catch (Exception $exception) {
- $this->externalLogout($tokenResponse->getAccessToken());
- throw new AdobeImsAuthorizationException(
- __($exception->getMessage())
- );
- }
- }
-
- /**
- * Get Admin User for profile
- *
- * @param array $profile
- * @return array
- * @throws AdobeImsAuthorizationException
- */
- private function getAdminUser(array $profile): array
- {
- $adminUser = $this->adminUser->loadByEmail($profile['email']);
- if (empty($adminUser['user_id'])) {
- throw new AdobeImsAuthorizationException(
- __('No matching admin user found for Adobe ID.')
- );
- }
-
- return $adminUser;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/AdminNotificationService.php b/app/code/Magento/AdminAdobeIms/Service/AdminNotificationService.php
deleted file mode 100644
index 8a62286b8d74..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/AdminNotificationService.php
+++ /dev/null
@@ -1,91 +0,0 @@
-adminImsConfig = $adminImsConfig;
- $this->backendUrl = $backendUrl;
- $this->storeManager = $storeManager;
- $this->emailNotification = $emailNotification;
- }
-
- /**
- * Send a welcome mail to created admin user
- *
- * @param UserInterface $user
- * @return void
- * @throws LocalizedException
- * @throws MailException
- * @throws NoSuchEntityException
- */
- public function sendWelcomeMailToAdminUser(UserInterface $user): void
- {
- if (!$this->adminImsConfig->enabled()) {
- return;
- }
-
- $backendUrl = $this->backendUrl->getRouteUrl('adminhtml');
-
- $emailTemplate = $this->adminImsConfig->getEmailTemplateForNewAdminUsers();
-
- $this->emailNotification->sendNotificationEmail(
- $emailTemplate,
- [
- 'user' => $user,
- 'store' => $this->storeManager->getStore(
- Store::DEFAULT_STORE_ID
- ),
- 'cta_link' => $backendUrl
- ],
- $user->getEmail(),
- $user->getFirstName() . ' ' . $user->getLastName()
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/AdminReauthProcessService.php b/app/code/Magento/AdminAdobeIms/Service/AdminReauthProcessService.php
deleted file mode 100644
index 37a96b53655f..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/AdminReauthProcessService.php
+++ /dev/null
@@ -1,38 +0,0 @@
-auth->getAuthStorage();
- $session->setAdobeReAuthToken($tokenResponse->getAccessToken());
- $session->setReAuthTokenLastCheckTime($this->dateTime->gmtTimestamp());
- } catch (Exception $exception) {
- $this->externalLogout($tokenResponse->getAccessToken());
- throw new AdobeImsAuthorizationException(
- __($exception->getMessage())
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/ImsCommandOptionService.php b/app/code/Magento/AdminAdobeIms/Service/ImsCommandOptionService.php
deleted file mode 100644
index ce0c16b4b1bb..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/ImsCommandOptionService.php
+++ /dev/null
@@ -1,311 +0,0 @@
-imsCommandValidationService = $imsCommandValidationService;
- }
-
- /**
- * Get Organization ID from option arguments or create prompt
- *
- * @param InputInterface $input
- * @param OutputInterface $output
- * @param mixed $helper
- * @param string $optionArgument
- * @return string
- * @throws LocalizedException
- */
- public function getOrganizationId(
- InputInterface $input,
- OutputInterface $output,
- $helper,
- string $optionArgument
- ): string {
- $organizationId = trim($input->getOption($optionArgument) ?? '');
-
- if (!$organizationId) {
- $question = $this->askForOrganizationId();
- $organizationId = $helper->ask($input, $output, $question);
- } else {
- $organizationId = $this->organizationIdValidation($organizationId);
- }
-
- return $organizationId;
- }
-
- /**
- * Get Client ID from option arguments or create prompt
- *
- * @param InputInterface $input
- * @param OutputInterface $output
- * @param mixed $helper
- * @param string $optionArgument
- * @return string
- * @throws LocalizedException
- */
- public function getClientId(
- InputInterface $input,
- OutputInterface $output,
- $helper,
- string $optionArgument
- ): string {
- $clientId = trim($input->getOption($optionArgument) ?? '');
-
- if (!$clientId) {
- $question = $this->askForClientId();
- $clientId = $helper->ask($input, $output, $question);
- } else {
- $clientId = $this->clientIdValidation($clientId);
- }
-
- return $clientId;
- }
-
- /**
- * Get Client Secret from option arguments or create prompt
- *
- * @param InputInterface $input
- * @param OutputInterface $output
- * @param mixed $helper
- * @param string $optionArgument
- * @return string
- * @throws LocalizedException
- */
- public function getClientSecret(
- InputInterface $input,
- OutputInterface $output,
- $helper,
- string $optionArgument
- ): string {
- $clientSecret = trim($input->getOption($optionArgument) ?? '');
-
- if (!$clientSecret) {
- $question = $this->askForClientSecret();
- $clientSecret = $helper->ask($input, $output, $question);
- } else {
- $clientSecret = $this->clientSecretValidation($clientSecret);
- }
-
- return $clientSecret;
- }
-
- /**
- * Get 2FA State from option arguments or create prompt
- *
- * @param InputInterface $input
- * @param OutputInterface $output
- * @param mixed $helper
- * @param string $optionArgument
- * @return bool
- * @throws LocalizedException
- */
- public function isTwoFactorAuthEnabled(
- InputInterface $input,
- OutputInterface $output,
- $helper,
- string $optionArgument
- ): bool {
- $twoFactorAuthEnabled = trim($input->getOption($optionArgument) ?? '');
-
- if (!$twoFactorAuthEnabled) {
- $question = $this->askForTwoFactorAuth();
- $twoFactorAuthEnabled = $helper->ask($input, $output, $question);
- } else {
- $twoFactorAuthEnabled = $this->twoFactorAuthValidation($twoFactorAuthEnabled);
- }
-
- return $twoFactorAuthEnabled;
- }
-
- /**
- * Prepare Question for parameter
- *
- * @param string $paramName
- * @return Question
- */
- private function prepareQuestion(string $paramName): Question
- {
- return new Question(
- sprintf(self::OPTION_QUESTION, $paramName),
- ''
- );
- }
-
- /**
- * Prepare Question for 2FA State
- *
- * @return ConfirmationQuestion
- */
- private function prepareQuestionForTwoFactorAuth(): ConfirmationQuestion
- {
- return new ConfirmationQuestion(
- self::TWO_FACTOR_OPTION_QUESTION,
- false
- );
- }
-
- /**
- * Prepare Question for organization id
- *
- * @return Question
- */
- private function askForOrganizationId(): Question
- {
- $question = $this->prepareQuestion(self::ORGANIZATION_ID_NAME);
- $question->setValidator(
- function ($value) {
- return $this->organizationIdValidation($value);
- }
- );
-
- return $question;
- }
-
- /**
- * Prepare Question for client id
- *
- * @return Question
- */
- private function askForClientId(): Question
- {
- $question = $this->prepareQuestion(self::CLIENT_ID_NAME);
- $question->setValidator(
- function ($value) {
- return $this->clientIdValidation($value);
- }
- );
-
- return $question;
- }
-
- /**
- * Prepare Hidden Question for client secret
- *
- * @return Question
- */
- private function askForClientSecret(): Question
- {
- $question = $this->prepareQuestion(self::CLIENT_SECRET_NAME);
- $question->setHidden(true);
- $question->setHiddenFallback(false);
- $question->setValidator(
- function ($value) {
- return $this->clientSecretValidation($value);
- }
- );
-
- return $question;
- }
-
- /**
- * Prepare Question for 2FA state
- *
- * @return Question
- */
- private function askForTwoFactorAuth(): Question
- {
- return $this->prepareQuestionForTwoFactorAuth();
- }
-
- /**
- * Validation for organizationId
- *
- * @param string $organizationId
- * @return string
- * @throws LocalizedException
- */
- private function organizationIdValidation(string $organizationId): string
- {
- return $this->imsCommandValidationService->organizationIdValidator($organizationId);
- }
-
- /**
- * Validation for clientId
- *
- * @param string $clientId
- * @return string
- * @throws LocalizedException
- */
- private function clientIdValidation(string $clientId): string
- {
- return $this->imsCommandValidationService->clientIdValidator($clientId);
- }
-
- /**
- * Validation for clientSecret
- *
- * @param string $clientSecret
- * @return string
- * @throws LocalizedException
- */
- private function clientSecretValidation(string $clientSecret): string
- {
- return $this->imsCommandValidationService->clientSecretValidator($clientSecret);
- }
-
- /**
- * Validation for twoFactorAuth
- *
- * @param string $twoFactorAuthEnabled
- * @return bool
- * @throws LocalizedException
- */
- private function twoFactorAuthValidation(string $twoFactorAuthEnabled): bool
- {
- return $this->imsCommandValidationService->twoFactorAuthValidator($twoFactorAuthEnabled);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/ImsCommandValidationService.php b/app/code/Magento/AdminAdobeIms/Service/ImsCommandValidationService.php
deleted file mode 100644
index d27a7339ee3e..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/ImsCommandValidationService.php
+++ /dev/null
@@ -1,150 +0,0 @@
-organizationIdRegex = $organizationIdRegex;
- $this->clientIdRegex = $clientIdRegex;
- $this->clientSecretRegex = $clientSecretRegex;
- $this->twoFactorAuthRegex = $twoFactorAuthRegex;
- }
-
- /**
- * Validate that value is not empty
- *
- * @param string $value
- * @return string
- * @throws LocalizedException
- */
- private function emptyValueValidator(string $value): string
- {
- if (trim($value) === '') {
- throw new LocalizedException(
- __('This field is required to enable the Admin Adobe IMS Module')
- );
- }
-
- return trim($value);
- }
-
- /**
- * Validate Organization ID
- *
- * @param string $value
- * @return string
- * @throws LocalizedException
- */
- public function organizationIdValidator(string $value): string
- {
- $value = $this->emptyValueValidator($value);
-
- /** @todo: use this for ImsOrganizationService::validateAndExtractOrganizationId() */
- if (preg_match($this->organizationIdRegex, $value, $match)
- && isset($match[1])
- ) {
- return $match[1];
- }
-
- throw new LocalizedException(
- __('No valid Organization ID provided')
- );
- }
-
- /**
- * Validate Client ID
- *
- * @param string $value
- * @return string
- * @throws LocalizedException
- */
- public function clientIdValidator(string $value): string
- {
- $value = $this->emptyValueValidator($value);
-
- if (preg_match($this->clientIdRegex, $value)) {
- throw new LocalizedException(
- __('No valid Client ID provided')
- );
- }
-
- return $value;
- }
-
- /**
- * Validate Client Secret
- *
- * @param string $value
- * @return string
- * @throws LocalizedException
- */
- public function clientSecretValidator(string $value): string
- {
- $value = $this->emptyValueValidator($value);
-
- if (preg_match($this->clientSecretRegex, $value)) {
- throw new LocalizedException(
- __('No valid Client Secret provided')
- );
- }
-
- return $value;
- }
-
- /**
- * Validate Two-Factor Auth enabled state
- *
- * @param string $value
- * @return bool
- * @throws LocalizedException
- */
- public function twoFactorAuthValidator(string $value): bool
- {
- $value = $this->emptyValueValidator($value);
-
- if (preg_match($this->twoFactorAuthRegex, $value)) {
- return true;
- }
-
- return false;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/ImsConfig.php b/app/code/Magento/AdminAdobeIms/Service/ImsConfig.php
deleted file mode 100644
index a9b416204c68..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/ImsConfig.php
+++ /dev/null
@@ -1,71 +0,0 @@
-scopeConfig = $scopeConfig;
- }
-
- /**
- * Check if module is enabled
- *
- * @return bool
- */
- public function enabled(): bool
- {
- return (bool) $this->scopeConfig->getValue(
- self::XML_PATH_ENABLED
- );
- }
-
- /**
- * Check if module error-logging is enabled
- *
- * @return bool
- */
- public function loggingEnabled(): bool
- {
- return (bool) $this->scopeConfig->getValue(
- self::XML_PATH_LOGGING_ENABLED
- );
- }
-
- /**
- * Get email template for new created admin users
- *
- * @return string
- */
- public function getEmailTemplateForNewAdminUsers(): string
- {
- return (string) $this->scopeConfig->getValue(
- self::XML_PATH_NEW_ADMIN_EMAIL_TEMPLATE
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Service/UpdateTokensService.php b/app/code/Magento/AdminAdobeIms/Service/UpdateTokensService.php
deleted file mode 100644
index e859269305cf..000000000000
--- a/app/code/Magento/AdminAdobeIms/Service/UpdateTokensService.php
+++ /dev/null
@@ -1,54 +0,0 @@
-revokedRepo = $revokedRepo;
- $this->adminUserCollection = $adminUserCollectionFactory->create();
- }
-
- /**
- * Token invalidation for the admin users
- *
- * @return void
- */
- public function execute(): void
- {
- $adminUsers = $this->adminUserCollection->getItems();
- foreach ($adminUsers as $adminUser) {
- //Invalidating all tokens issued before current datetime.
- $this->revokedRepo->saveRevoked(
- new Revoked((int) UserContextInterface::USER_TYPE_ADMIN, (int) $adminUser->getId(), time())
- );
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminAdobeImsSignInActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminAdobeImsSignInActionGroup.xml
deleted file mode 100644
index abeaed22c225..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminAdobeImsSignInActionGroup.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
- Admin Adobe IMS Sign in
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminCreateUserWithoutPasswordActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminCreateUserWithoutPasswordActionGroup.xml
deleted file mode 100644
index a682821c5bac..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminCreateUserWithoutPasswordActionGroup.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
- Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided Role and User.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminDisableAdobeImsActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminDisableAdobeImsActionGroup.xml
deleted file mode 100644
index 973b8f8e260c..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminDisableAdobeImsActionGroup.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- Runs bin/magento command to disable Admin Adobe Ims module
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminEnableAdobeImsActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminEnableAdobeImsActionGroup.xml
deleted file mode 100644
index ca809e24f3db..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AdminEnableAdobeImsActionGroup.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
- Runs bin/magento command to enable Admin Adobe Ims module
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInEmptyCodeErrorMessageTestActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInEmptyCodeErrorMessageTestActionGroup.xml
deleted file mode 100644
index d083777145e8..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInEmptyCodeErrorMessageTestActionGroup.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
- Check for Error Message on Admin Adobe IMS Sign in.
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInWithAdobeIdTestActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInWithAdobeIdTestActionGroup.xml
deleted file mode 100644
index c46364f26501..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertAdminSignInWithAdobeIdTestActionGroup.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
- Check for Sign in with Adobe ID button.
-
-
-
-
-
-
-
- {{AdobeImsNotesData.note_left}}
- {$adminSignInWithAdobeIdOrganizationNoteLeft}
-
-
-
-
-
- {{AdobeImsNotesData.note_right}}
- {$adminSignInWithAdobeIdOrganizationNoteRight}
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertDisableAdminSignInWithAdobeIdTestActionGroup.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertDisableAdminSignInWithAdobeIdTestActionGroup.xml
deleted file mode 100644
index 7dedfd45631e..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/ActionGroup/AssertDisableAdminSignInWithAdobeIdTestActionGroup.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
- Check for Sign in with Adobe ID button not being shown.
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/AdobeImsNotesData.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/AdobeImsNotesData.xml
deleted file mode 100644
index 526713a9b104..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/AdobeImsNotesData.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
- Sign in to access the Adobe Commerce for your organization.
- This Commerce instance is managed by an organization. Contact your organization administrator to request access.
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/ClientCredentialsData.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/ClientCredentialsData.xml
deleted file mode 100644
index 2eec8d1de225..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Data/ClientCredentialsData.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
- {{_CREDS.magento/admin_adobe_ims_org_id}}
- {{_CREDS.magento/admin_adobe_ims_client_id}}
- {{_CREDS.magento/admin_adobe_ims_client_key}}
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Page/AdminAdobeImsCallbackPage.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Page/AdminAdobeImsCallbackPage.xml
deleted file mode 100755
index ea584f6aab66..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Page/AdminAdobeImsCallbackPage.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminAdobeImsSignInSection.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminAdobeImsSignInSection.xml
deleted file mode 100644
index 3581319c86b7..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminAdobeImsSignInSection.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminCreateUserSection.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminCreateUserSection.xml
deleted file mode 100644
index acd65c5e342e..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminCreateUserSection.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInErrorMessageSection.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInErrorMessageSection.xml
deleted file mode 100644
index 8dcdb8b8b8ba..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInErrorMessageSection.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInWithAdobeIdSection.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInWithAdobeIdSection.xml
deleted file mode 100644
index fd1e82884f66..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Section/AdminSignInWithAdobeIdSection.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsDisabledInfoCommandTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsDisabledInfoCommandTest.xml
deleted file mode 100644
index d542a273391d..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsDisabledInfoCommandTest.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Module is disabled
- infoAdminAdobeIms
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsEnabledInfoCommandTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsEnabledInfoCommandTest.xml
deleted file mode 100644
index 94cdfbedf006..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminAdobeImsEnabledInfoCommandTest.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skipped
-
-
-
-
-
-
-
-
-
-
-
-
-
- /Client ID: [\w.-]+\nOrganization ID: ([\w.-]+)|([\w.-]@+[\w.-])\nClient Secret (configured)|(not configured)\n/
- infoAdminAdobeIms
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminCreateNewAdminUserWithAdobeImsTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminCreateNewAdminUserWithAdobeImsTest.xml
deleted file mode 100644
index 864e425b053f..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminCreateNewAdminUserWithAdobeImsTest.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skipped
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminDisableSignInWithAdobeIdTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminDisableSignInWithAdobeIdTest.xml
deleted file mode 100644
index 4f2309b35d23..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminDisableSignInWithAdobeIdTest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminSignInWithAdobeIdTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminSignInWithAdobeIdTest.xml
deleted file mode 100644
index 8313183713e6..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/AdminSignInWithAdobeIdTest.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Skipped
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CallbackWithoutCodeRedirectsToAdminLoginTest.xml b/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CallbackWithoutCodeRedirectsToAdminLoginTest.xml
deleted file mode 100644
index 68ba28fdaa69..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Mftf/Test/CallbackWithoutCodeRedirectsToAdminLoginTest.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Skipped
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Command/AdminAdobeImsEnableCommandTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Command/AdminAdobeImsEnableCommandTest.php
deleted file mode 100755
index 195b4be7c930..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Command/AdminAdobeImsEnableCommandTest.php
+++ /dev/null
@@ -1,247 +0,0 @@
-adminImsConfigMock = $this->createMock(ImsConfig::class);
- $this->authorizationUrlMock = $this->createMock(AuthorizationInterface::class);
- $this->imsCommandOptionService = $this->createMock(ImsCommandOptionService::class);
- $this->typeListInterface = $this->createMock(TypeListInterface::class);
- $this->updateTokensService = $this->createMock(UpdateTokensService::class);
- $roleCollectionMock = $this->createPartialMock(
- RoleCollection::class,
- ['addFieldToFilter', 'getSize']
- );
- $roleCollectionMock->method('addFieldToFilter')->willReturnSelf();
- $this->roleCollection = $this->createPartialMock(
- CollectionFactory::class,
- ['create']
- );
- $this->roleCollection->method('create')->willReturn(
- $roleCollectionMock
- );
- $this->role = $this->getMockBuilder(Role::class)
- ->setMethods(['setParentId','setRoleType','setUserId','setRoleName','setUserType','save'])
- ->disableOriginalConstructor()
- ->getMock();
- $this->role->method('setRoleName')->willReturnSelf();
- $this->role->method('setUserType')->willReturnSelf();
- $this->role->method('setUserId')->willReturnSelf();
- $this->role->method('setRoleType')->willReturnSelf();
- $this->role->method('setParentId')->willReturnSelf();
- $this->role->method('save')->willReturnSelf();
-
- $this->questionHelperMock = $this->getMockBuilder(QuestionHelper::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->enableCommand = $objectManagerHelper->getObject(
- AdminAdobeImsEnableCommand::class,
- [
- 'adminImsConfig' => $this->adminImsConfigMock,
- 'imsCommandOptionService' => $this->imsCommandOptionService,
- 'cacheTypeList' => $this->typeListInterface,
- 'updateTokenService' => $this->updateTokensService,
- 'authorization' => $this->authorizationUrlMock,
- 'role' => $this->role,
- 'roleCollection' => $this->roleCollection
- ]
- );
- }
-
- /**
- * Test AdminAdobeIms Command calls cache clear and return correct message
- *
- * @param bool $testAuthMode
- * @param InvokedCountMatcher$enableMethodCallExpection
- * @param InvokedCountMatcher $cleanMethodCallExpection
- * @param string $outputMessage
- * @param bool $isTwoFactorAuthEnabled
- * @return void
- * @throws Exception
- * @dataProvider cliCommandProvider
- */
- public function testAdminAdobeImsModuleEnableWillClearCacheWhenSuccessful(
- bool $testAuthMode,
- InvokedCountMatcher $enableMethodCallExpection,
- InvokedCountMatcher $cleanMethodCallExpection,
- string $outputMessage,
- bool $isTwoFactorAuthEnabled
- ): void {
- $inputMock = $this->getMockBuilder(InputInterface::class)
- ->getMockForAbstractClass();
-
- $outputMock = $this->getMockBuilder(OutputInterface::class)
- ->getMockForAbstractClass();
-
- $this->questionHelperMock->method('ask')->willReturn('ORGId');
-
- $this->imsCommandOptionService->method('getOrganizationId')->willReturn('orgId');
- $this->imsCommandOptionService->method('getClientId')->willReturn('clientId');
- $this->imsCommandOptionService->method('getClientSecret')->willReturn('clientSecret');
- $this->imsCommandOptionService->method('isTwoFactorAuthEnabled')->willReturn($isTwoFactorAuthEnabled);
-
- $this->authorizationUrlMock->method('testAuth')
- ->willReturn($testAuthMode);
-
- $this->adminImsConfigMock
- ->expects($enableMethodCallExpection)
- ->method('enableModule');
-
- $this->typeListInterface
- ->expects($cleanMethodCallExpection)
- ->method('cleanType')
- ->with(Config::TYPE_IDENTIFIER);
-
- $this->updateTokensService
- ->expects($cleanMethodCallExpection)
- ->method('execute');
-
- $outputMock->expects($this->once())
- ->method('writeln')
- ->with($outputMessage, null)
- ->willReturnSelf();
-
- $this->enableCommand->setHelperSet($this->getHelperSet());
- $this->enableCommand->run($inputMock, $outputMock);
- }
-
- /**
- * DataProvider for CLI Command
- *
- * @return array[]
- */
- public function cliCommandProvider(): array
- {
- return [
- [
- true,
- $this->once(),
- $this->once(),
- 'Admin Adobe IMS integration is enabled',
- true
- ],
- [
- false,
- $this->never(),
- $this->never(),
- 'The Client ID, Client Secret, Organization ID and 2FA are required ' .
- 'when enabling the Admin Adobe IMS Module',
- true
- ],
- [
- true,
- $this->never(),
- $this->never(),
- 'The Client ID, Client Secret, Organization ID and 2FA are required ' .
- 'when enabling the Admin Adobe IMS Module',
- false
- ],
- [
- false,
- $this->never(),
- $this->never(),
- 'The Client ID, Client Secret, Organization ID and 2FA are required ' .
- 'when enabling the Admin Adobe IMS Module',
- false
- ]
- ];
- }
-
- /**
- * Create a new HelperSet
- *
- * @return HelperSet
- */
- private function getHelperSet(): HelperSet
- {
- return new HelperSet([
- new FormatterHelper(),
- new DebugFormatterHelper(),
- new ProcessHelper(),
- 'question' => $this->questionHelperMock,
- ]);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserContextTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserContextTest.php
deleted file mode 100644
index a5d530e42594..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserContextTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-objectManager = new ObjectManager($this);
-
- $this->adminSession = $this->getMockBuilder(Session::class)
- ->disableOriginalConstructor()
- ->setMethods(['getUser', 'getId','getAdobeAccessToken'])
- ->getMock();
-
- $this->adminImsConfigMock = $this->createMock(ImsConfig::class);
- $this->auth = $this->createMock(Auth::class);
- $this->isTokenValid = $this->createMock(IsTokenValidInterface::class);
- $this->adminTokenUserService = $this->createMock(AdobeImsAdminTokenUserService::class);
- $this->auth
- ->method('getAuthStorage')
- ->willReturn($this->adminSession);
-
- $this->adminImsConfigMock->expects($this->any())
- ->method('enabled')
- ->willReturn(true);
-
- $this->adobeImsAdminTokenUserContext = $this->objectManager->getObject(
- AdobeImsAdminTokenUserContext::class,
- [
- 'adminImsConfig' => $this->adminImsConfigMock,
- 'auth' => $this->auth,
- 'isTokenValid' => $this->isTokenValid,
- 'adminTokenUserService' => $this->adminTokenUserService,
- ]
- );
- }
-
- public function testGetUserId()
- {
- $userId = 1;
-
- $this->setupUserId($userId);
-
- $this->assertEquals($userId, $this->adobeImsAdminTokenUserContext->getUserId());
- }
-
- /**
- * Test exception with invalid access token
- *
- * @return void
- * @throws AuthenticationException
- */
- public function testExceptionWhenAccessTokenNotValid(): void
- {
- $this->adminSession->expects($this->any())
- ->method('getAdobeAccessToken')
- ->willReturn('test');
-
- $this->isTokenValid
- ->expects($this->once())
- ->method('validateToken')
- ->willReturn(false);
-
- $this->expectException(AuthenticationException::class);
- $this->expectExceptionMessage('Session Access Token is not valid');
-
- $this->adobeImsAdminTokenUserContext->getUserId();
- }
-
- public function testGetUserType()
- {
- $this->assertEquals(UserContextInterface::USER_TYPE_ADMIN, $this->adobeImsAdminTokenUserContext->getUserType());
- }
-
- /**
- * Setting up User Id
- *
- * @param int|null $userId
- * @return void
- */
- public function setupUserId($userId)
- {
- $this->adminSession->expects($this->any())
- ->method('getAdobeAccessToken')
- ->willReturn(null);
-
- if ($userId) {
- $userMock = $this->getMockBuilder(User::class)
- ->disableOriginalConstructor()
- ->setMethods(['getUserId'])
- ->getMock();
-
- $userMock->expects($this->once())
- ->method('getUserId')
- ->willReturn($userId);
-
- $this->adminSession->expects($this->once())
- ->method('getUser')
- ->willReturn($userMock);
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserServiceTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserServiceTest.php
deleted file mode 100644
index 89a6a7da699a..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/Authorization/AdobeImsAdminTokenUserServiceTest.php
+++ /dev/null
@@ -1,329 +0,0 @@
-adminImsConfigMock = $this->createMock(ImsConfig::class);
- $this->token = $this->createMock(GetTokenInterface::class);
- $this->profile = $this->createMock(GetProfileInterface::class);
- $this->organizationMembership = $this->createMock(OrganizationMembershipInterface::class);
- $this->adminLoginProcessService = $this->createMock(AdminLoginProcessService::class);
- $this->requestInterfaceMock = $this->getMockBuilder(RequestInterface::class)
- ->setMethods(['getHeader','getParam'])
- ->disableOriginalConstructor()
- ->getMockForAbstractClass();
- $this->adminReauthProcessService = $this->createMock(AdminReauthProcessService::class);
- $this->tokenResponseFactoryMock = $this->createMock(TokenResponseInterfaceFactory::class);
- $this->saveImsUser = $this->createMock(SaveImsUserInterface::class);
- $this->adminImsConfigMock->expects($this->any())
- ->method('enabled')
- ->willReturn(true);
-
- $this->adobeImsAdminTokenUserService = new AdobeImsAdminTokenUserService(
- $this->adminImsConfigMock,
- $this->organizationMembership,
- $this->adminLoginProcessService,
- $this->adminReauthProcessService,
- $this->requestInterfaceMock,
- $this->token,
- $this->profile,
- $this->tokenResponseFactoryMock,
- $this->saveImsUser
- );
- }
-
- /**
- * Test Process Login Request
- *
- * @return void
- * @param array $responseData
- * @dataProvider responseDataProvider
- */
- public function testProcessLoginRequest(array $responseData): void
- {
- $this->requestInterfaceMock->expects($this->exactly(2))
- ->method('getParam')->with('code')->willReturn(self::CODE);
-
- $this->requestInterfaceMock->expects($this->once())
- ->method('getModuleName')->willReturn('adobe_ims_auth');
-
- $tokenResponse = $this->createMock(TokenResponseInterface::class);
- $tokenResponse->expects($this->any())
- ->method('getAccessToken')
- ->willReturn($responseData['access_token']);
-
- $this->token->expects($this->once())
- ->method('getTokenResponse')
- ->with(self::CODE)
- ->willReturn($tokenResponse);
-
- $this->profile->expects($this->once())
- ->method('getProfile')
- ->with($responseData['access_token'])
- ->willReturn($responseData);
-
- $this->organizationMembership->expects($this->once())
- ->method('checkOrganizationMembership')
- ->with($responseData['access_token']);
-
- $this->saveImsUser->expects($this->once())
- ->method('save')
- ->with($responseData);
-
- $this->adminLoginProcessService->expects($this->once())
- ->method('execute')
- ->with($tokenResponse, $responseData);
-
- $this->adobeImsAdminTokenUserService->processLoginRequest();
- }
-
- /**
- * Test Process Login Request
- *
- * @return void
- * @param array $responseData
- * @dataProvider responseDataProvider
- */
- public function testProcessLoginRequestWithAuthorizationHeader(array $responseData): void
- {
- $this->requestInterfaceMock->expects($this->once())
- ->method('getModuleName')->willReturn('adobe_ims_auth');
-
- $this->requestInterfaceMock->expects($this->exactly(2))
- ->method('getHeader')
- ->with('Authorization')
- ->willReturn('Bearer kladjflakdjf3423rfzddsf');
-
- $data = ['access_token' => 'kladjflakdjf3423rfzddsf'];
-
- $tokenResponse = $this->createMock(TokenResponseInterface::class);
- $this->tokenResponseFactoryMock->expects($this->once())
- ->method('create')
- ->with(['data' => $data])
- ->willReturn($tokenResponse);
-
- $tokenResponse->expects($this->any())
- ->method('getAccessToken')
- ->willReturn($responseData['access_token']);
-
- $this->profile->expects($this->once())
- ->method('getProfile')
- ->with($data['access_token'])
- ->willReturn($responseData);
-
- $this->organizationMembership->expects($this->once())
- ->method('checkOrganizationMembership')
- ->with($responseData['access_token']);
-
- $this->saveImsUser->expects($this->once())
- ->method('save')
- ->with($responseData);
-
- $this->adminLoginProcessService->expects($this->once())
- ->method('execute')
- ->with($tokenResponse, $responseData);
-
- $this->adobeImsAdminTokenUserService->processLoginRequest();
- }
-
- /**
- * Test exception when tried to access from other module
- *
- * @return void
- * @throws AuthenticationException
- */
- public function testExceptionWhenTriedToAccessFromOtherModule(): void
- {
- $this->requestInterfaceMock->expects($this->once())
- ->method('getModuleName')->willReturn('Test Module');
-
- $this->expectException(AuthenticationException::class);
- $this->expectExceptionMessage('An authentication error occurred. Verify and try again.');
-
- $this->adobeImsAdminTokenUserService->processLoginRequest();
- }
-
- /**
- * Test exception when profile not found
- *
- * @return void
- * @param array $responseData
- * @dataProvider responseDataProvider
- * @throws AuthenticationException
- */
- public function testExceptionWhenProfileNotFoundBasedOnAccessToken(array $responseData): void
- {
- $this->requestInterfaceMock->expects($this->exactly(2))
- ->method('getParam')->with('code')->willReturn(self::CODE);
-
- $this->requestInterfaceMock->expects($this->once())
- ->method('getModuleName')->willReturn('adobe_ims_auth');
-
- $tokenResponse = $this->createMock(TokenResponseInterface::class);
- $tokenResponse->expects($this->any())
- ->method('getAccessToken')
- ->willReturn($responseData['access_token']);
-
- $this->token->expects($this->once())
- ->method('getTokenResponse')
- ->with(self::CODE)
- ->willReturn($tokenResponse);
-
- $this->profile->expects($this->once())
- ->method('getProfile')
- ->with($responseData['access_token'])
- ->willReturn('');
-
- $this->expectException(AuthenticationException::class);
- $this->expectExceptionMessage('An authentication error occurred. Verify and try again.');
-
- $this->adobeImsAdminTokenUserService->processLoginRequest();
- }
-
- /**
- * Test exception when admin login provided with wrong info
- *
- * @return void
- * @param array $responseData
- * @dataProvider responseDataProvider
- * @throws AdobeImsAuthorizationException
- */
- public function testExceptionWhenAdminLoginProcessCalledWithWrongInfo(array $responseData): void
- {
- $this->requestInterfaceMock->expects($this->exactly(2))
- ->method('getParam')->with('code')->willReturn(self::CODE);
-
- $this->requestInterfaceMock->expects($this->once())
- ->method('getModuleName')->willReturn('adobe_ims_auth');
-
- $tokenResponse = $this->createMock(TokenResponseInterface::class);
- $tokenResponse->expects($this->any())
- ->method('getAccessToken')
- ->willReturn($responseData['access_token']);
-
- $this->token->expects($this->once())
- ->method('getTokenResponse')
- ->with(self::CODE)
- ->willReturn($tokenResponse);
-
- $this->profile->expects($this->once())
- ->method('getProfile')
- ->with($responseData['access_token'])
- ->willReturn($responseData);
-
- $this->adminLoginProcessService->expects($this->once())
- ->method('execute')
- ->with($tokenResponse, $responseData)
- ->willThrowException(new AdobeImsAuthorizationException(
- __('You don\'t have access to this Commerce instance')
- ));
-
- $this->expectException(AdobeImsAuthorizationException::class);
- $this->expectExceptionMessage('You don\'t have access to this Commerce instance');
-
- $this->adobeImsAdminTokenUserService->processLoginRequest();
- }
-
- /**
- * Data provider for response.
- *
- * @return array
- */
- public function responseDataProvider(): array
- {
- return
- [
- [
- 'tokenResponse' => [
- 'name' => 'Test User',
- 'email' => 'user@test.com',
- 'access_token' => 'kladjflakdjf3423rfzddsf',
- 'refresh_token' => 'kladjflakdjf3423rfzddsf',
- 'expires_in' => 1642259230998,
- 'first_name' => 'Test',
- 'last_name' => 'User'
- ]
- ]
- ];
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiRepositoryTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiRepositoryTest.php
deleted file mode 100644
index b6804a78d1da..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiRepositoryTest.php
+++ /dev/null
@@ -1,350 +0,0 @@
-objectManager = new ObjectManager($this);
- $this->resource = $this->createMock(ImsWebapiResource::class);
- $this->entityFactory = $this->createMock(ImsWebapiInterfaceFactory::class);
- $this->loggerMock = $this->createMock(LoggerInterface::class);
- $this->entityCollectionFactory = $this->getMockBuilder(CollectionFactory::class)
- ->disableOriginalConstructor()
- ->setMethods(['create'])
- ->getMock();
-
- $this->collectionProcessor = $this->createMock(CollectionProcessorInterface::class);
- $this->searchResultsFactory = $this->createPartialMock(
- ImsWebapiSearchResultsInterfaceFactory::class,
- ['create']
- );
- $this->searchCriteriaBuilder = $this->createPartialMock(
- SearchCriteriaBuilder::class,
- ['create', 'addFilter']
- );
-
- $this->model = new ImsWebapiRepository(
- $this->resource,
- $this->entityFactory,
- $this->loggerMock,
- $this->entityCollectionFactory,
- $this->collectionProcessor,
- $this->searchResultsFactory,
- $this->searchCriteriaBuilder
- );
- }
-
- /**
- * Test saving
- *
- * @return void
- * @throws CouldNotSaveException
- */
- public function testSave(): void
- {
- $imsWebapi = $this->objectManager->getObject(ImsWebapi::class);
- $this->resource->expects($this->once())
- ->method('save')
- ->with($imsWebapi);
- $this->model->save($imsWebapi);
- }
-
- /**
- * Test save with exception.
- *
- * @return void
- */
- public function testSaveWithException(): void
- {
- $this->expectException(CouldNotSaveException::class);
- $this->expectExceptionMessage('Could not save ims token.');
-
- $imsWebapi = $this->createMock(ImsWebapi::class);
- $this->resource->expects($this->once())
- ->method('save')
- ->with($imsWebapi)
- ->willThrowException(
- new CouldNotSaveException(__('Could not save ims token.'))
- );
- $this->loggerMock->expects($this->once())->method('critical');
- $this->model->save($imsWebapi);
- }
-
- /**
- * Test get id.
- */
- public function testGet(): void
- {
- $entity = $this->objectManager->getObject(ImsWebapi::class)->setId(1);
- $this->entityFactory->method('create')
- ->willReturn($entity);
- $this->assertEquals($this->model->get(1)->getId(), 1);
- }
-
- /**
- * Test get ims web API id with exception.
- *
- * @return void
- */
- public function testGetWithException(): void
- {
- $this->expectException(NoSuchEntityException::class);
- $this->expectExceptionMessage('The ims token wasn\'t found.');
-
- $entity = $this->objectManager->getObject(ImsWebapi::class);
- $this->entityFactory->method('create')
- ->willReturn($entity);
- $this->resource->expects($this->once())
- ->method('load')
- ->willThrowException(
- new NoSuchEntityException(__('The ims token wasn\'t found.'))
- );
- $this->model->get(1);
- }
-
- /**
- * Initializing collection of ims webapi
- *
- * @return array
- */
- protected function initCollection(): array
- {
- $collectionSize = 1;
- $searchCriteriaMock = $this->getMockBuilder(SearchCriteriaInterface::class)
- ->setMethods(['getPageSize'])
- ->getMockForAbstractClass();
-
- $searchCriteriaMock->expects($this->any())
- ->method('getPageSize')
- ->willReturn($collectionSize);
-
- $this->searchCriteriaBuilder->expects($this->any())
- ->method('create')
- ->willReturn($searchCriteriaMock);
- $this->searchCriteriaBuilder->expects($this->any())
- ->method('addFilter')
- ->willReturnSelf();
-
- $collection = $this->getMockBuilder(Collection::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $imsWebapiMock = $this->createMock(ImsWebapi::class);
-
- $collection->expects($this->once())
- ->method('getItems')
- ->willReturn([$imsWebapiMock]);
-
- $this->entityCollectionFactory->expects($this->once())
- ->method('create')
- ->willReturn($collection);
-
- $collection->expects($this->once())
- ->method('getSize')
- ->willReturn($collectionSize);
-
- $this->collectionProcessor->expects($this->once())
- ->method('process')
- ->with($searchCriteriaMock, $collection)
- ->willReturnSelf();
- $searchResultsMock = $this->createSearchResultsMock($searchCriteriaMock, $imsWebapiMock, $collectionSize);
-
- $searchResultsMock->expects($this->any())
- ->method('getItems')
- ->willReturn([$imsWebapiMock]);
-
- $this->searchResultsFactory->expects($this->once())
- ->method('create')
- ->willReturn($searchResultsMock);
-
- return [
- 'imsWebapiMock' => [$imsWebapiMock],
- 'searchCriteriaMock' => $searchCriteriaMock,
- 'searchResultsMock' => $searchResultsMock
- ];
- }
-
- /**
- * Test get by ims webapi id.
- *
- * @return void
- * @throws NoSuchEntityException
- */
- public function testGetByAdminUserId(): void
- {
- $collectionInfo = $this->initCollection();
- $this->assertEquals($collectionInfo['imsWebapiMock'], $this->model->getByAdminUserId(1));
- }
-
- /**
- * Test get list
- *
- * @return void
- * @throws NoSuchEntityException
- */
- public function testGetList(): void
- {
- $collectionInfo = $this->initCollection();
-
- $this->assertEquals(
- $collectionInfo['searchResultsMock'],
- $this->model->getList($collectionInfo['searchCriteriaMock'])
- );
- }
-
- /**
- * Creating mock for the search results object
- *
- * @param MockObject $searchCriteriaMock
- * @param MockObject $imsWebapiMock
- * @param int $collectionSize
- * @return MockObject
- */
- protected function createSearchResultsMock($searchCriteriaMock, $imsWebapiMock, $collectionSize = 1): MockObject
- {
- /** @var MockObject $searchResultsMock */
- $searchResultsMock = $this->getMockBuilder(ImsWebapiSearchResultsInterface::class)
- ->getMockForAbstractClass();
-
- $searchResultsMock->expects($this->once())
- ->method('setSearchCriteria')
- ->with($searchCriteriaMock);
- $searchResultsMock->expects($this->any())
- ->method('setItems')
- ->with([$imsWebapiMock]);
- $searchResultsMock->expects($this->any())
- ->method('setTotalCount')
- ->with($collectionSize);
-
- return $searchResultsMock;
- }
-
- /**
- * Test successful deletion of ims web API
- *
- * @return void
- * @throws LocalizedException
- * @throws NoSuchEntityException
- */
- public function testDeleteByAdminUserId(): void
- {
- $adminUserId = 1;
-
- $collectionInfo = $this->initCollection();
-
- $this->resource->expects($this->exactly(1))
- ->method('delete')
- ->with($collectionInfo['imsWebapiMock'][0])
- ->willReturnSelf();
-
- $this->assertTrue($this->model->deleteByAdminUserId($adminUserId));
- }
-
- /**
- * Test non-successful deletion of ims webapi
- *
- * @return void
- * @throws NoSuchEntityException
- * @throws LocalizedException
- */
- public function testDeleteWithException(): void
- {
- $adminUserId = 1;
- $message = 'Could not delete ims tokens for admin user id %d.';
- $this->expectException(CouldNotDeleteException::class);
- $this->expectExceptionMessage(sprintf($message, $adminUserId));
- $collectionInfo = $this->initCollection();
-
- $this->resource->expects($this->exactly(1))
- ->method('delete')
- ->with($collectionInfo['imsWebapiMock'][0])
- ->willThrowException(
- new CouldNotDeleteException(__(
- $message,
- $adminUserId
- ))
- );
-
- $this->model->deleteByAdminUserId($adminUserId);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiTest.php
deleted file mode 100644
index 3a86352264d7..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Model/ImsWebapiTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-objectManager = new ObjectManager($this);
- $this->model = $this->objectManager->getObject(ImsWebapi::class);
- }
-
- /**
- * Test setAccessToken
- */
- public function testAccessTokenHash(): void
- {
- $value = 'value1';
- $this->model->setAccessTokenHash($value);
- $this->assertSame($value, $this->model->getAccessTokenHash());
- }
-
- /**
- * Test setAccessTokenExpiresAt
- */
- public function testAccessTokenExpiresAt(): void
- {
- $value = 'value1';
- $this->model->setAccessTokenExpiresAt($value);
- $this->assertSame($value, $this->model->getAccessTokenExpiresAt());
- }
-
- /**
- * Test setCreatedAt
- */
- public function testCreatedAt(): void
- {
- $value = 'value1';
- $this->model->setCreatedAt($value);
- $this->assertSame($value, $this->model->getCreatedAt());
- }
-
- /**
- * Test setUpdatedAt
- */
- public function testUpdatedAt(): void
- {
- $value = 'value1';
- $this->model->setUpdatedAt($value);
- $this->assertSame($value, $this->model->getUpdatedAt());
- }
-
- /**
- * Test setAdminUserId
- */
- public function testAdminUserId(): void
- {
- $value = 42;
- $this->model->setAdminUserId($value);
- $this->assertSame($value, $this->model->getAdminUserId());
- }
-
- /**
- * Test setExtensionAttributes
- */
- public function testExtensionAttributes(): void
- {
- $value = $this->createMock(ImsWebapiExtensionInterface::class);
- $this->model->setExtensionAttributes($value);
- $this->assertSame($value, $this->model->getExtensionAttributes());
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/AdminForgotPasswordPluginTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/AdminForgotPasswordPluginTest.php
deleted file mode 100644
index 30537aaa20f2..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/AdminForgotPasswordPluginTest.php
+++ /dev/null
@@ -1,128 +0,0 @@
-redirectFactory = $this->createMock(RedirectFactory::class);
- $this->adminImsConfigMock = $this->createMock(ImsConfig::class);
- $this->messageManagerMock = $this->createMock(MessageManagerInterface::class);
-
- $this->plugin = $objectManagerHelper->getObject(
- AdminForgotPasswordPlugin::class,
- [
- 'redirectFactory' => $this->redirectFactory,
- 'adminImsConfig' => $this->adminImsConfigMock,
- 'messageManager' => $this->messageManagerMock,
- ]
- );
- }
-
- /**
- * Test plugin redirects to admin login when AdminAdobeIms Module is enabled
- *
- * @return void
- */
- public function testPluginRedirectsToLoginPageWhenModuleIsEnabled(): void
- {
- $subject = $this->createMock(Forgotpassword::class);
- $redirect = $this->createMock(Redirect::class);
- $redirect->method('setPath')
- ->willReturnSelf();
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(true);
-
- $this->redirectFactory
- ->expects($this->once())
- ->method('create')
- ->willReturn($redirect);
-
- $this->messageManagerMock->expects($this->once())
- ->method('addErrorMessage')
- ->with('Please sign in with Adobe ID', null)
- ->willReturnSelf();
-
- $closure = function () {
- return $this->createMock(Redirect::class);
- };
-
- $this->assertEquals($redirect, $this->plugin->aroundExecute($subject, $closure));
- }
-
- /**
- * Test plugin proceeds when AdminAdobeIms Module is disabled
- *
- * @return void
- */
- public function testPluginProceedsWhenModuleIsDisabled(): void
- {
- $subject = $this->createMock(Forgotpassword::class);
- $redirect = $this->createMock(Redirect::class);
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(false);
-
- $this->redirectFactory
- ->expects($this->never())
- ->method('create')
- ->willReturn($redirect);
-
- $this->messageManagerMock->expects($this->never())
- ->method('addErrorMessage')
- ->with('Please sign in with Adobe ID', null)
- ->willReturnSelf();
-
- $closure = function () {
- return $this->createMock(Redirect::class);
- };
-
- $this->assertEquals($redirect, $this->plugin->aroundExecute($subject, $closure));
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/Block/Adminhtml/SignInPluginTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/Block/Adminhtml/SignInPluginTest.php
deleted file mode 100644
index cfbd91534bd2..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/Block/Adminhtml/SignInPluginTest.php
+++ /dev/null
@@ -1,212 +0,0 @@
-createMock(ConfigInterface::class);
- $configMock->expects($this->once())
- ->method('getAuthUrl')
- ->willReturn(self::AUTH_URL);
-
- $this->userAuthorizedMock = $this->createMock(UserAuthorizedInterface::class);
- $this->serializer = $this->createMock(JsonHexTag::class);
- $this->adminAdobeImsConfig = $this->createMock(ImsConfig::class);
- $this->auth = $this->createMock(Auth::class);
-
- $objectManager = new ObjectManager($this);
- $this->signInPlugin = $objectManager->getObject(
- SignInPlugin::class,
- [
- 'adminAdobeImsConfig' => $this->adminAdobeImsConfig,
- 'auth' => $this->auth,
- 'userAuthorized' => $this->userAuthorizedMock,
- 'serializer' => $this->serializer,
- 'config' => $configMock
- ]
- );
- }
-
- /**
- * @dataProvider userDataProvider
- * @param array $userData
- * @param array $configProviderData
- * @param array $expectedData
- * @param bool $isAuthorized
- */
- public function testAroundGetComponentJsonConfig(
- array $userData,
- array $configProviderData,
- array $expectedData,
- bool $isAuthorized
- ): void {
- $this->userAuthorizedMock->expects($this->once())
- ->method('execute')
- ->willReturn($userData['isAuthorized']);
-
- $userProfile = $this->createMock(User::class);
- if ($isAuthorized) {
- $userProfile->method('getName')->willReturn($userData['name']);
- $userProfile->method('getEmail')->willReturn($userData['email']);
- }
-
- $this->adminAdobeImsConfig->method('enabled')->willReturn(true);
- $this->auth->method('getUser')->willReturn($userProfile);
-
- $subject = $this->createMock(SignIn::class);
- $configProviderMock = $this->createMock(ConfigProviderInterface::class);
- $configProviderMock->method('get')->willReturn($configProviderData);
- $subject->method('getData')->willReturn($configProviderMock);
- $subject->method('getUrl')->willReturn(self::PROFILE_URL);
-
- $serializedResult = 'Some result';
- $this->serializer->expects($this->once())
- ->method('serialize')
- ->with($expectedData)
- ->willReturn($serializedResult);
-
- $closure = function () {
- return $this->createMock(SignIn::class);
- };
-
- $this->assertEquals($serializedResult, $this->signInPlugin->aroundGetComponentJsonConfig($subject, $closure));
- }
-
- /**
- * Returns default component config
- *
- * @param array $userData
- * @return array
- */
- private function getDefaultComponentConfig(array $userData): array
- {
- return [
- 'component' => 'Magento_AdobeIms/js/signIn',
- 'template' => 'Magento_AdobeIms/signIn',
- 'profileUrl' => self::PROFILE_URL,
- 'logoutUrl' => self::LOGOUT_URL,
- 'user' => $userData,
- 'isGlobalSignInEnabled' => true,
- 'loginConfig' => [
- 'url' => self::AUTH_URL,
- 'callbackParsingParams' => [
- 'regexpPattern' => self::RESPONSE_REGEXP_PATTERN,
- 'codeIndex' => self::RESPONSE_CODE_INDEX,
- 'messageIndex' => self::RESPONSE_MESSAGE_INDEX,
- 'successCode' => self::RESPONSE_SUCCESS_CODE,
- 'errorCode' => self::RESPONSE_ERROR_CODE
- ]
- ]
- ];
- }
-
- /**
- * @return array
- */
- public function userDataProvider(): array
- {
- return [
- 'Existing authorized user' => [
- [
- 'isAuthorized' => true,
- 'name' => 'John Doe',
- 'email' => 'john@email.com',
- ],
- [],
- $this->getDefaultComponentConfig([
- 'isAuthorized' => true,
- 'name' => 'John Doe',
- 'email' => 'john@email.com',
- 'image' => ''
- ]),
- true
- ],
- 'Existing non-authorized user' => [
- [
- 'isAuthorized' => false,
- 'name' => 'John Doe',
- 'email' => 'john@email.com',
- 'image' => 'image.png'
- ],
- [],
- $this->getDefaultComponentConfig($this->getDefaultUserData()),
- false
- ],
- ];
- }
-
- /**
- * Get default user data for an assertion
- *
- * @return array
- */
- private function getDefaultUserData(): array
- {
- return [
- 'isAuthorized' => false,
- 'name' => '',
- 'email' => '',
- 'image' => '',
- ];
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/ReplaceVerifyIdentityWithImsPluginTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/ReplaceVerifyIdentityWithImsPluginTest.php
deleted file mode 100644
index 16c780240a03..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Plugin/ReplaceVerifyIdentityWithImsPluginTest.php
+++ /dev/null
@@ -1,252 +0,0 @@
-storageMock = $this->getMockBuilder(StorageInterface::class)
- ->setMethods(['getAdobeAccessToken', 'getAdobeReAuthToken', 'setAdobeReAuthToken'])
- ->getMockForAbstractClass();
-
- $this->authMock = $this->getMockBuilder(Auth::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->adminImsConfigMock = $this->createMock(ImsConfig::class);
- $this->isTokenValid = $this->createMock(IsTokenValidInterface::class);
-
- $this->plugin = $objectManagerHelper->getObject(
- ReplaceVerifyIdentityWithImsPlugin::class,
- [
- 'adminImsConfig' => $this->adminImsConfigMock,
- 'isTokenValid' => $this->isTokenValid,
- 'auth' => $this->authMock,
- ]
- );
- }
-
- /**
- * Test plugin proceeds when AdminAdobeIms Module is disabled
- *
- * @return void
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- */
- public function testAroundVerifyIdentityCallsProceedWhenModuleIsDisabled(): void
- {
- $this->authMock->expects($this->never())
- ->method('getAuthStorage');
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(false);
-
- $subject = $this->createMock(User::class);
-
- $expectedResult = true;
-
- $proceed = function () use ($expectedResult) {
- return $expectedResult;
- };
-
- $this->isTokenValid
- ->expects($this->never())
- ->method('validateToken');
-
- $this->assertEquals($expectedResult, $this->plugin->aroundVerifyIdentity($subject, $proceed, ''));
- }
-
- /**
- * Test Plugin verifies access_token
- *
- * @return void
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- */
- public function testAroundVerifyIdentityVerifiesAccessTokenWhenModuleIsEnabled(): void
- {
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeAccessToken')
- ->willReturn('accessToken');
-
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeReAuthToken')
- ->willReturn('reAuthToken');
-
- $this->authMock->expects($this->atLeastOnce())
- ->method('getAuthStorage')
- ->willReturn($this->storageMock);
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(true);
-
- $subject = $this->createMock(User::class);
-
- $this->isTokenValid
- ->expects($this->once())
- ->method('validateToken')
- ->willReturn(true);
-
- $expectedResult = true;
-
- $proceed = function () use ($expectedResult) {
- return $expectedResult;
- };
-
- $this->assertEquals($expectedResult, $this->plugin->aroundVerifyIdentity($subject, $proceed, ''));
- }
-
- /**
- * Test Plugin throws exception when access_token is invalid
- *
- * @return void
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- */
- public function testAroundVerifyIdentityThrowsExceptionOnInvalidToken(): void
- {
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeAccessToken')
- ->willReturn('invalidToken');
-
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeReAuthToken')
- ->willReturn('invalidToken');
-
- $this->authMock->expects($this->atLeastOnce())
- ->method('getAuthStorage')
- ->willReturn($this->storageMock);
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(true);
-
- $subject = $this->createMock(User::class);
-
- $this->isTokenValid
- ->expects($this->once())
- ->method('validateToken')
- ->willReturn(false);
-
- $this->expectException(AuthenticationException::class);
- $this->expectExceptionMessage('The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.');
-
- $expectedResult = true;
-
- $proceed = function () use ($expectedResult) {
- return $expectedResult;
- };
-
- $this->assertEquals($expectedResult, $this->plugin->aroundVerifyIdentity($subject, $proceed, ''));
- }
-
- /**
- * Test Plugin throws exception when access_token is invalid
- *
- * @return void
- * @throws AuthenticationException
- * @throws AuthorizationException
- * @throws NoSuchEntityException
- */
- public function testAroundVerifyIdentityThrowsExceptionOnEmptyToken(): void
- {
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeAccessToken')
- ->willReturn(null);
-
- $this->storageMock
- ->expects($this->once())
- ->method('getAdobeReAuthToken')
- ->willReturn(null);
-
- $this->authMock->expects($this->once())
- ->method('getAuthStorage')
- ->willReturn($this->storageMock);
-
- $this->adminImsConfigMock
- ->expects($this->once())
- ->method('enabled')
- ->willReturn(true);
-
- $subject = $this->createMock(User::class);
-
- $this->isTokenValid
- ->expects($this->never())
- ->method('validateToken');
-
- $this->expectException(AuthenticationException::class);
- $this->expectExceptionMessage('The account sign-in was incorrect or your account is disabled temporarily. '
- . 'Please wait and try again later.');
-
- $expectedResult = true;
-
- $proceed = function () use ($expectedResult) {
- return $expectedResult;
- };
-
- $this->assertEquals($expectedResult, $this->plugin->aroundVerifyIdentity($subject, $proceed, ''));
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Service/AdminLoginProcessServiceTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Service/AdminLoginProcessServiceTest.php
deleted file mode 100644
index 859432ee4551..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Service/AdminLoginProcessServiceTest.php
+++ /dev/null
@@ -1,150 +0,0 @@
-adminUser = $this->createMock(User::class);
- $this->logOut = $this->createMock(LogOut::class);
- $this->dateTime = $this->createMock(DateTime::class);
-
- $session = $this->getMockBuilder(StorageInterface::class)
- ->addMethods(['setAdobeAccessToken', 'setTokenLastCheckTime'])
- ->getMockForAbstractClass();
- $session
- ->method('setAdobeAccessToken')
- ->willReturnSelf();
- $session
- ->method('setTokenLastCheckTime')
- ->willReturnSelf();
-
- $this->auth = $this->createMock(Auth::class);
- $this->auth
- ->method('getAuthStorage')
- ->willReturn($session);
-
- $this->tokenResponse = $this->createMock(TokenResponseInterface::class);
- $this->tokenResponse
- ->method('getAccessToken')
- ->willReturn('accessToken');
-
- $this->loginService = $objectManagerHelper->getObject(
- AdminLoginProcessService::class,
- [
- 'adminUser' => $this->adminUser,
- 'auth' => $this->auth,
- 'logOut' => $this->logOut,
- 'dateTime' => $this->dateTime
- ]
- );
- }
-
- /**
- * @return void
- * @throws AdobeImsAuthorizationException
- */
- public function testExceptionWillBeThrownWhenNoUserFound(): void
- {
- $this->adminUser
- ->method('loadByEmail')
- ->willReturn([]);
-
- $this->logOut
- ->expects($this->once())
- ->method('execute')
- ->with('accessToken');
-
- $this->expectException(AdobeImsAuthorizationException::class);
- $this->expectExceptionMessage('No matching admin user found for Adobe ID.');
-
- $this->loginService->execute($this->tokenResponse, ['email' => self::TEST_EMAIL]);
- }
-
- /**
- * @return void
- * @throws AdobeImsAuthorizationException
- */
- public function testExceptionWillBeThrownWhenAuthenticationFails(): void
- {
- $this->adminUser
- ->method('loadByEmail')
- ->willReturn([
- 'user_id' => '1',
- 'username' => 'admin',
- 'email' => self::TEST_EMAIL,
- ]);
-
- $this->auth
- ->method('loginByUsername')
- ->willThrowException(new Exception(self::ERROR_MESSAGE));
-
- $this->logOut
- ->expects($this->once())
- ->method('execute')
- ->with('accessToken');
-
- $this->expectException(AdobeImsAuthorizationException::class);
- $this->expectExceptionMessage(self::ERROR_MESSAGE);
-
- $this->loginService->execute($this->tokenResponse, ['email' => self::TEST_EMAIL]);
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/Test/Unit/Service/ImsCommandOptionServiceTest.php b/app/code/Magento/AdminAdobeIms/Test/Unit/Service/ImsCommandOptionServiceTest.php
deleted file mode 100644
index 857cf2efbdbd..000000000000
--- a/app/code/Magento/AdminAdobeIms/Test/Unit/Service/ImsCommandOptionServiceTest.php
+++ /dev/null
@@ -1,315 +0,0 @@
-imsCommandValidationServiceMock = $this->getMockBuilder(ImsCommandValidationService::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->inputMock = $this->getMockBuilder(InputInterface::class)
- ->getMockForAbstractClass();
-
- $this->outputMock = $this->getMockBuilder(OutputInterface::class)
- ->getMockForAbstractClass();
-
- $this->imsCommandOptionService = $objectManagerHelper->getObject(
- ImsCommandOptionService::class,
- [
- 'imsCommandValidationService' => $this->imsCommandValidationServiceMock
- ]
- );
- }
-
- /**
- * @dataProvider validInput
- * @param string $argument
- * @param string $value
- * @param string $validatorMethod
- * @return void
- * @throws LocalizedException
- */
- public function testValidInputWillBeReturned(string $argument, string $value, string $validatorMethod): void
- {
- $helperMock = $this->getMockBuilder(QuestionHelper::class)
- ->getMock();
-
- $this->inputMock
- ->method('getOption')
- ->with($argument)
- ->willReturn($value);
-
- $this->imsCommandValidationServiceMock
- ->method($validatorMethod)
- ->with($value)
- ->willReturn($value);
-
- $input = $this->executeGetOption($argument, $helperMock);
-
- $this->assertEquals(
- $value,
- $input
- );
- }
-
- /**
- * @dataProvider validInput
- * @param string $argument
- * @param string $value
- * @param string $validatorMethod
- * @return void
- * @throws LocalizedException
- */
- public function testOrganizationIdPromptReturnsOrgId(
- string $argument,
- string $value,
- string $validatorMethod
- ): void {
- $this->inputMock
- ->method('getOption')
- ->with($argument)
- ->willReturn('');
-
- $this->imsCommandValidationServiceMock
- ->method($validatorMethod)
- ->with($value)
- ->willReturn($value);
-
- $helperMock = $this->getMockBuilder(QuestionHelper::class)
- ->getMock();
- $helperMock->method('ask')
- ->willReturn($value)
- ;
-
- $input = $this->executeGetOption($argument, $helperMock);
-
- $this->assertEquals(
- $value,
- $input
- );
- }
-
- /**
- * @dataProvider validInput
- * @param string $argument
- * @param string $value
- * @param string $validatorMethod
- * @return void
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function testEmptyOrganizationIdThrowsException(
- string $argument,
- string $value,
- string $validatorMethod
- ): void {
- $this->inputMock
- ->method('getOption')
- ->with($argument)
- ->willReturn('');
-
- $expectedExceptionMessage = __('This field is required to enable the Admin Adobe IMS Module');
- $expectedException = new LocalizedException($expectedExceptionMessage);
-
- $helperMock = $this->getMockBuilder(QuestionHelper::class)
- ->getMock();
- $helperMock->method('ask')
- ->willThrowException($expectedException)
- ;
-
- $this->expectException(LocalizedException::class);
- $this->expectExceptionMessage('This field is required to enable the Admin Adobe IMS Module');
-
- $this->executeGetOption($argument, $helperMock);
- }
-
- /**
- * @dataProvider invalidInput
- * @param $argument
- * @param $value
- * @param $validatorMethod
- * @param $exceptionMessage
- * @return void
- */
- public function testInvalidOrganizationIdThrowsException(
- $argument,
- $value,
- $validatorMethod,
- $exceptionMessage
- ): void {
- $this->inputMock
- ->method('getOption')
- ->with($argument)
- ->willReturn($value);
-
- $expectedExceptionMessage = __($exceptionMessage);
- $expectedException = new LocalizedException($expectedExceptionMessage);
-
- $helperMock = $this->getMockBuilder(QuestionHelper::class)
- ->getMock();
-
- $this->imsCommandValidationServiceMock
- ->method($validatorMethod)
- ->with($value)
- ->willThrowException($expectedException);
-
- $this->expectException(LocalizedException::class);
- $this->expectExceptionMessage($exceptionMessage);
-
- $this->executeGetOption($argument, $helperMock);
- }
-
- /**
- * @param $argument
- * @param $helperMock
- * @return string|null
- * @throws LocalizedException
- */
- public function executeGetOption($argument, $helperMock): ?string
- {
- $input = null;
- switch ($argument) {
- case 'organization-id':
- $input = $this->imsCommandOptionService->getOrganizationId(
- $this->inputMock,
- $this->outputMock,
- $helperMock,
- $argument
- );
- break;
- case 'client-id':
- $input = $this->imsCommandOptionService->getClientId(
- $this->inputMock,
- $this->outputMock,
- $helperMock,
- $argument
- );
- break;
- case 'client-secret':
- $input = $this->imsCommandOptionService->getClientSecret(
- $this->inputMock,
- $this->outputMock,
- $helperMock,
- $argument
- );
- break;
- }
-
- return $input;
- }
-
- /**
- * Data provider for valid CLI Input
- * - option name
- * - option value
- * - validator method
- *
- * @return string[][]
- */
- public function validInput(): array
- {
- return [
- [
- 'organization-id',
- self::VALID_ORGANIZATION_ID,
- 'organizationIdValidator'
- ],
- [
- 'organization-id',
- self::VALID_ORGANIZATION_ID_ALTERNATE,
- 'organizationIdValidator'
- ],
- [
- 'client-id',
- self::VALID_CLIENT_ID,
- 'clientIdValidator'
- ],
- [
- 'client-secret',
- self::VALID_CLIENT_SECRET,
- 'clientSecretValidator'
- ]
- ];
- }
-
- /**
- * Data provider for valid CLI Input
- * - option name
- * - option value
- * - validator method
- * - exception message
- *
- * @return string[][]
- */
- public function invalidInput(): array
- {
- return [
- [
- 'organization-id',
- self::INVALID_ORGANIZATION_ID,
- 'organizationIdValidator',
- 'No valid Organization ID provided'
- ],
- [
- 'client-id',
- self::INVALID_CLIENT_ID,
- 'clientIdValidator',
- 'No valid Client ID provided'
- ],
- [
- 'client-secret',
- self::INVALID_CLIENT_SECRET,
- 'clientSecretValidator',
- 'No valid Client Secret provided'
- ]
- ];
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/ViewModel/LinkViewModel.php b/app/code/Magento/AdminAdobeIms/ViewModel/LinkViewModel.php
deleted file mode 100644
index c5e3929e8e4b..000000000000
--- a/app/code/Magento/AdminAdobeIms/ViewModel/LinkViewModel.php
+++ /dev/null
@@ -1,102 +0,0 @@
-logger = $logger;
- $this->messageManager = $messageManager;
-
- try {
- $this->authUrl = $authorization->getAuthUrl();
- } catch (InvalidArgumentException $e) {
- $this->logger->error($e->getMessage());
- $this->authUrl = null;
- $this->addImsErrorMessage(
- 'Could not connect to Adobe IMS.',
- $e->getMessage()
- );
- } catch (\Exception $e) {
- $this->logger->error($e->getMessage());
- $this->authUrl = null;
- $this->addImsErrorMessage(
- 'Could not connect to Adobe IMS.',
- 'Something went wrong during Adobe IMS connection check.'
- );
- }
- }
-
- /**
- * Check if authorization Url is not empty
- *
- * @return bool
- */
- public function isActive(): bool
- {
- return $this->authUrl !== '';
- }
-
- /**
- * Get authorization URL for Login Button
- *
- * @return string|null
- */
- public function getButtonLink(): ?string
- {
- return $this->authUrl;
- }
-
- /**
- * Add Admin Adobe IMS Error Message
- *
- * @param string $headline
- * @param string $message
- * @return void
- */
- private function addImsErrorMessage(string $headline, string $message): void
- {
- $this->messageManager->addComplexErrorMessage(
- 'adminAdobeImsMessage',
- [
- 'headline' => __($headline)->getText(),
- 'message' => __($message)->getText()
- ]
- );
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/ViewModel/MessageViewModel.php b/app/code/Magento/AdminAdobeIms/ViewModel/MessageViewModel.php
deleted file mode 100644
index 5d05d7f8281c..000000000000
--- a/app/code/Magento/AdminAdobeIms/ViewModel/MessageViewModel.php
+++ /dev/null
@@ -1,42 +0,0 @@
-interpretationStrategy = $interpretationStrategy;
- }
-
- /**
- * We are using this as the core block automatically wraps the error messages.
- *
- * @see \Magento\Framework\View\Element\Messages::_renderMessagesByType
- * @param array $messages
- * @return string
- */
- public function getMessagesHtml(array $messages): string
- {
- $html = '';
- foreach ($messages as $message) {
- $html .= $this->interpretationStrategy->interpret($message);
- }
- return $html;
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/composer.json b/app/code/Magento/AdminAdobeIms/composer.json
deleted file mode 100644
index 623d2ceb77a0..000000000000
--- a/app/code/Magento/AdminAdobeIms/composer.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "magento/module-admin-adobe-ims",
- "description": "N/A",
- "config": {
- "sort-packages": true
- },
- "require": {
- "php": "~8.1.0||~8.2.0",
- "magento/framework": "*",
- "magento/module-adobe-ims": "*",
- "magento/module-adobe-ims-api": "*",
- "magento/module-config": "*",
- "magento/module-backend": "*",
- "magento/module-user": "*",
- "magento/module-captcha": "*",
- "magento/module-authorization": "*",
- "magento/module-store": "*",
- "magento/module-email": "*",
- "magento/module-integration": "*",
- "magento/module-jwt-user-token": "*",
- "magento/module-security": "*"
- },
- "type": "magento2-module",
- "license": [
- "OSL-3.0",
- "AFL-3.0"
- ],
- "autoload": {
- "files": [
- "registration.php"
- ],
- "psr-4": {
- "Magento\\AdminAdobeIms\\": ""
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/etc/adminhtml/di.xml b/app/code/Magento/AdminAdobeIms/etc/adminhtml/di.xml
deleted file mode 100644
index d31abbf60219..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/adminhtml/di.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- \Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE
-
- Magento_AdminAdobeIms::messages/admin_adobe_ims_messages.phtml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Magento\AdminAdobeIms\Model\Authorization\AdobeImsAdminTokenUserContext\Proxy
- 20
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/adminhtml/events.xml b/app/code/Magento/AdminAdobeIms/etc/adminhtml/events.xml
deleted file mode 100644
index 388cc7309ca9..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/adminhtml/events.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/adminhtml/routes.xml b/app/code/Magento/AdminAdobeIms/etc/adminhtml/routes.xml
deleted file mode 100644
index a01a8bd4921d..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/adminhtml/routes.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/adminhtml/system.xml b/app/code/Magento/AdminAdobeIms/etc/adminhtml/system.xml
deleted file mode 100644
index 7582650a3285..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/adminhtml/system.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
- Magento_Config::dev
-
-
-
- Magento\Config\Model\Config\Source\Yesno
- adobe_ims/integration/logging_enabled
-
-
-
-
-
-
- Magento\AdminAdobeIms\Block\Adminhtml\System\Config\Form\Field\Disabled
-
-
- Magento\AdminAdobeIms\Block\Adminhtml\System\Config\Form\Field\Disabled
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/config.xml b/app/code/Magento/AdminAdobeIms/etc/config.xml
deleted file mode 100644
index 6d338b5bd608..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/config.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
- 0
-
-
-
-
- AdobeID
- openid
- email
- profile
- org.read
-
-
-
-
-
-
-
-
- https://graph.identity.adobe.com
- https://static.adobelogin.com
-
-
- admin_adobe_ims_email_header_template
- admin_adobe_ims_email_footer_template
- admin_emails_new_user_created_template
- general
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/db_schema.xml b/app/code/Magento/AdminAdobeIms/etc/db_schema.xml
deleted file mode 100644
index aadf389b8db4..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/db_schema.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/db_schema_whitelist.json b/app/code/Magento/AdminAdobeIms/etc/db_schema_whitelist.json
deleted file mode 100644
index d73050ce38b6..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/db_schema_whitelist.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "admin_adobe_ims_webapi": {
- "column": {
- "id": true,
- "admin_user_id": true,
- "access_token_hash": true,
- "access_token": true,
- "created_at": true,
- "updated_at": true,
- "last_check_time": true,
- "access_token_expires_at": true
- },
- "index": {
- "ADMIN_ADOBE_IMS_WEBAPI_ADMIN_USER_ID": true
- },
- "constraint": {
- "PRIMARY": true,
- "ADMIN_ADOBE_IMS_WEBAPI_ACCESS_TOKEN_HASH": true,
- "ADMIN_ADOBE_IMS_WEBAPI_ADMIN_USER_ID_ADMIN_USER_USER_ID": true
- }
- }
-}
diff --git a/app/code/Magento/AdminAdobeIms/etc/di.xml b/app/code/Magento/AdminAdobeIms/etc/di.xml
deleted file mode 100644
index 5da3e654b2e7..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/di.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Magento\AdminAdobeIms\Console\Command\AdminAdobeImsEnableCommand
- Magento\AdminAdobeIms\Console\Command\AdminAdobeImsDisableCommand
- Magento\AdminAdobeIms\Console\Command\AdminAdobeImsInfoCommand
- Magento\AdminAdobeIms\Console\Command\AdminAdobeImsStatusCommand
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /var/log/admin_adobe_ims.log
-
-
-
-
- 1
- admin_adobe_ims_logger
-
- Magento\AdminAdobeIms\Logger\Handler
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/email_templates.xml b/app/code/Magento/AdminAdobeIms/etc/email_templates.xml
deleted file mode 100644
index f018821683de..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/email_templates.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/events.xml b/app/code/Magento/AdminAdobeIms/etc/events.xml
deleted file mode 100644
index d2ce344d23c4..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/events.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/module.xml b/app/code/Magento/AdminAdobeIms/etc/module.xml
deleted file mode 100644
index 8f54b888f64a..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/module.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/webapi_rest/di.xml b/app/code/Magento/AdminAdobeIms/etc/webapi_rest/di.xml
deleted file mode 100644
index efcd60d42ab0..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/webapi_rest/di.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
- Magento\AdminAdobeIms\Model\Authorization\AdobeImsTokenUserContext
- 90
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/etc/webapi_soap/di.xml b/app/code/Magento/AdminAdobeIms/etc/webapi_soap/di.xml
deleted file mode 100644
index efcd60d42ab0..000000000000
--- a/app/code/Magento/AdminAdobeIms/etc/webapi_soap/di.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
- Magento\AdminAdobeIms\Model\Authorization\AdobeImsTokenUserContext
- 90
-
-
-
-
-
diff --git a/app/code/Magento/AdminAdobeIms/i18n/en_US.csv b/app/code/Magento/AdminAdobeIms/i18n/en_US.csv
deleted file mode 100644
index 2f62e7c9109d..000000000000
--- a/app/code/Magento/AdminAdobeIms/i18n/en_US.csv
+++ /dev/null
@@ -1,52 +0,0 @@
-"Admin Adobe IMS integration is disabled","Admin Adobe IMS integration is disabled"
-"Admin Adobe IMS integration is enabled","Admin Adobe IMS integration is enabled"
-"The Client ID, Client Secret, Organization ID and 2FA are required when enabling the Admin Adobe IMS Module","The Client ID, Client Secret, Organization ID and 2FA are required when enabling the Admin Adobe IMS Module"
-"Module is disabled","Module is disabled"
-"Admin Adobe IMS integration is %1","Admin Adobe IMS integration is %1"
-"Adobe Sign-In is disabled.","Adobe Sign-In is disabled."
-"Authorization was successful","Authorization was successful"
-"Session Access Token is not valid","Session Access Token is not valid"
-"Login request error %1","Login request error %1"
-"An authentication error occurred. Verify and try again.","An authentication error occurred. Verify and try again."
-"You don't have access to this Commerce instance","You don't have access to this Commerce instance"
-"Unable to sign in with the Adobe ID","Unable to sign in with the Adobe ID"
-"Could not save ims token.","Could not save ims token."
-"Could not find ims token id: %id.","Could not find ims token id: %id."
-"Could not delete ims tokens for admin user id %1.","Could not delete ims tokens for admin user id %1."
-"Could not save ims user.","Could not save ims user."
-"The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.","The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later."
-"More permissions are needed to access this.","More permissions are needed to access this."
-"Please sign in with Adobe ID","Please sign in with Adobe ID"
-"Admin token generation is disabled. Please use Adobe IMS ACCESS_TOKEN.","Admin token generation is disabled. Please use Adobe IMS ACCESS_TOKEN."
-"Identity Verification","Identity Verification"
-"Verify Identity with Adobe IMS","Verify Identity with Adobe IMS"
-"Confirm Identity","Confirm Identity"
-"To apply changes you need to verify your Adobe identity.","To apply changes you need to verify your Adobe identity."
-"Identity Verified with Adobe IMS","Identity Verified with Adobe IMS"
-"Please perform the AdobeIms reAuth and try again.","Please perform the AdobeIms reAuth and try again."
-"Use the same email user has in Adobe IMS organization.","Use the same email user has in Adobe IMS organization."
-"The tokens couldn't be revoked.","The tokens couldn't be revoked."
-"No matching admin user found for Adobe ID.","No matching admin user found for Adobe ID."
-"This field is required to enable the Admin Adobe IMS Module","This field is required to enable the Admin Adobe IMS Module"
-"No valid Organization ID provided","No valid Organization ID provided"
-"No valid Client ID provided","No valid Client ID provided"
-"No valid Client Secret provided","No valid Client Secret provided"
-"The ims token wasn't found.","The ims token wasn't found."
-"Sign in to access the Adobe Commerce for your organization.","Sign in to access the Adobe Commerce for your organization."
-"Sign In","Sign In"
-"This Commerce instance is managed by an organization. Contact your organization administrator to request access.","This Commerce instance is managed by an organization. Contact your organization administrator to request access."
-"Sign in with Adobe ID","Sign in with Adobe ID"
-Footer,Footer
-"User Guides","User Guides"
-"Customer Support","Customer Support"
-Forums,Forums
-Header,Header
-"%user_name, you now have access to Adobe Commerce","%user_name, you now have access to Adobe Commerce"
-"Your administrator at %store_name has given you access to Adobe Commerce","Your administrator at %store_name has given you access to Adobe Commerce"
-"Get started","Get started"
-"Here are a few links to help you get up and running:","Here are a few links to help you get up and running:"
-Documentation,Documentation
-"Release notes","Release notes"
-"If you have any questions about access to Adobe Commerce, contact your administrator or your Adobe account team for more information.","If you have any questions about access to Adobe Commerce, contact your administrator or your Adobe account team for more information."
-"Enable Logging for Admin Adobe IMS Module","Enable Logging for Admin Adobe IMS Module"
-"Adobe Commerce","Adobe Commerce"
diff --git a/app/code/Magento/AdminAdobeIms/registration.php b/app/code/Magento/AdminAdobeIms/registration.php
deleted file mode 100644
index 81fe72eb260c..000000000000
--- a/app/code/Magento/AdminAdobeIms/registration.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-