(ctx context.Context, record capabilityRecord, provider, state string, metadata map[string]any)
| 302 | } |
| 303 | |
| 304 | func (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 | |
| 331 | func (h *Host) RefreshAuth(ctx context.Context, auth *coreauth.Auth) (refreshed *coreauth.Auth, handled bool, err error) { |
| 332 | if h == nil || auth == nil { |
no test coverage detected