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

Method filterExecutionModels

sdk/cliproxy/auth/conductor.go:1182–1197  ·  view source on GitHub ↗
(auth *Auth, routeModel string, candidates []string, pooled bool)

Source from the content-addressed store, hash-verified

1180}
1181
1182func (m *Manager) filterExecutionModels(auth *Auth, routeModel string, candidates []string, pooled bool) []string {
1183 if len(candidates) == 0 {
1184 return nil
1185 }
1186 now := time.Now()
1187 out := make([]string, 0, len(candidates))
1188 for _, upstreamModel := range candidates {
1189 stateModel := m.stateModelForExecution(auth, routeModel, upstreamModel, pooled)
1190 blocked, _, _ := isAuthBlockedForModel(auth, stateModel, now)
1191 if blocked {
1192 continue
1193 }
1194 out = append(out, upstreamModel)
1195 }
1196 return out
1197}
1198
1199func (m *Manager) preparedExecutionModels(auth *Auth, routeModel string) ([]string, bool) {
1200 candidates := m.executionModelCandidates(auth, routeModel)

Callers 2

Calls 2

isAuthBlockedForModelFunction · 0.85

Tested by

no test coverage detected