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

Function pluginOAuthModelAliases

internal/pluginhost/auth_provider.go:43–66  ·  view source on GitHub ↗
(in map[string][]config.OAuthModelAlias)

Source from the content-addressed store, hash-verified

41}
42
43func pluginOAuthModelAliases(in map[string][]config.OAuthModelAlias) map[string][]pluginapi.ModelAlias {
44 if len(in) == 0 {
45 return nil
46 }
47 out := make(map[string][]pluginapi.ModelAlias, len(in))
48 for provider, aliases := range in {
49 key := normalizeProviderID(provider)
50 if key == "" {
51 continue
52 }
53 for _, alias := range aliases {
54 name := strings.TrimSpace(alias.Name)
55 value := strings.TrimSpace(alias.Alias)
56 if name == "" || value == "" {
57 continue
58 }
59 out[key] = append(out[key], pluginapi.ModelAlias{Name: name, Alias: value})
60 }
61 }
62 if len(out) == 0 {
63 return nil
64 }
65 return out
66}
67
68func cloneStringSliceMap(in map[string][]string) map[string][]string {
69 if len(in) == 0 {

Callers 1

Calls 1

normalizeProviderIDFunction · 0.85

Tested by

no test coverage detected