Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
28
backend/sdk/auth/refresh_registry.go
Normal file
28
backend/sdk/auth/refresh_registry.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
cliproxyauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
||||
)
|
||||
|
||||
func init() {
|
||||
registerRefreshLead("codex", func() Authenticator { return NewCodexAuthenticator() })
|
||||
registerRefreshLead("claude", func() Authenticator { return NewClaudeAuthenticator() })
|
||||
registerRefreshLead("antigravity", func() Authenticator { return NewAntigravityAuthenticator() })
|
||||
registerRefreshLead("kimi", func() Authenticator { return NewKimiAuthenticator() })
|
||||
registerRefreshLead("xai", func() Authenticator { return NewXAIAuthenticator() })
|
||||
}
|
||||
|
||||
func registerRefreshLead(provider string, factory func() Authenticator) {
|
||||
cliproxyauth.RegisterRefreshLeadProvider(provider, func() *time.Duration {
|
||||
if factory == nil {
|
||||
return nil
|
||||
}
|
||||
auth := factory()
|
||||
if auth == nil {
|
||||
return nil
|
||||
}
|
||||
return auth.RefreshLead()
|
||||
})
|
||||
}
|
||||
Loading…
Reference in a new issue