Skip to content

Commit f980fe6

Browse files
authored
Formatting
1 parent e73f8b8 commit f980fe6

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

docs/credentials.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
When you test functionality that involves external services such as UPS, FedEx, PayPal, or SignifyD,
44
use the MFTF credentials feature to hide sensitive [data][] like integration tokens and API keys.
55

6-
Currently MFTF supports two types of credential storage: **.credentials file** and **HashiCorp vault**.
6+
Currently the MFTF supports two types of credential storage:
77

8-
#3 Configure File Storage
8+
- **.credentials file**
9+
- **HashiCorp vault**.
10+
11+
## Configure File Storage
912

1013
The MFTF creates a sample file for credentials during [initial setup][]: `magento2/dev/tests/acceptance/.credentials.example`.
1114
The file contains an example list of keys for fields that can require credentials.
1215

13-
## Create `.credentials`
16+
### Create `.credentials`
1417

15-
To make the MFTF process the file with credentials, change directories to `magento2/dev/tests/acceptance/` and copy `.credentials.example` to `.credentials`.
18+
To make the MFTF process the file with credentials, in the command line, nvaigate to `magento2/dev/tests/acceptance/` and rename `.credentials.example` to `.credentials`.
1619

1720
```bash
1821
cd dev/tests/acceptance/
@@ -22,7 +25,7 @@ cd dev/tests/acceptance/
2225
cp .credentials.example .credentials
2326
```
2427

25-
## Add `.credentials` to `.gitignore`
28+
### Add `.credentials` to `.gitignore`
2629

2730
Verify that the file is excluded from tracking by `.gitignore` (unless you need this behavior):
2831

@@ -36,9 +39,9 @@ The command outputs the path if the file is excluded:
3639
.credentials
3740
```
3841

39-
## Define sensitive data in `.credentials` file
42+
### Define sensitive data in the `.credentials` file
4043

41-
Open the `.credentials` file, for Magento core credentials, uncomment the fields you want to use, and add your values:
44+
Open the `.credentials` file and, for Magento core credentials, uncomment the fields you want to use and add your values:
4245

4346
```conf
4447
...
@@ -74,30 +77,30 @@ vendor/my_awesome_service_token=rRVSVnh3cbDsVG39oTMz4A
7477
Hashicorp vault secures, stores, and tightly controls access to data in modern computing.
7578
It provides advanced data protection for your testing credentials.
7679

77-
MFTF works with both `vault enterprise` and `vault open source` that use `KV Version 2` secret engine.
80+
The MFTF works with both `vault enterprise` and `vault open source` that use `KV Version 2` secret engine.
7881

79-
## Install vault CLI
82+
### Install vault CLI
8083

8184
Download and install vault CLI tool if you want to run or develop MFTF tests locally. [Download Vault][Download Vault]
8285

8386
### Authenticate to vault via vault CLI
8487

85-
Authenticate to vault server via vault CLI tool. [Login Vault][Login Vault]
88+
Authenticate to vault server via the vault CLI tool: [Login Vault][Login Vault].
8689

87-
```terminal
90+
```bash
8891
vault login -method -path
8992
```
90-
**Do not** use `-no-store` command option, as MFTF will rely on the persisted token in the token helper
91-
(usually the local filesystem) for future api requests.
93+
94+
**Do not** use `-no-store` command option, as the MFTF will rely on the persisted token in the token helper (usually the local filesystem) for future API requests.
9295

9396
### Store secrets in vault
9497

95-
MFTF uses `KV Version 2` secret engine for secret storage.
98+
The MFTF uses the `KV Version 2` secret engine for secret storage.
9699
More information for working with `KV Version 2` can be found in [Vault KV2][Vault KV2].
97100

98101
### Secrets path and key convention
99102

100-
The path and key for secret data must follow:
103+
The path and key for secret data must follow the format:
101104

102105
```conf
103106
<SECRETS_BASE_PATH>/mftf/<VENDOR>/<SECRET_KEY>
@@ -113,9 +116,9 @@ secret/mftf/magento/carriers_usps_password
113116

114117
### Write secrets to vault
115118

116-
You can use vault CLI or Api to write secret data (credentials, etc) to vault. Here is a CLI example:
119+
You can use vault CLI or API to write secret data (credentials, etc) to vault. Here is a CLI example:
117120

118-
```terminal
121+
```bash
119122
vault kv put secret/mftf/magento/carriers_usps_userid carriers_usps_userid=usps_test_user
120123
vault kv put secret/mftf/magento/carriers_usps_password carriers_usps_password=Lmgxvrq89uPwECeV
121124
```
@@ -135,7 +138,7 @@ CREDENTIAL_VAULT_SECRET_BASE_PATH=secret
135138
## Configure both File Storage and Vault Storage
136139

137140
It is possible and sometimes useful to setup and use both `.credentials` file and vault for secret storage at the same time.
138-
In this case, MFTF tests are able to read secret data at runtime from both storage, and local `.credentials` file will take precedence.
141+
In this case, the MFTF tests are able to read secret data at runtime from both storage options, but the local `.credentials` file will take precedence.
139142

140143
<!-- {% raw %} -->
141144

@@ -164,7 +167,8 @@ Decrypted credentials do not appear in the console, error logs, or [test reports
164167
The decrypted values are only available in the `.credentials` file or within vault.
165168

166169
<div class="bs-callout bs-callout-info">
167-
The MFTF tests delivered with Magento application do not use credentials and do not cover external services, because of sensitivity of the data.</div>
170+
The MFTF tests delivered with Magento application do not use credentials and do not cover external services, because of sensitivity of the data.
171+
</div>
168172

169173
<!-- Link definitions -->
170174
[`fillField`]: test/actions.md#fillfield

0 commit comments

Comments
 (0)