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
* Support for transport 8.4.0 redaction functionality
* Docs for `redaction` options
(cherry picked from commit c2c417a)
Co-authored-by: Josh Mock <[email protected]>
Copy file name to clipboardExpand all lines: docs/advanced-config.asciidoc
+88Lines changed: 88 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,94 @@ const client = new Client({
91
91
})
92
92
----
93
93
94
+
[discrete]
95
+
==== Redaction of potentially sensitive data
96
+
97
+
When the client raises an `Error` that originated at the HTTP layer, like a `ConnectionError` or `TimeoutError`, a `meta` object is often attached to the error object that includes metadata useful for debugging, like request and response information. Because this can include potentially sensitive data, like authentication secrets in an `Authorization` header, the client takes measures to redact common sources of sensitive data when this metadata is attached and serialized.
98
+
99
+
If your configuration requires extra headers or other configurations that may include sensitive data, you may want to adjust these settings to account for that.
100
+
101
+
By default, the `redaction` option is set to `{ type: 'replace' }`, which recursively searches for sensitive key names, case insensitive, and replaces their values with the string `[redacted]`.
console.log(err.meta.meta.request.options.headers['X-My-Secret-Password']) // prints "[redacted]"
139
+
}
140
+
----
141
+
142
+
Alternatively, if you know you're not going to use the metadata at all, setting the redaction type to `remove` will remove all optional sources of potentially sensitive data entirely, or replacing them with `null` for required properties.
Finally, if you prefer to turn off redaction altogether, perhaps while debugging on a local developer environment, you can set the redaction type to `off`. This will revert the client to pre-8.11.0 behavior, where basic redaction is only performed during common serialization methods like `console.log` and `JSON.stringify`.
162
+
163
+
WARNING: Setting `redaction.type` to `off` is not recommended in production environments.
0 commit comments