MCPcopy Index your code
hub / github.com/codeaashu/claude-code / lookupAllowlist

Function lookupAllowlist

src/tools/PowerShellTool/readOnlyValidation.ts:1088–1101  ·  view source on GitHub ↗

* Looks up a command in the allowlist, resolving aliases first. * Returns the config if found, or undefined.

(name: string)

Source from the content-addressed store, hash-verified

1086 * Returns the config if found, or undefined.
1087 */
1088function lookupAllowlist(name: string): CommandConfig | undefined {
1089 const lower = name.toLowerCase()
1090 // Direct lookup first
1091 const direct = CMDLET_ALLOWLIST[lower]
1092 if (direct) {
1093 return direct
1094 }
1095 // Resolve alias to canonical and look up
1096 const canonical = resolveToCanonical(lower)
1097 if (canonical !== lower) {
1098 return CMDLET_ALLOWLIST[canonical]
1099 }
1100 return undefined
1101}
1102
1103/**
1104 * Sync regex-based check for security-concerning patterns in a PowerShell command.

Callers 1

isAllowlistedCommandFunction · 0.85

Calls 1

resolveToCanonicalFunction · 0.85

Tested by

no test coverage detected