Skip to content

Commit b09f8e0

Browse files
CABPI-365::AdobeAdminIms to AdobeIms code migration - updated class descriptions and fixed static test
1 parent 6bf95d5 commit b09f8e0

File tree

11 files changed

+18
-30
lines changed

11 files changed

+18
-30
lines changed

app/code/Magento/AdminAdobeIms/Exception/AdobeImsOrganizationAuthorizationException.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111

1212
/**
1313
* @api
14+
*
15+
* @deprecated
16+
* @see \Magento\AdobeIms\Exception\AdobeImsOrganizationAuthorizationException
1417
*/
1518
class AdobeImsOrganizationAuthorizationException extends AuthorizationException
1619
{
1720
public const ERROR_MESSAGE = 'The Adobe ID you\'re using does not belong to the organization ' .
18-
'that controlling this Commerce instance. Contact your administrator so he can add your Adobe ID ' .
21+
'that controls this Commerce instance. Contact your administrator so he can add your Adobe ID ' .
1922
'to the organization.';
2023
}

app/code/Magento/AdminAdobeIms/Service/ImsConfig.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
class ImsConfig extends Config
1515
{
16-
private const XML_PATH_ORGANIZATION_ID = 'adobe_ims/integration/organization_id';
1716
private const XML_PATH_LOGGING_ENABLED = 'adobe_ims/integration/logging_enabled';
1817
private const XML_PATH_NEW_ADMIN_EMAIL_TEMPLATE = 'adobe_ims/email/content_template';
1918

@@ -69,14 +68,4 @@ public function getEmailTemplateForNewAdminUsers(): string
6968
self::XML_PATH_NEW_ADMIN_EMAIL_TEMPLATE
7069
);
7170
}
72-
73-
/**
74-
* Retrieve Organization Id
75-
*
76-
* @return string
77-
*/
78-
public function getOrganizationId(): string
79-
{
80-
return $this->scopeConfig->getValue(self::XML_PATH_ORGANIZATION_ID);
81-
}
8271
}

app/code/Magento/AdminAdobeIms/composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
"magento/module-jwt-user-token": "*",
2121
"magento/module-security": "*"
2222
},
23-
"suggest": {
24-
"magento/module-theme": "*"
25-
},
2623
"type": "magento2-module",
2724
"license": [
2825
"OSL-3.0",

app/code/Magento/AdobeIms/Model/Authorization.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Framework\HTTP\Client\Curl;
1414
use Magento\Framework\HTTP\Client\CurlFactory;
1515

16+
/**
17+
* Provide auth url and validate authorization
18+
*/
1619
class Authorization implements AuthorizationInterface
1720
{
1821
private const HTTP_REDIRECT_CODE = 302;

app/code/Magento/AdobeIms/Model/GetProfile.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
use Magento\Framework\HTTP\Client\CurlFactory;
1414
use Magento\Framework\Serialize\Serializer\Json;
1515

16+
/**
17+
* Provide IMS user profile
18+
*/
1619
class GetProfile implements GetProfileInterface
1720
{
18-
1921
/**
2022
* @var ConfigInterface
2123
*/

app/code/Magento/AdobeIms/Model/GetToken.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,6 @@ public function execute(string $code): TokenResponseInterface
9292
*/
9393
public function getTokenResponse(string $code): TokenResponseInterface
9494
{
95-
try {
96-
return $this->execute($code);
97-
} catch (AuthorizationException $exception) {
98-
throw new AuthorizationException(
99-
__($exception->getMessage())
100-
);
101-
}
95+
return $this->execute($code);
10296
}
10397
}

app/code/Magento/AdobeIms/Model/LogOut.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*/
2424
class LogOut implements LogOutInterface
2525
{
26-
2726
/**
2827
* Successful result code.
2928
*/
@@ -175,7 +174,7 @@ private function logoutAdminFromIms(string $accessToken): bool
175174
}
176175

177176
/**
178-
* Checks whether user profile could be got by the access token
177+
* Check whether user profile could be retrieved by the access token
179178
* - If the token is invalidated, profile information won't be returned
180179
*
181180
* @param string $accessToken

app/code/Magento/AdobeIms/Model/OrganizationMembership.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
use Magento\AdobeIms\Exception\AdobeImsOrganizationAuthorizationException;
1111
use Magento\AdobeImsApi\Api\ConfigInterface;
1212
use Magento\AdobeImsApi\Api\OrganizationMembershipInterface;
13-
use Magento\Framework\Exception\AuthorizationException;
1413
use Magento\Framework\HTTP\Client\CurlFactory;
1514

15+
/**
16+
* Check if user is a member of Adobe Organization
17+
*/
1618
class OrganizationMembership implements OrganizationMembershipInterface
1719
{
18-
1920
/**
2021
* @var ConfigInterface
2122
*/

app/code/Magento/AdobeImsApi/Api/GetProfileInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface GetProfileInterface
1919
* Get profile url
2020
*
2121
* @param string $code
22-
* @return array|bool|float|int|mixed|string|null
22+
* @return mixed
2323
* @throws AuthorizationException
2424
*/
2525
public function getProfile(string $code);

app/code/Magento/AdobeImsApi/Api/IsTokenValidInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\Exception\AuthorizationException;
1111

1212
/**
13-
* Declare functionality for user login from the Adobe account
13+
* Validate ims token
1414
*
1515
* @api
1616
*/

0 commit comments

Comments
 (0)