feat: optimization enable/disable auth files

This commit is contained in:
Yang Bian
2026-01-23 18:03:09 +08:00
parent 19b4ef33e0
commit c8620d1633
4 changed files with 22 additions and 2 deletions

View File

@@ -680,6 +680,10 @@ func (s *Service) registerModelsForAuth(a *coreauth.Auth) {
if a == nil || a.ID == "" {
return
}
if a.Disabled {
GlobalModelRegistry().UnregisterClient(a.ID)
return
}
authKind := strings.ToLower(strings.TrimSpace(a.Attributes["auth_kind"]))
if authKind == "" {
if kind, _ := a.AccountInfo(); strings.EqualFold(kind, "api_key") {