magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 133 forks source link

Unable to use HashiCorp Vault with standalone MFTF install #827

Closed snez closed 1 year ago

snez commented 3 years ago

Preconditions

  1. PHP 7.4
  2. Standalone MFTF installation
  3. Magento 2.4.2

Steps to reproduce

  1. Setup a HashiCorp Vault on a server
  2. Add CREDENTIAL_VAULT_ADDRESS and CREDENTIAL_VAULT_SECRET_BASE_PATH to dev/.env in MFTF folder
  3. Add CREDENTIAL_VAULT_ADDRESS and CREDENTIAL_VAULT_SECRET_BASE_PATH to dev/tests/acceptance/.env in Magento 2 folder
  4. Read a vault value from a test using {{_CREDS.vendor/path}}

Expected result

Actual result

  1. The test run throws the following exception:

    [Error] Interface 'Vault\Transports\Transport' not found

Troubleshooting

  1. find . | grep -i vault does not return any Vault classes in MFTF.
  2. composer require csharpru/vault-php adds the classes in the vendor dir, but they are not loaded at MFTF runtime
m2-assistant[bot] commented 3 years ago

Hi @snez. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


mam08ixo commented 3 years ago

I can confirm the issue. The problem is that MFTF requires incompatible packages since version 3.3.0 (8b56226).

$ cat vendor/magento/magento2-functional-testing-framework/composer.json | grep csharpru/vault

"csharpru/vault-php": "^4.1.0",
"csharpru/vault-php-guzzle6-transport": "^2.0",

The Vault Transports package uses some files from the Vault package that were removed in version 4.

$ composer info | grep csharpru/vault

csharpru/vault-php                      4.2.0      Best Vault client for PHP that you can find
csharpru/vault-php-guzzle6-transport    2.0.4      Guzzle6 transport for Vault PHP client

vault

jilu1 commented 3 years ago

@snez Thank you for reporting the issue!

We have internal issue https://jira.corp.magento.com/browse/MQE-2684 created and will update status once we start the work on it.

jonatanrdsantos commented 2 years ago

@snez , @mam08ixo and @jilu1 Any news on this?

We have to use vault but it's failing, what do you guys recommend in this case?

I have the same environment.

image

okolesnyk commented 1 year ago

Closing issue since we changed the dependencies this issue is no longer valid. Please feel free to open a new issue if you have any concerns. Thank you

okolesnyk commented 1 year ago

Closing issue since we changed the dependencies this issue is no longer valid. Please feel free to open a new issue if you have any concerns. Thank you