Skip to content

Commit 7fcb128

Browse files
committed
AC-13209::Investigate the latest version of web-token/jwt-framework
1 parent 180cfba commit 7fcb128

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

app/code/Magento/JwtFrameworkAdapter/Model/JweBuilderFactory.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ public function __construct(
5151
*/
5252
public function create(): JWEBuilder
5353
{
54-
return new JWEBuilder(
55-
$this->algoManager,
56-
$this->contentAlgoManager
54+
// jwt-framework v4 expects a single AlgorithmManager containing BOTH key and content algorithms.
55+
$allAlgorithms = array_merge(
56+
$this->algoManager->all(),
57+
$this->contentAlgoManager->all()
5758
);
59+
return new JWEBuilder(new AlgorithmManager($allAlgorithms));
5860
}
5961
}

app/code/Magento/JwtFrameworkAdapter/Model/JweCompressionManagerFactory.php

Whitespace-only changes.

app/code/Magento/JwtFrameworkAdapter/Model/JweLoaderFactory.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ public function __construct(
5252
*/
5353
public function create(): JWELoader
5454
{
55+
$allAlgorithms = array_merge(
56+
$this->algoManager->all(),
57+
$this->contentAlgoManager->all()
58+
);
5559
return new JWELoader(
5660
$this->serializers,
57-
new JWEDecrypter(
58-
$this->algoManager,
59-
$this->contentAlgoManager
60-
),
61+
new JWEDecrypter(new \Jose\Component\Core\AlgorithmManager($allAlgorithms)),
6162
null
6263
);
6364
}

setup/src/Magento/Setup/Console/Command/InstallStoreConfigurationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/**
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
24+
* @SuppressWarnings(PHPMD.UnusedPrivateField)
2525
*/
2626
class InstallStoreConfigurationCommand extends AbstractSetupCommand
2727
{

0 commit comments

Comments
 (0)