mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 04:40:52 +08:00
refactor(client): remove deprecated and unused methods for cleaner session handling and core auth management
This commit is contained in:
@@ -772,18 +772,7 @@ func (cs *ChatSession) RCID() string {
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
func (cs *ChatSession) setCID(v string) {
|
|
||||||
if len(cs.metadata) < 1 {
|
|
||||||
cs.metadata = normalizeMeta(cs.metadata)
|
|
||||||
}
|
|
||||||
cs.metadata[0] = v
|
|
||||||
}
|
|
||||||
func (cs *ChatSession) setRID(v string) {
|
|
||||||
if len(cs.metadata) < 2 {
|
|
||||||
cs.metadata = normalizeMeta(cs.metadata)
|
|
||||||
}
|
|
||||||
cs.metadata[1] = v
|
|
||||||
}
|
|
||||||
func (cs *ChatSession) setRCID(v string) {
|
func (cs *ChatSession) setRCID(v string) {
|
||||||
if len(cs.metadata) < 3 {
|
if len(cs.metadata) < 3 {
|
||||||
cs.metadata = normalizeMeta(cs.metadata)
|
cs.metadata = normalizeMeta(cs.metadata)
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/router-for-me/CLIProxyAPI/v6/internal/api"
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/api"
|
||||||
baseauth "github.com/router-for-me/CLIProxyAPI/v6/internal/auth"
|
|
||||||
geminiwebclient "github.com/router-for-me/CLIProxyAPI/v6/internal/client/gemini-web"
|
geminiwebclient "github.com/router-for-me/CLIProxyAPI/v6/internal/client/gemini-web"
|
||||||
"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/config"
|
||||||
"github.com/router-for-me/CLIProxyAPI/v6/internal/registry"
|
"github.com/router-for-me/CLIProxyAPI/v6/internal/registry"
|
||||||
@@ -270,33 +269,6 @@ func (s *Service) ensureAuthDir() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) syncCoreAuthFromClients(ctx context.Context, _ map[string]any) { _ = ctx }
|
|
||||||
|
|
||||||
func (s *Service) startRefreshLoop() {
|
|
||||||
// legacy refresh loop disabled; core auth manager handles auto refresh
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *Service) refreshTokens(ctx context.Context) { _ = ctx /* no-op */ }
|
|
||||||
|
|
||||||
func (s *Service) snapshotFileClients() map[string]any { return nil }
|
|
||||||
|
|
||||||
// persistClients deprecated: no legacy clients remain
|
|
||||||
func (s *Service) persistClients() {}
|
|
||||||
|
|
||||||
// refreshCachesFromCombined deprecated: no legacy clients remain
|
|
||||||
func (s *Service) refreshCachesFromCombined(_ map[string]any) {}
|
|
||||||
|
|
||||||
// combineClients deprecated
|
|
||||||
|
|
||||||
func (s *Service) refreshWithManager(ctx context.Context, provider, filePath string, storage baseauth.TokenStorage, metadata map[string]string) {
|
|
||||||
_ = ctx
|
|
||||||
_ = provider
|
|
||||||
_ = filePath
|
|
||||||
_ = storage
|
|
||||||
_ = metadata
|
|
||||||
// legacy file-backed refresh was replaced by core auth manager auto refresh
|
|
||||||
}
|
|
||||||
|
|
||||||
// syncCoreAuthFromAuths registers or updates core auths and disables missing ones.
|
// syncCoreAuthFromAuths registers or updates core auths and disables missing ones.
|
||||||
func (s *Service) syncCoreAuthFromAuths(ctx context.Context, auths []*coreauth.Auth) {
|
func (s *Service) syncCoreAuthFromAuths(ctx context.Context, auths []*coreauth.Auth) {
|
||||||
if s.coreManager == nil {
|
if s.coreManager == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user