Files
CLIProxyAPI/internal/cmd/auth_manager.go
hkfires 7ae771fcb4 feat(copilot): add GitHub Copilot provider support
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.
2026-11-20 23:14:11 +08:00

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
}