Skip to content

Commit 400f829

Browse files
committed
AC-1271: Add rate limiting for payment information endpoint and mutation
1 parent 8aadc27 commit 400f829

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

lib/internal/Magento/Framework/App/Request/Backpressure/CompositeRequestTypeExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\App\RequestInterface;
1313

1414
/**
15-
* Uses other extractors.
15+
* Uses other extractors
1616
*/
1717
class CompositeRequestTypeExtractor implements RequestTypeExtractorInterface
1818
{

lib/internal/Magento/Framework/App/Request/Backpressure/ContextFactory.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
use Magento\Framework\App\ActionInterface;
1212
use Magento\Framework\App\Backpressure\ContextInterface;
1313
use Magento\Framework\App\Backpressure\IdentityProviderInterface;
14+
use Magento\Framework\App\ObjectManager;
1415
use Magento\Framework\App\RequestInterface;
1516

1617
/**
17-
* Creates context for current request.
18+
* Creates context for current request
1819
*/
1920
class ContextFactory
2021
{
@@ -49,7 +50,7 @@ public function __construct(
4950
}
5051

5152
/**
52-
* Create context if possible.
53+
* Create context if possible
5354
*
5455
* @param ActionInterface $action
5556
* @return ContextInterface|null
@@ -61,12 +62,15 @@ public function create(ActionInterface $action): ?ContextInterface
6162
return null;
6263
}
6364

64-
return new ControllerContext(
65-
$this->request,
66-
$this->identityProvider->fetchIdentity(),
67-
$this->identityProvider->fetchIdentityType(),
68-
$typeId,
69-
$action
65+
return ObjectManager::getInstance()->create(
66+
ControllerContext::class,
67+
[
68+
$this->request,
69+
$this->identityProvider->fetchIdentity(),
70+
$this->identityProvider->fetchIdentityType(),
71+
$typeId,
72+
$action
73+
]
7074
);
7175
}
7276
}

lib/internal/Magento/Framework/App/Request/Backpressure/ControllerContext.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\Framework\App\Backpressure\ContextInterface;
1313
use Magento\Framework\App\RequestInterface;
1414

15+
/**
16+
* Controller request context
17+
*/
1518
class ControllerContext implements ContextInterface
1619
{
1720
/**
@@ -93,7 +96,7 @@ public function getTypeId(): string
9396
}
9497

9598
/**
96-
* Controller instance.
99+
* Controller instance
97100
*
98101
* @return ActionInterface
99102
*/

lib/internal/Magento/Framework/App/Request/Backpressure/RequestTypeExtractorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
use Magento\Framework\App\RequestInterface;
1313

1414
/**
15-
* Extracts type ID for backpressure context.
15+
* Extracts type ID for backpressure context
1616
*/
1717
interface RequestTypeExtractorInterface
1818
{
1919
/**
20-
* Extract type ID if possible.
20+
* Extract type ID if possible
2121
*
2222
* @param RequestInterface $request
2323
* @param ActionInterface $action

0 commit comments

Comments
 (0)