MCPcopy Index your code
hub / github.com/larksuite/cli / LoadOverrideAutoApproveAllow

Function LoadOverrideAutoApproveAllow

internal/registry/loader.go:287–306  ·  view source on GitHub ↗

LoadOverrideAutoApproveAllow returns scopes explicitly listed in scope_overrides.json recommend.allow (our desired additions).

()

Source from the content-addressed store, hash-verified

285// LoadOverrideAutoApproveAllow returns scopes explicitly listed in
286// scope_overrides.json recommend.allow (our desired additions).
287func LoadOverrideAutoApproveAllow() map[string]bool {
288 if cachedOverrideAutoAllow != nil {
289 return cachedOverrideAutoAllow
290 }
291 m := make(map[string]bool)
292 if data, err := registryFS.ReadFile("scope_overrides.json"); err == nil {
293 var wrapper struct {
294 AutoApprove struct {
295 Allow []string `json:"allow"`
296 } `json:"recommend"`
297 }
298 if json.Unmarshal(data, &wrapper) == nil {
299 for _, s := range wrapper.AutoApprove.Allow {
300 m[s] = true
301 }
302 }
303 }
304 cachedOverrideAutoAllow = m
305 return cachedOverrideAutoAllow
306}
307
308// LoadOverrideAutoApproveDeny returns scopes explicitly listed in
309// scope_overrides.json recommend.deny

Callers 1

Calls 1

ReadFileMethod · 0.65

Tested by 1