Skip to content

Commit 9a09a90

Browse files
committed
Revert "Revert "Merge pull request #382 from magento/MQE-1600""
This reverts commit 1359e26
1 parent 656f819 commit 9a09a90

File tree

11 files changed

+519
-186
lines changed

11 files changed

+519
-186
lines changed

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
},
1111
"require": {
1212
"php": "7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0",
13-
"allure-framework/allure-codeception": "~1.3.0",
1413
"ext-curl": "*",
14+
"allure-framework/allure-codeception": "~1.3.0",
1515
"codeception/codeception": "~2.3.4 || ~2.4.0 ",
1616
"consolidation/robo": "^1.0.0",
17+
"csharpru/vault-php": "~3.5.3",
18+
"csharpru/vault-php-guzzle6-transport": "^2.0",
1719
"flow/jsonpath": ">0.2",
1820
"fzaninotto/faker": "^1.6",
1921
"monolog/monolog": "^1.0",

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/CredentialStoreTest.php renamed to dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/SecretStorage/FileStorageTest.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,34 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers;
7+
namespace tests\unit\Magento\FunctionalTestFramework\DataGenerator\Handlers\SecretStorage;
88

9-
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore;
9+
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\SecretStorage\FileStorage;
1010
use Magento\FunctionalTestingFramework\Util\MagentoTestCase;
1111
use AspectMock\Test as AspectMock;
1212

13-
class CredentialStoreTest extends MagentoTestCase
13+
class FileStorageTest extends MagentoTestCase
1414
{
1515

1616
/**
17-
* Test basic encryption/decryption functionality in CredentialStore class.
17+
* Test basic encryption/decryption functionality in FileStorage class.
1818
*/
1919
public function testBasicEncryptDecrypt()
2020
{
21-
$testKey = 'myKey';
21+
$testKey = 'magento/myKey';
2222
$testValue = 'myValue';
2323

24-
AspectMock::double(CredentialStore::class, [
24+
AspectMock::double(FileStorage::class, [
2525
'readInCredentialsFile' => ["$testKey=$testValue"]
2626
]);
2727

28-
$encryptedCred = CredentialStore::getInstance()->getSecret($testKey);
28+
$fileStorage = new FileStorage();
29+
$encryptedCred = $fileStorage->getEncryptedValue($testKey);
2930

3031
// assert the value we've gotten is in fact not identical to our test value
3132
$this->assertNotEquals($testValue, $encryptedCred);
3233

33-
$actualValue = CredentialStore::getInstance()->decryptSecretValue($encryptedCred);
34+
$actualValue = $fileStorage->getDecryptedValue($encryptedCred);
3435

3536
// assert that we are able to successfully decrypt our secret value
3637
$this->assertEquals($testValue, $actualValue);

etc/config/.credentials.example

+75-75
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
1-
#carriers/fedex/account=
2-
#carriers/fedex/meter_number=
3-
#carriers/fedex/key=
4-
#carriers/fedex/password=
5-
6-
#carriers/ups/password=
7-
#carriers/ups/username=
8-
#carriers/ups/access_license_number=
9-
#carriers/ups/shipper_number=
10-
11-
#carriers/usps/userid=
12-
#carriers/usps/password=
13-
14-
#carriers_dhl_id_us=
15-
#carriers_dhl_password_us=
16-
#carriers_dhl_account_us=
17-
18-
#carriers_dhl_id_eu=
19-
#carriers_dhl_password_eu=
20-
#carriers_dhl_account_eu=
21-
22-
23-
#payment_authorizenet_login=
24-
#payment_authorizenet_trans_key=
25-
#payment_authorizenet_trans_md5=
26-
27-
#authorizenet_fraud_review_login=
28-
#authorizenet_fraud_review_trans_key=
29-
#authorizenet_fraud_review_md5=
30-
31-
#braintree_enabled_fraud_merchant_account_id=
32-
#braintree_enabled_fraud_merchant_id=
33-
#braintree_enabled_fraud_public_key=
34-
#braintree_enabled_fraud_private_key=
35-
36-
#braintree_disabled_fraud_merchant_account_id=
37-
#braintree_disabled_fraud_merchant_id=
38-
#braintree_disabled_fraud_public_key=
39-
#braintree_disabled_fraud_private_key=
40-
41-
#payment/paypal_group_all_in_one/wpp_usuk/wpp_required_settings/wpp_and_express_checkout/business_account=
42-
#payment/paypal_group_all_in_one/wpp_usuk/wpp_required_settings/wpp_and_express_checkout/api_username=
43-
#payment/paypal_group_all_in_one/wpp_usuk/wpp_required_settings/wpp_and_express_checkout/api_password=
44-
#payment/paypal_group_all_in_one/wpp_usuk/wpp_required_settings/wpp_and_express_checkout/api_signature=
45-
#payment/paypal_express/merchant_id=
46-
47-
#payflow_pro_fraud_protection_enabled_business_account=
48-
#payflow_pro_fraud_protection_enabled_partner=
49-
#payflow_pro_fraud_protection_enabled_user=
50-
#payflow_pro_fraud_protection_enabled_pwd=
51-
#payflow_pro_fraud_protection_enabled_vendor=
52-
53-
#payflow_pro_business_account=
54-
#payflow_pro_partner=
55-
#payflow_pro_user=
56-
#payflow_pro_pwd=
57-
#payflow_pro_vendor=
58-
59-
#payflow_link_business_account_email=
60-
#payflow_link_partner=
61-
#payflow_link_user=
62-
#payflow_link_password=
63-
#payflow_link_vendor=
64-
65-
#payment/paypal_group_all_in_one/payments_pro_hosted_solution_with_express_checkout/pphs_required_settings/pphs_required_settings_pphs/business_account=
66-
#payment/paypal_group_all_in_one/payments_pro_hosted_solution_with_express_checkout/pphs_required_settings/pphs_required_settings_pphs/api_username=
67-
#payment/paypal_group_all_in_one/payments_pro_hosted_solution_with_express_checkout/pphs_required_settings/pphs_required_settings_pphs/api_password=
68-
#payment/paypal_group_all_in_one/payments_pro_hosted_solution_with_express_checkout/pphs_required_settings/pphs_required_settings_pphs/api_signature=
69-
70-
#payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/business_account=
71-
#payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_username=
72-
#payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_password=
73-
#payment/paypal_alternative_payment_methods/express_checkout_us/express_checkout_required/express_checkout_required_express_checkout/api_signature=
74-
75-
#fraud_protection/signifyd/api_key=
1+
#magento/magento/carriers_fedex_account=
2+
#magento/carriers_fedex_meter_number=
3+
#magento/carriers_fedex_key=
4+
#magento/carriers_fedex_password=
5+
6+
#magento/carriers_ups_password=
7+
#magento/carriers_ups_username=
8+
#magento/carriers_ups_access_license_number=
9+
#magento/carriers_ups_shipper_number=
10+
11+
#magento/carriers_usps_userid=
12+
#magento/carriers_usps_password=
13+
14+
#magento/carriers_dhl_id_us=
15+
#magento/carriers_dhl_password_us=
16+
#magento/carriers_dhl_account_us=
17+
18+
#magento/carriers_dhl_id_eu=
19+
#magento/carriers_dhl_password_eu=
20+
#magento/carriers_dhl_account_eu=
21+
22+
23+
#magento/payment_authorizenet_login=
24+
#magento/payment_authorizenet_trans_key=
25+
#magento/payment_authorizenet_trans_md5=
26+
27+
#magento/authorizenet_fraud_review_login=
28+
#magento/authorizenet_fraud_review_trans_key=
29+
#magento/authorizenet_fraud_review_md5=
30+
31+
#magento/braintree_enabled_fraud_merchant_account_id=
32+
#magento/braintree_enabled_fraud_merchant_id=
33+
#magento/braintree_enabled_fraud_public_key=
34+
#magento/braintree_enabled_fraud_private_key=
35+
36+
#magento/braintree_disabled_fraud_merchant_account_id=
37+
#magento/braintree_disabled_fraud_merchant_id=
38+
#magento/braintree_disabled_fraud_public_key=
39+
#magento/braintree_disabled_fraud_private_key=
40+
41+
#magento/payment_paypal_group_all_in_one_wpp_usuk_wpp_required_settings_wpp_and_express_checkout_business_account=
42+
#magento/payment_paypal_group_all_in_one_wpp_usuk_wpp_required_settings_wpp_and_express_checkout_api_username=
43+
#magento/payment_paypal_group_all_in_one_wpp_usuk_wpp_required_settings_wpp_and_express_checkout_api_password=
44+
#magento/payment_paypal_group_all_in_one_wpp_usuk_wpp_required_settings_wpp_and_express_checkout_api_signature=
45+
#magento/payment_paypal_express_merchant_id=
46+
47+
#magento/payflow_pro_fraud_protection_enabled_business_account=
48+
#magento/payflow_pro_fraud_protection_enabled_partner=
49+
#magento/payflow_pro_fraud_protection_enabled_user=
50+
#magento/payflow_pro_fraud_protection_enabled_pwd=
51+
#magento/payflow_pro_fraud_protection_enabled_vendor=
52+
53+
#magento/payflow_pro_business_account=
54+
#magento/payflow_pro_partner=
55+
#magento/payflow_pro_user=
56+
#magento/payflow_pro_pwd=
57+
#magento/payflow_pro_vendor=
58+
59+
#magento/payflow_link_business_account_email=
60+
#magento/payflow_link_partner=
61+
#magento/payflow_link_user=
62+
#magento/payflow_link_password=
63+
#magento/payflow_link_vendor=
64+
65+
#magento/payment_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout_pphs_required_settings_pphs_required_settings_pphs_business_account=
66+
#magento/payment_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout_pphs_required_settings_pphs_required_settings_pphs_api_username=
67+
#magento/payment_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout_pphs_required_settings_pphs_required_settings_pphs_api_password=
68+
#magento/payment_paypal_group_all_in_one_payments_pro_hosted_solution_with_express_checkout_pphs_required_settings_pphs_required_settings_pphs_api_signature=
69+
70+
#magento/payment_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_business_account=
71+
#magento/payment_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_username=
72+
#magento/payment_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_password=
73+
#magento/payment_paypal_alternative_payment_methods_express_checkout_us_express_checkout_required_express_checkout_required_express_checkout_api_signature=
74+
75+
#magento/fraud_protection_signifyd_api_key=

etc/config/.env.example

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ BROWSER=chrome
3030
#MAGENTO_RESTAPI_SERVER_PORT=8080
3131
#MAGENTO_RESTAPI_SERVER_PROTOCOL=https
3232

33+
#*** Uncomment and set vault base url and access token if you want to use vault to manage _CREDS secrets ***#
34+
#CREDENTIAL_VAULT_BASE_URL=
35+
#CREDENTIAL_VAULT_TOKEN=
36+
3337
#*** Uncomment these properties to set up a dev environment with symlinked projects ***#
3438
#TESTS_BP=
3539
#FW_BP=

0 commit comments

Comments
 (0)