MCPcopy
hub / github.com/larksuite/cli / isUntrustedConfigError

Function isUntrustedConfigError

internal/platform/host.go:98–108  ·  view source on GitHub ↗

isUntrustedConfigError flags errors where the plugin's declared FailurePolicy is itself part of the misconfiguration. For these the host MUST abort unconditionally; honouring an FailOpen declaration on a misconfigured Restricts plugin would defeat the whole point of the consistency check.

(err error)

Source from the content-addressed store, hash-verified

96// a misconfigured Restricts plugin would defeat the whole point of the
97// consistency check.
98func isUntrustedConfigError(err error) bool {
99 var pi *PluginInstallError
100 if !errors.As(err, &pi) {
101 return false
102 }
103 return pi.ReasonCode == ReasonRestrictsMismatch ||
104 pi.ReasonCode == ReasonInvalidPluginName ||
105 pi.ReasonCode == ReasonPluginNamePanic ||
106 pi.ReasonCode == ReasonDuplicatePluginName ||
107 pi.ReasonCode == ReasonInvalidCapability
108}
109
110// installOne handles a single plugin: build a staging Registrar, call
111// Install, run validateSelf, and on success commit to the live

Callers 1

InstallAllFunction · 0.85

Calls 1

AsMethod · 0.80

Tested by

no test coverage detected