mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-10-19 22:19:12 +08:00
Introduce the v8 management configuration tree with migration-aware reads and writes, grouped upstream API-key providers, and independent v8 operational routes. Preserve legacy configuration compatibility while ensuring successful v8 writes migrate layouts, redact JSON TURN secrets, and keep OAuth-only provider settings from affecting API-key credentials.
75 lines
1.9 KiB
Go
75 lines
1.9 KiB
Go
package executor
|
|
|
|
import cliproxyauth "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/auth"
|
|
|
|
// ForAPIKey binds configuration once after credential selection. Value receivers
|
|
// copy executor configuration while preserving shared transport/session stores.
|
|
func (e CodexExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e ClaudeExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e GeminiExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e GeminiVertexExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e OpenAICompatExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e MetaExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e XAIExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
e.cfg = e.cfg.ForAPIKey()
|
|
return &e
|
|
}
|
|
|
|
func (e CodexWebsocketsExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
if e.CodexExecutor != nil {
|
|
e.CodexExecutor = e.CodexExecutor.ForAPIKey().(*CodexExecutor)
|
|
}
|
|
return &e
|
|
}
|
|
|
|
func (e XAIWebsocketsExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
if e.XAIExecutor != nil {
|
|
e.XAIExecutor = e.XAIExecutor.ForAPIKey().(*XAIExecutor)
|
|
}
|
|
return &e
|
|
}
|
|
|
|
func (e CodexAutoExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
if e.httpExec != nil {
|
|
e.httpExec = e.httpExec.ForAPIKey().(*CodexExecutor)
|
|
}
|
|
if e.wsExec != nil {
|
|
e.wsExec = e.wsExec.ForAPIKey().(*CodexWebsocketsExecutor)
|
|
}
|
|
return &e
|
|
}
|
|
|
|
func (e XAIAutoExecutor) ForAPIKey() cliproxyauth.ProviderExecutor {
|
|
if e.httpExec != nil {
|
|
e.httpExec = e.httpExec.ForAPIKey().(*XAIExecutor)
|
|
}
|
|
if e.wsExec != nil {
|
|
e.wsExec = e.wsExec.ForAPIKey().(*XAIWebsocketsExecutor)
|
|
}
|
|
return &e
|
|
}
|