Skip to content

Commit 95f9e7a

Browse files
Merge branch '2.4-develop' into 31253_default_store_breadcrumbs_returned_for_products_which_in_both_root_categories
2 parents b9fd820 + fde5551 commit 95f9e7a

File tree

2,148 files changed

+53707
-24838
lines changed

Some content is hidden

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

2,148 files changed

+53707
-24838
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Technical issue with the Magento 2 core components
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please read [our guidelines](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report-an-issue) before submitting the issue.
8+
- type: textarea
9+
attributes:
10+
label: Preconditions and environment
11+
description: |
12+
Describe your environment.
13+
Provide all the details that will help us to reproduce the bug.
14+
value: |
15+
- Magento version
16+
- Anything else that would help a developer reproduce the bug
17+
- type: textarea
18+
attributes:
19+
label: Steps to reproduce
20+
description: |
21+
Provide a set of clear steps to reproduce this bug.
22+
placeholder: |
23+
Example:
24+
1. Navigate to storefront as a guest.
25+
2. Open Test Category.
26+
3. Click “Add to Cart” on the Virtual Product.
27+
4. Open mini shopping cart and click “Proceed to Checkout”.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Expected result
33+
description: |
34+
Tell us what you expected to happen.
35+
placeholder: |
36+
Example:
37+
Order is placed successfully, customer is redirected to the success page.
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Actual result
43+
description: |
44+
Tell us what happened. Include error messages and issues.
45+
placeholder: |
46+
Example:
47+
“Place order” button is not visible, order cannot be placed.
48+
validations:
49+
required: true
50+
- type: textarea
51+
attributes:
52+
label: Additional information
53+
description: |
54+
Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
55+
Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections.
56+
- type: textarea
57+
attributes:
58+
label: Release note
59+
description: |
60+
Help us to provide meaningful release notes to the community.
61+
- type: checkboxes
62+
attributes:
63+
label: Triage and priority
64+
description: |
65+
Provide [Severity](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#community-backlog-priority) assessment for the Issue as a Reporter.
66+
This information helps us during the Confirmation and Issue triage processes.
67+
options:
68+
- label: 'Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._'
69+
- label: 'Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._'
70+
- label: 'Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._'
71+
- label: 'Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._'
72+
- label: 'Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Magento values the contributions of the security research community, and we look
44

55
## Where should I report security issues?
66

7-
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/magento). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
7+
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/adobe). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
88

99
## Learning More About Security
1010
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\AdobeIms\Block\Adminhtml;
9+
10+
use Magento\AdobeImsApi\Api\ConfigProviderInterface;
11+
use Magento\AdobeImsApi\Api\ConfigInterface;
12+
use Magento\AdobeImsApi\Api\UserAuthorizedInterface;
13+
use Magento\AdobeImsApi\Api\UserProfileRepositoryInterface;
14+
use Magento\Authorization\Model\UserContextInterface;
15+
use Magento\Backend\Block\Template;
16+
use Magento\Backend\Block\Template\Context;
17+
use Magento\Framework\Exception\NoSuchEntityException;
18+
use Magento\Framework\Serialize\Serializer\JsonHexTag;
19+
20+
/**
21+
* Provides required data for the Adobe service authentication component
22+
*
23+
* @api
24+
*/
25+
class SignIn extends Template
26+
{
27+
private const DATA_ARGUMENT_KEY_CONFIG_PROVIDERS = 'configProviders';
28+
private const RESPONSE_REGEXP_PATTERN = 'auth\\[code=(success|error);message=(.+)\\]';
29+
private const RESPONSE_CODE_INDEX = 1;
30+
private const RESPONSE_MESSAGE_INDEX = 2;
31+
private const RESPONSE_SUCCESS_CODE = 'success';
32+
private const RESPONSE_ERROR_CODE = 'error';
33+
private const ADOBE_IMS_JS_SIGNIN = 'Magento_AdobeIms/js/signIn';
34+
private const ADOBE_IMS_SIGNIN = 'Magento_AdobeIms/signIn';
35+
private const ADOBE_IMS_USER_PROFILE = 'adobe_ims/user/profile';
36+
private const ADOBE_IMS_USER_LOGOUT = 'adobe_ims/user/logout';
37+
38+
/**
39+
* @var ConfigInterface
40+
*/
41+
private $config;
42+
43+
/**
44+
* @var UserContextInterface
45+
*/
46+
private $userContext;
47+
48+
/**
49+
* @var UserAuthorizedInterface
50+
*/
51+
private $userAuthorized;
52+
53+
/**
54+
* @var UserProfileRepositoryInterface
55+
*/
56+
private $userProfileRepository;
57+
58+
/**
59+
* JsonHexTag Serializer Instance
60+
*
61+
* @var JsonHexTag
62+
*/
63+
private $serializer;
64+
65+
/**
66+
* SignIn constructor.
67+
*
68+
* @param Context $context
69+
* @param ConfigInterface $config
70+
* @param UserContextInterface $userContext
71+
* @param UserAuthorizedInterface $userAuthorized
72+
* @param UserProfileRepositoryInterface $userProfileRepository
73+
* @param JsonHexTag $json
74+
* @param array $data
75+
*/
76+
public function __construct(
77+
Context $context,
78+
ConfigInterface $config,
79+
UserContextInterface $userContext,
80+
UserAuthorizedInterface $userAuthorized,
81+
UserProfileRepositoryInterface $userProfileRepository,
82+
JsonHexTag $json,
83+
array $data = []
84+
) {
85+
$this->config = $config;
86+
$this->userContext = $userContext;
87+
$this->userAuthorized = $userAuthorized;
88+
$this->userProfileRepository = $userProfileRepository;
89+
$this->serializer = $json;
90+
parent::__construct($context, $data);
91+
}
92+
93+
/**
94+
* Get configuration for UI component
95+
*
96+
* @return string
97+
*/
98+
public function getComponentJsonConfig(): string
99+
{
100+
return $this->serializer->serialize(
101+
array_replace_recursive(
102+
$this->getDefaultComponentConfig(),
103+
...$this->getExtendedComponentConfig()
104+
)
105+
);
106+
}
107+
108+
/**
109+
* Get default UI component configuration
110+
*
111+
* @return array
112+
*/
113+
private function getDefaultComponentConfig(): array
114+
{
115+
return [
116+
'component' => self::ADOBE_IMS_JS_SIGNIN,
117+
'template' => self::ADOBE_IMS_SIGNIN,
118+
'profileUrl' => $this->getUrl(self::ADOBE_IMS_USER_PROFILE),
119+
'logoutUrl' => $this->getUrl(self::ADOBE_IMS_USER_LOGOUT),
120+
'user' => $this->getUserData(),
121+
'loginConfig' => [
122+
'url' => $this->config->getAuthUrl(),
123+
'callbackParsingParams' => [
124+
'regexpPattern' => self::RESPONSE_REGEXP_PATTERN,
125+
'codeIndex' => self::RESPONSE_CODE_INDEX,
126+
'messageIndex' => self::RESPONSE_MESSAGE_INDEX,
127+
'successCode' => self::RESPONSE_SUCCESS_CODE,
128+
'errorCode' => self::RESPONSE_ERROR_CODE
129+
]
130+
]
131+
];
132+
}
133+
134+
/**
135+
* Get UI component configuration extension specified in layout configuration for block instance
136+
*
137+
* @return array
138+
*/
139+
private function getExtendedComponentConfig(): array
140+
{
141+
$configProviders = $this->getData(self::DATA_ARGUMENT_KEY_CONFIG_PROVIDERS);
142+
if (empty($configProviders)) {
143+
return [];
144+
}
145+
146+
$configExtensions = [];
147+
foreach ($configProviders as $configProvider) {
148+
if ($configProvider instanceof ConfigProviderInterface) {
149+
$configExtensions[] = $configProvider->get();
150+
}
151+
}
152+
return $configExtensions;
153+
}
154+
155+
/**
156+
* Get user profile information
157+
*
158+
* @return array
159+
*/
160+
private function getUserData(): array
161+
{
162+
if (!$this->userAuthorized->execute()) {
163+
return $this->getDefaultUserData();
164+
}
165+
166+
try {
167+
$userProfile = $this->userProfileRepository->getByUserId((int)$this->userContext->getUserId());
168+
} catch (NoSuchEntityException $exception) {
169+
return $this->getDefaultUserData();
170+
}
171+
172+
return [
173+
'isAuthorized' => true,
174+
'name' => $userProfile->getName(),
175+
'email' => $userProfile->getEmail(),
176+
'image' => $userProfile->getImage(),
177+
];
178+
}
179+
180+
/**
181+
* Get default user data for not authenticated or missing user profile
182+
*
183+
* @return array
184+
*/
185+
private function getDefaultUserData(): array
186+
{
187+
return [
188+
'isAuthorized' => false,
189+
'name' => '',
190+
'email' => '',
191+
'image' => '',
192+
];
193+
}
194+
}

0 commit comments

Comments
 (0)