mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 20:30:51 +08:00
fix(service): skip disabled auth entries during executor binding
Prevent disabled auth entries from overriding active provider executors, addressing lingering configs during reloads (e.g., removed OpenAI-compat entries).
This commit is contained in:
@@ -305,6 +305,12 @@ func (s *Service) ensureExecutorsForAuth(a *coreauth.Auth) {
|
|||||||
if s == nil || a == nil {
|
if s == nil || a == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Skip disabled auth entries when (re)binding executors.
|
||||||
|
// Disabled auths can linger during config reloads (e.g., removed OpenAI-compat entries)
|
||||||
|
// and must not override active provider executors (such as iFlow OAuth accounts).
|
||||||
|
if a.Disabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
if compatProviderKey, _, isCompat := openAICompatInfoFromAuth(a); isCompat {
|
if compatProviderKey, _, isCompat := openAICompatInfoFromAuth(a); isCompat {
|
||||||
if compatProviderKey == "" {
|
if compatProviderKey == "" {
|
||||||
compatProviderKey = strings.ToLower(strings.TrimSpace(a.Provider))
|
compatProviderKey = strings.ToLower(strings.TrimSpace(a.Provider))
|
||||||
@@ -738,7 +744,7 @@ func (s *Service) resolveConfigClaudeKey(auth *coreauth.Auth) *config.ClaudeKey
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if attrKey != "" && strings.EqualFold(cfgKey, attrKey) {
|
if attrKey != "" && strings.EqualFold(cfgKey, attrKey) {
|
||||||
if attrBase == "" || cfgBase == "" || strings.EqualFold(cfgBase, attrBase) {
|
if cfgBase == "" || strings.EqualFold(cfgBase, attrBase) {
|
||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user