You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-3.0.0/running-keploy/configuration-file.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,6 +238,29 @@ The tests section enables you to specify conditions for recording tests during A
238
238
239
239
You can use the **`path`**, **`urlMethods`**, **`headers`**, and **`host`** filters together or independently based on your testing scenarios. This flexibility allows you to precisely define the conditions under which tests are recorded.
240
240
241
+
### Managing Secrets with `secret.yaml`
242
+
243
+
Keploy allows you to manage sensitive information like API keys or tokens securely, without hardcoding them into your test files. This is done using a `secret.yaml` file within each test set directory.
244
+
245
+
1. **Create `secret.yaml`**: Inside your test set directory (e.g., `keploy/test-set-0/`), create a file named `secret.yaml`.
246
+
247
+
2. **Define Your Secrets**: Add your secrets as key-value pairs.
248
+
```yaml
249
+
# path: keploy/test-set-0/secret.yaml
250
+
API_KEY: "your-super-secret-api-key"
251
+
AUTH_TOKEN: "bearer-token-xyz-123"
252
+
```
253
+
254
+
3. **Use Secrets in Tests**: Reference these values in your test cases or mocks using the `{{.secret.KEY}}` syntax.
255
+
```yaml
256
+
# inside a test-case.yaml
257
+
...
258
+
header:
259
+
Authorization: "Bearer {{ .secret.AUTH_TOKEN }}"
260
+
...
261
+
```
262
+
For your security, Keploy will automatically add `/*/secret.yaml` to your `.gitignore` file to prevent accidentally committing secrets.
263
+
241
264
### Bypass Rules Section
242
265
243
266
The `bypassRules` section in the Keploy-config file allows you to define parameters for bypassing and mocking API calls.
@@ -378,4 +401,4 @@ Congratulations! You've now explored the features and configuration options prov
378
401
379
402
Now armed with Keploy-config, you are ready to embark on a more organized and productive journey of recording and testing APIs with Keploy. Feel free to explore additional features, customize configurations, and refer to the [CLI Command Docs](http://keploy.io/docs/running-keploy/cli-commands/) for more details on available flags and parameters.
380
403
381
-
Happy testing and may your APIs always return the expected results! 🚀
404
+
Happy testing and may your APIs always return the expected results! 🚀
0 commit comments