File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
src/Magento/FunctionalTestingFramework Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ MAGENTO_BASE_URL=http://devdocs.magento.com/
10
10
# *** Set the Admin Username and Password for your Magento instance ***#
11
11
MAGENTO_BACKEND_NAME = admin
12
12
MAGENTO_ADMIN_USERNAME = admin
13
- MAGENTO_ADMIN_PASSWORD = 123123q
14
13
15
14
# *** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation
16
15
# MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php
Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \FunctionalTestingFramework \DataTransport ;
8
8
9
+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
9
10
use Magento \FunctionalTestingFramework \Util \MftfGlobals ;
10
11
use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlInterface ;
11
12
use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlTransport ;
@@ -73,9 +74,11 @@ private function authorize()
73
74
74
75
// Authenticate admin user
75
76
$ authUrl = MftfGlobals::getBackendBaseUrl () . 'admin/auth/login/ ' ;
77
+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
78
+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
76
79
$ data = [
77
80
'login[username] ' => getenv ('MAGENTO_ADMIN_USERNAME ' ),
78
- 'login[password] ' => getenv ( ' MAGENTO_ADMIN_PASSWORD ' ) ,
81
+ 'login[password] ' => $ secret ,
79
82
'form_key ' => $ this ->formKey ,
80
83
];
81
84
$ this ->transport ->write ($ authUrl , $ data , CurlInterface::POST );
Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \FunctionalTestingFramework \DataTransport \Auth ;
8
8
9
+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
9
10
use Magento \FunctionalTestingFramework \Exceptions \FastFailException ;
10
11
use Magento \FunctionalTestingFramework \Util \MftfGlobals ;
11
12
use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlInterface ;
@@ -57,14 +58,16 @@ class WebApiAuth
57
58
public static function getAdminToken ($ username = null , $ password = null )
58
59
{
59
60
$ login = $ username ?? getenv ('MAGENTO_ADMIN_USERNAME ' );
60
- $ password = $ password ?? getenv ('MAGENTO_ADMIN_PASSWORD ' );
61
+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
62
+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
63
+ $ password = $ password ?? $ secret ;
61
64
if (!$ login || !$ password ) {
62
65
$ message = 'Cannot retrieve API token without credentials. Please fill out .env. ' ;
63
66
$ context = [
64
67
'MAGENTO_BASE_URL ' => getenv ('MAGENTO_BASE_URL ' ),
65
68
'MAGENTO_BACKEND_BASE_URL ' => getenv ('MAGENTO_BACKEND_BASE_URL ' ),
66
69
'MAGENTO_ADMIN_USERNAME ' => getenv ('MAGENTO_ADMIN_USERNAME ' ),
67
- 'MAGENTO_ADMIN_PASSWORD ' => getenv ( ' MAGENTO_ADMIN_PASSWORD ' ) ,
70
+ 'MAGENTO_ADMIN_PASSWORD ' => $ secret ,
68
71
];
69
72
throw new FastFailException ($ message , $ context );
70
73
}
Original file line number Diff line number Diff line change 7
7
namespace Magento \FunctionalTestingFramework \Util ;
8
8
9
9
use Magento \FunctionalTestingFramework \Config \MftfApplicationConfig ;
10
+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
10
11
use Magento \FunctionalTestingFramework \Exceptions \FastFailException ;
11
12
use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
12
13
use Magento \FunctionalTestingFramework \Util \ModuleResolver \ModuleResolverService ;
@@ -198,10 +199,12 @@ public function getEnabledModules()
198
199
199
200
if (!$ response ) {
200
201
$ message = "Could not retrieve Modules from Magento Instance. " ;
202
+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
203
+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
201
204
$ context = [
202
205
"Admin Module List Url " => $ url ,
203
206
"MAGENTO_ADMIN_USERNAME " => getenv ("MAGENTO_ADMIN_USERNAME " ),
204
- "MAGENTO_ADMIN_PASSWORD " => getenv ( " MAGENTO_ADMIN_PASSWORD " ) ,
207
+ "MAGENTO_ADMIN_PASSWORD " => $ secret ,
205
208
];
206
209
throw new FastFailException ($ message , $ context );
207
210
}
You can’t perform that action at this time.
0 commit comments