MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / supportedModelSetForAuth

Function supportedModelSetForAuth

sdk/cliproxy/auth/scheduler.go:552–573  ·  view source on GitHub ↗

supportedModelSetForAuth snapshots the registry models currently registered for an auth.

(authID string)

Source from the content-addressed store, hash-verified

550
551// supportedModelSetForAuth snapshots the registry models currently registered for an auth.
552func supportedModelSetForAuth(authID string) map[string]struct{} {
553 authID = strings.TrimSpace(authID)
554 if authID == "" {
555 return nil
556 }
557 models := registry.GetGlobalRegistry().GetModelsForClient(authID)
558 if len(models) == 0 {
559 return nil
560 }
561 set := make(map[string]struct{}, len(models))
562 for _, model := range models {
563 if model == nil {
564 continue
565 }
566 modelKey := canonicalModelKey(model.ID)
567 if modelKey == "" {
568 continue
569 }
570 set[modelKey] = struct{}{}
571 }
572 return set
573}
574
575// upsertAuthLocked updates every existing model shard that can reference the auth metadata.
576func (p *providerScheduler) upsertAuthLocked(meta *scheduledAuthMeta, now time.Time) {

Callers 1

buildScheduledAuthMetaFunction · 0.85

Calls 3

GetGlobalRegistryFunction · 0.92
canonicalModelKeyFunction · 0.85
GetModelsForClientMethod · 0.80

Tested by

no test coverage detected