MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / redactTokenEndpointBody

Function redactTokenEndpointBody

packages/core/sdk/src/oauth-helpers.ts:289–298  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

287};
288
289const redactTokenEndpointBody = (body: string): string =>
290 body
291 .replaceAll(
292 /("(?:access_token|refresh_token|id_token|client_secret)"\s*:\s*")[^"]*(")/gi,
293 "$1[redacted]$2",
294 )
295 .replaceAll(
296 /((?:access_token|refresh_token|id_token|client_secret|code)=)[^&\s]*/gi,
297 "$1[redacted]",
298 );
299
300const tokenEndpointHttpSummary = async (response: Response): Promise<string> => {
301 const status = `HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ""}`;

Callers 1

bodyPreviewFromResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected