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/
1010# *** Set the Admin Username and Password for your Magento instance ***#
1111MAGENTO_BACKEND_NAME = admin
1212MAGENTO_ADMIN_USERNAME = admin
13- MAGENTO_ADMIN_PASSWORD = 123123q
1413
1514# *** Path to CLI entry point and command parameter name. Uncomment and change if folder structure differs from standard Magento installation
1615# MAGENTO_CLI_COMMAND_PATH=dev/tests/acceptance/utils/command.php
Original file line number Diff line number Diff line change 66
77namespace Magento \FunctionalTestingFramework \DataTransport ;
88
9+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
910use Magento \FunctionalTestingFramework \Util \MftfGlobals ;
1011use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlInterface ;
1112use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlTransport ;
@@ -73,9 +74,11 @@ private function authorize()
7374
7475 // Authenticate admin user
7576 $ authUrl = MftfGlobals::getBackendBaseUrl () . 'admin/auth/login/ ' ;
77+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
78+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
7679 $ data = [
7780 'login[username] ' => getenv ('MAGENTO_ADMIN_USERNAME ' ),
78- 'login[password] ' => getenv ( ' MAGENTO_ADMIN_PASSWORD ' ) ,
81+ 'login[password] ' => $ secret ,
7982 'form_key ' => $ this ->formKey ,
8083 ];
8184 $ this ->transport ->write ($ authUrl , $ data , CurlInterface::POST );
Original file line number Diff line number Diff line change 66
77namespace Magento \FunctionalTestingFramework \DataTransport \Auth ;
88
9+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
910use Magento \FunctionalTestingFramework \Exceptions \FastFailException ;
1011use Magento \FunctionalTestingFramework \Util \MftfGlobals ;
1112use Magento \FunctionalTestingFramework \DataTransport \Protocol \CurlInterface ;
@@ -57,14 +58,16 @@ class WebApiAuth
5758 public static function getAdminToken ($ username = null , $ password = null )
5859 {
5960 $ 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 ;
6164 if (!$ login || !$ password ) {
6265 $ message = 'Cannot retrieve API token without credentials. Please fill out .env. ' ;
6366 $ context = [
6467 'MAGENTO_BASE_URL ' => getenv ('MAGENTO_BASE_URL ' ),
6568 'MAGENTO_BACKEND_BASE_URL ' => getenv ('MAGENTO_BACKEND_BASE_URL ' ),
6669 'MAGENTO_ADMIN_USERNAME ' => getenv ('MAGENTO_ADMIN_USERNAME ' ),
67- 'MAGENTO_ADMIN_PASSWORD ' => getenv ( ' MAGENTO_ADMIN_PASSWORD ' ) ,
70+ 'MAGENTO_ADMIN_PASSWORD ' => $ secret ,
6871 ];
6972 throw new FastFailException ($ message , $ context );
7073 }
Original file line number Diff line number Diff line change 77namespace Magento \FunctionalTestingFramework \Util ;
88
99use Magento \FunctionalTestingFramework \Config \MftfApplicationConfig ;
10+ use Magento \FunctionalTestingFramework \DataGenerator \Handlers \CredentialStore ;
1011use Magento \FunctionalTestingFramework \Exceptions \FastFailException ;
1112use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
1213use Magento \FunctionalTestingFramework \Util \ModuleResolver \ModuleResolverService ;
@@ -198,10 +199,12 @@ public function getEnabledModules()
198199
199200 if (!$ response ) {
200201 $ message = "Could not retrieve Modules from Magento Instance. " ;
202+ $ encryptedSecret = CredentialStore::getInstance ()->getSecret ('magento/MAGENTO_ADMIN_PASSWORD ' );
203+ $ secret = CredentialStore::getInstance ()->decryptSecretValue ($ encryptedSecret );
201204 $ context = [
202205 "Admin Module List Url " => $ url ,
203206 "MAGENTO_ADMIN_USERNAME " => getenv ("MAGENTO_ADMIN_USERNAME " ),
204- "MAGENTO_ADMIN_PASSWORD " => getenv ( " MAGENTO_ADMIN_PASSWORD " ) ,
207+ "MAGENTO_ADMIN_PASSWORD " => $ secret ,
205208 ];
206209 throw new FastFailException ($ message , $ context );
207210 }
You can’t perform that action at this time.
0 commit comments