mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-30 22:24:55 +08:00
Add device OAuth login via `--copilot-login`, trusted-endpoint token exchange, and per-account model catalog discovery with independent refresh so accounts expose only entitled Chat, Messages, or Responses routes. Implement the executor with official CLI parity defaults, cross-protocol translation, account-scoped thinking, turn linking, and server-side replay of private reasoning and signatures, keeping payload rules final.
29 lines
895 B
Go
29 lines
895 B
Go
package cmd
|
|
|
|
import (
|
|
sdkAuth "github.com/router-for-me/CLIProxyAPI/v8/sdk/auth"
|
|
)
|
|
|
|
// newAuthManager creates a new authentication manager instance with all supported
|
|
// authenticators and a file-based token store. It initializes authenticators for
|
|
// Codex, Claude, Antigravity, Kimi, xAI, Devin, and Meta providers.
|
|
//
|
|
// Returns:
|
|
// - *sdkAuth.Manager: A configured authentication manager instance
|
|
func newAuthManager() *sdkAuth.Manager {
|
|
store := sdkAuth.GetTokenStore()
|
|
manager := sdkAuth.NewManager(store,
|
|
sdkAuth.NewCodexAuthenticator(),
|
|
sdkAuth.NewClaudeAuthenticator(),
|
|
sdkAuth.NewAntigravityAuthenticator(),
|
|
sdkAuth.NewKimiAuthenticator(),
|
|
sdkAuth.NewKimiAIAuthenticator(),
|
|
sdkAuth.NewKimiAIDotAuthenticator(),
|
|
sdkAuth.NewXAIAuthenticator(),
|
|
sdkAuth.CopilotAuthenticator{},
|
|
sdkAuth.NewDevinAuthenticator(),
|
|
sdkAuth.NewMetaAuthenticator(),
|
|
)
|
|
return manager
|
|
}
|