mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-22 00:50:26 +00:00
Add complete GitHub Copilot support including: - Device flow OAuth authentication via GitHub's official client ID - Token management with automatic caching (25 min TTL) - OpenAI-compatible API executor for api.githubcopilot.com - 16 model definitions (GPT-5 variants, Claude variants, Gemini, Grok, Raptor) - CLI login command via -github-copilot-login flag - SDK authenticator and refresh registry integration Enables users to authenticate with their GitHub Copilot subscription and use it as a backend provider alongside existing providers.
26 lines
811 B
Go
26 lines
811 B
Go
package cmd
|
|
|
|
import (
|
|
sdkAuth "github.com/router-for-me/CLIProxyAPI/v6/sdk/auth"
|
|
)
|
|
|
|
// newAuthManager creates a new authentication manager instance with all supported
|
|
// authenticators and a file-based token store. It initializes authenticators for
|
|
// Gemini, Codex, Claude, Qwen, IFlow, Antigravity, and GitHub Copilot providers.
|
|
//
|
|
// Returns:
|
|
// - *sdkAuth.Manager: A configured authentication manager instance
|
|
func newAuthManager() *sdkAuth.Manager {
|
|
store := sdkAuth.GetTokenStore()
|
|
manager := sdkAuth.NewManager(store,
|
|
sdkAuth.NewGeminiAuthenticator(),
|
|
sdkAuth.NewCodexAuthenticator(),
|
|
sdkAuth.NewClaudeAuthenticator(),
|
|
sdkAuth.NewQwenAuthenticator(),
|
|
sdkAuth.NewIFlowAuthenticator(),
|
|
sdkAuth.NewAntigravityAuthenticator(),
|
|
sdkAuth.NewGitHubCopilotAuthenticator(),
|
|
)
|
|
return manager
|
|
}
|