()
| 118 | } |
| 119 | |
| 120 | func (m *CLIBridgeModule) getAllowedPaths() []string { |
| 121 | lc := m.loadListConfig() |
| 122 | if len(lc.AllowedPaths) > 0 { |
| 123 | return lc.AllowedPaths |
| 124 | } |
| 125 | v := m.plug.Config.Get(`AllowedPaths`) |
| 126 | if paths, ok := v.([]any); ok { |
| 127 | result := make([]string, 0, len(paths)) |
| 128 | for _, p := range paths { |
| 129 | if s, ok := p.(string); ok { |
| 130 | result = append(result, s) |
| 131 | } |
| 132 | } |
| 133 | return result |
| 134 | } |
| 135 | return []string{`/*`} |
| 136 | } |
| 137 | |
| 138 | func (m *CLIBridgeModule) isToolAllowed(toolName string) bool { |
| 139 | for _, allowed := range m.getAllowedTools() { |
no test coverage detected