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

Function executorKeyFromAuth

sdk/cliproxy/auth/conductor.go:5637–5659  ·  view source on GitHub ↗
(auth *Auth)

Source from the content-addressed store, hash-verified

5635}
5636
5637func executorKeyFromAuth(auth *Auth) string {
5638 if auth == nil {
5639 return ""
5640 }
5641 if auth.Attributes != nil {
5642 providerKey := strings.TrimSpace(auth.Attributes["provider_key"])
5643 compatName := strings.TrimSpace(auth.Attributes["compat_name"])
5644 if compatName != "" {
5645 if providerKey == "" {
5646 providerKey = compatName
5647 }
5648 return util.OpenAICompatibleProviderKey(providerKey)
5649 }
5650 }
5651 if strings.EqualFold(strings.TrimSpace(auth.Provider), "openai-compatibility") {
5652 providerKey := strings.TrimSpace(auth.Label)
5653 if providerKey == "" {
5654 providerKey = "openai-compatibility"
5655 }
5656 return util.OpenAICompatibleProviderKey(providerKey)
5657 }
5658 return strings.ToLower(strings.TrimSpace(auth.Provider))
5659}
5660
5661// logEntryWithRequestID returns a logrus entry with request_id field if available in context.
5662func logEntryWithRequestID(ctx context.Context) *log.Entry {

Callers 14

upsertAuthLockedMethod · 0.85
buildScheduledAuthMetaFunction · 0.85
closestCooldownWaitMethod · 0.85
retryAllowedMethod · 0.85
pickNextLegacyMethod · 0.85
pickNextMethod · 0.85
pickNextMixedLegacyMethod · 0.85
pickNextMixedMethod · 0.85
homeRuntimeAuthByIDMethod · 0.85
pickNextViaHomeMethod · 0.85
InjectCredentialsMethod · 0.85

Calls 1

Tested by

no test coverage detected