Skip to content

Commit d8dd2e0

Browse files
hughnssvajunas-budrys
authored andcommitted
Redact access_token when logging SFU connection string (livekit#1394)
1 parent 9051061 commit d8dd2e0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'livekit-client': patch
3+
---
4+
5+
Redact access_token parameter in debug logs

src/api/SignalClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ export class SignalClient {
294294
abortHandler();
295295
}
296296
abortSignal?.addEventListener('abort', abortHandler);
297-
this.log.debug(`connecting to ${url + params}`, this.logContext);
297+
this.log.debug(
298+
`connecting to ${url + params.replace(/access_token=([^&#$]*)/, 'access_token=<redacted>')}`,
299+
this.logContext,
300+
);
298301
if (this.ws) {
299302
await this.close(false);
300303
}

0 commit comments

Comments
 (0)