Files
CLIProxyAPI/internal/runtime/executor/oauth_scope_executor.go
hkfires d9922f0589 feat(config): add v8 configuration API
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.
2026-09-27 14:16:27 +08:00

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
}