Skip to content

Commit 98de09f

Browse files
committed
redact dd-api-key
1 parent 0630e09 commit 98de09f

7 files changed

+63
-62
lines changed

scripts/run_integration_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,15 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do
187187
sed '/^$/d' |
188188
# Normalize Lambda runtime REPORT logs
189189
sed -E 's/(RequestId|TraceId|SegmentId|Duration|init|Memory Used|"e"): [a-z0-9\.\-]+/\1: XXXX/g' |
190+
sed -E 's/(python:3.[0-9]+\.v)[0-9]+/\1X/g' |
190191
# Normalize HTTP headers
191192
sed -E "s/(x-datadog-parent-id:|x-datadog-trace-id:|Content-Length:)[0-9]+/\1XXXX/g" |
192193
# Remove Account ID
193194
sed -E "s/(account_id:)[0-9]+/\1XXXX/g" |
194195
# Normalize timestamps in datapoints POSTed to DD
195196
sed -E 's/"points": \[\[[0-9\.]+,/"points": \[\[XXXX,/g' |
196197
# Strip API key from logged requests
197-
sed -E "s/(api_key=|'api_key': ')[a-z0-9\.\-]+/\1XXXX/g" |
198+
sed -E "s/(api_key=|'api_key': '|DD-API-KEY:)[a-z0-9\.\-]+/\1XXXX/g" |
198199
# Normalize package version so that these snapshots aren't broken on version bumps
199200
sed -E "s/(dd_lambda_layer:datadog-python[0-9]+_)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" |
200201
sed -E "s/(datadog_lambda:v)([0-9]+\.[0-9]+\.[0-9])/\1XX/g" |

tests/integration/snapshots/logs/async-metrics_python37.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INIT_START Runtime Version: python:3.7.v22 Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
1+
INIT_START Runtime Version: python:3.7.vX Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
22
START
33
{
44
"m": "aws.lambda.enhanced.invocations",

tests/integration/snapshots/logs/async-metrics_python38.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INIT_START Runtime Version: python:3.8.v15 Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
1+
INIT_START Runtime Version: python:3.8.vX Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
22
START
33
{
44
"m": "aws.lambda.enhanced.invocations",

tests/integration/snapshots/logs/async-metrics_python39.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INIT_START Runtime Version: python:3.9.v16 Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
1+
INIT_START Runtime Version: python:3.9.vX Runtime Version ARN: arn:aws:lambda:eu-west-1:XXXX:eu-west-1
22
START
33
{
44
"m": "aws.lambda.enhanced.invocations",

tests/integration/snapshots/logs/sync-metrics_python37.log

Lines changed: 19 additions & 19 deletions
Large diffs are not rendered by default.

tests/integration/snapshots/logs/sync-metrics_python38.log

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

tests/integration/snapshots/logs/sync-metrics_python39.log

Lines changed: 19 additions & 19 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)