MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / getAllowedPaths

Method getAllowedPaths

modules/clibridge/clibridge.go:120–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

118}
119
120func (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
138func (m *CLIBridgeModule) isToolAllowed(toolName string) bool {
139 for _, allowed := range m.getAllowedTools() {

Callers 2

apiGetConfigMethod · 0.95
isPathAllowedMethod · 0.95

Calls 2

loadListConfigMethod · 0.95
GetMethod · 0.45

Tested by

no test coverage detected