MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / authByIndex

Method authByIndex

internal/pluginhost/auth_callbacks.go:215–234  ·  view source on GitHub ↗
(authIndex string)

Source from the content-addressed store, hash-verified

213}
214
215func (h *Host) authByIndex(authIndex string) (*coreauth.Auth, error) {
216 authIndex = strings.TrimSpace(authIndex)
217 if authIndex == "" {
218 return nil, fmt.Errorf("auth_index is required")
219 }
220 manager := h.currentAuthManager()
221 if manager == nil {
222 return nil, fmt.Errorf("core auth manager unavailable")
223 }
224 for _, auth := range manager.List() {
225 if auth == nil {
226 continue
227 }
228 auth.EnsureIndex()
229 if auth.Index == authIndex {
230 return auth, nil
231 }
232 }
233 return nil, fmt.Errorf("auth not found for auth_index %s", authIndex)
234}
235
236func (h *Host) authPhysicalJSONByIndex(authIndex string) (*coreauth.Auth, []byte, error) {
237 auth, errGet := h.authByIndex(authIndex)

Callers 2

Calls 3

currentAuthManagerMethod · 0.95
EnsureIndexMethod · 0.80
ListMethod · 0.65

Tested by

no test coverage detected