MCPcopy Create free account
hub / github.com/Quorinex/Kiro-Go / authenticateForOpenAI

Method authenticateForOpenAI

proxy/handler.go:343–354  ·  view source on GitHub ↗

authenticateForOpenAI runs authenticate and writes an OpenAI-style error on failure.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

341 // 检查 token 是否需要刷新
342 if account.ExpiresAt > 0 && time.Now().Unix() > account.ExpiresAt-tokenRefreshSkewSeconds {
343 if _, err := h.refreshAccountToken(account, false); err != nil {
344 logger.Warnf("[BackgroundRefresh] Token refresh failed for %s: %v", account.Email, err)
345 h.handleAccountFailure(account, err)
346 continue
347 }
348 }
349 }
350
351 // 刷新账户信息
352 info, err := RefreshAccountInfo(account)
353 if err != nil {
354 logger.Warnf("[BackgroundRefresh] Failed to refresh %s: %v", account.Email, err)
355 continue
356 }
357

Callers 1

ServeHTTPMethod · 0.95

Calls 5

authenticateMethod · 0.95
sendOpenAIErrorMethod · 0.95
newAuthErrorFunction · 0.85
withApiKeyContextFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected