MCPcopy Create free account
hub / github.com/github/gh-aw / hasBashRestrictedAllowlist

Function hasBashRestrictedAllowlist

pkg/workflow/mcp_cli_mount.go:144–162  ·  view source on GitHub ↗

hasBashRestrictedAllowlist reports true when tools contains an explicit, finite bash command allowlist (not a wildcard). Used to decide whether implicit commands must be injected for auto-allowed tools such as playwright-cli.

(tools map[string]any)

Source from the content-addressed store, hash-verified

142// command allowlist (not a wildcard). Used to decide whether implicit commands must be
143// injected for auto-allowed tools such as playwright-cli.
144func hasBashRestrictedAllowlist(tools map[string]any) bool {
145 if tools == nil {
146 return false
147 }
148 bashConfig, hasBash := tools["bash"]
149 if !hasBash {
150 return false
151 }
152 bashCommands, ok := bashConfig.([]any)
153 if !ok || len(bashCommands) == 0 {
154 return false
155 }
156 for _, cmd := range bashCommands {
157 if cmdStr, ok := cmd.(string); ok && (cmdStr == "*" || cmdStr == ":*") {
158 return false
159 }
160 }
161 return true
162}
163
164func getMountedCLIServerNamesIfBashRestricted(workflowData *WorkflowData, tools map[string]any, safeOutputs *SafeOutputsConfig, mcpScripts *MCPScriptsConfig) []string {
165 if !hasBashRestrictedAllowlist(tools) {

Calls

no outgoing calls

Tested by 1