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

Method callPollLogin

internal/pluginhost/auth_provider.go:304–329  ·  view source on GitHub ↗
(ctx context.Context, record capabilityRecord, provider, state string, metadata map[string]any)

Source from the content-addressed store, hash-verified

302}
303
304func (h *Host) callPollLogin(ctx context.Context, record capabilityRecord, provider, state string, metadata map[string]any) (resp pluginapi.AuthLoginPollResponse, handled bool, err error) {
305 authProvider := record.plugin.Capabilities.AuthProvider
306 if h == nil || authProvider == nil || h.isPluginFused(record.id) || !h.recordCurrent(record) {
307 return pluginapi.AuthLoginPollResponse{}, false, nil
308 }
309 defer func() {
310 if recovered := recover(); recovered != nil {
311 h.fusePlugin(record.id, "AuthProvider.PollLogin", recovered)
312 resp = pluginapi.AuthLoginPollResponse{}
313 handled = false
314 err = fmt.Errorf("auth provider poll login panic: %v", recovered)
315 }
316 }()
317 req := pluginapi.AuthLoginPollRequest{
318 Provider: normalizeProviderID(provider),
319 State: strings.TrimSpace(state),
320 Host: h.hostConfigSummary(),
321 HTTPClient: h.newHTTPClient(nil),
322 Metadata: cloneAnyMap(metadata),
323 }
324 resp, errPoll := authProvider.PollLogin(ctx, req)
325 if errPoll != nil {
326 return pluginapi.AuthLoginPollResponse{}, true, errPoll
327 }
328 return resp, true, nil
329}
330
331func (h *Host) RefreshAuth(ctx context.Context, auth *coreauth.Auth) (refreshed *coreauth.Auth, handled bool, err error) {
332 if h == nil || auth == nil {

Callers 1

PollLoginMethod · 0.95

Calls 8

isPluginFusedMethod · 0.95
recordCurrentMethod · 0.95
fusePluginMethod · 0.95
hostConfigSummaryMethod · 0.95
newHTTPClientMethod · 0.95
normalizeProviderIDFunction · 0.85
cloneAnyMapFunction · 0.85
PollLoginMethod · 0.65

Tested by

no test coverage detected