Skip to content

Commit 0e422eb

Browse files
authored
Merge pull request #191 from magento-gl/MQE-3373A
MQE-3373 Hashicorp Vault PHP lib being instantiated with wrong params
2 parents bcf0d44 + 032cbce commit 0e422eb

File tree

4 files changed

+107
-9
lines changed

4 files changed

+107
-9
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"composer/composer": "^1.9||^2.0",
2626
"csharpru/vault-php": "^4.2.1",
2727
"guzzlehttp/guzzle": "^7.3.0",
28+
"laminas/laminas-diactoros": "^2.8",
2829
"monolog/monolog": "^2.3",
2930
"mustache/mustache": "~2.5",
3031
"nikic/php-parser": "^4.4",

composer.lock

Lines changed: 92 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage/VaultStorage.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace Magento\FunctionalTestingFramework\DataGenerator\Handlers\SecretStorage;
88

9+
use Laminas\Diactoros\RequestFactory;
10+
use Laminas\Diactoros\StreamFactory;
11+
use Laminas\Diactoros\Uri;
912
use GuzzleHttp\Client as GuzzleClient;
1013
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
1114
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
@@ -79,13 +82,16 @@ public function __construct($baseUrl, $secretBasePath)
7982
parent::__construct();
8083
if (null === $this->client) {
8184
// client configuration and override http errors settings
82-
$config = [
83-
'timeout' => 15,
84-
'base_uri' => $baseUrl,
85-
'http_errors' => false
86-
];
87-
88-
$this->client = new Client(new GuzzleClient($config));
85+
$this->client = new Client(
86+
new Uri($baseUrl),
87+
new GuzzleClient([
88+
'timeout' => 15,
89+
'base_uri' => $baseUrl,
90+
'http_errors' => false
91+
]),
92+
new RequestFactory(),
93+
new StreamFactory()
94+
);
8995
$this->secretBasePath = $secretBasePath;
9096
}
9197
$this->readVaultTokenFromFileSystem();

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/SecretStorage/VaultTokenAuthStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($token)
3636
* @return Auth
3737
* @throws TestFrameworkException
3838
*/
39-
public function authenticate()
39+
public function authenticate(): ?Auth
4040
{
4141
try {
4242
return new Auth(['clientToken' => $this->token]);

0 commit comments

Comments
 (0)