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

Function redactUrl

packages/plugins/apps/src/git-client/url-security.ts:9–20  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

7 /(?:token|access[_-]?token|auth|authorization|key|secret|password|credential)/i;
8
9export const redactUrl = (input: string): string => {
10 try {
11 const url = new URL(input);
12 url.username = "";
13 url.password = "";
14 url.search = "";
15 url.hash = "";
16 return url.toString();
17 } catch {
18 return input.replace(/\/\/[^/@\s]+@/g, "//").replace(/[?#].*$/g, "");
19 }
20};
21
22export const hasTokenLikeQuery = (url: URL): boolean => {
23 for (const key of url.searchParams.keys()) {

Callers 5

parseGitSourceUrlFunction · 0.90
checkGitAppSourceRefsFunction · 0.90
fetchGitAppSourceFunction · 0.90
sourceErrorToDiagnosticFunction · 0.90
fetchGitFunction · 0.90

Calls 2

toStringMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected