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

Function NormalizeOAuthExcludedModels

internal/config/config.go:1152–1172  ·  view source on GitHub ↗

NormalizeOAuthExcludedModels cleans provider -> excluded models mappings by normalizing provider keys and applying model exclusion normalization to each entry.

(entries map[string][]string)

Source from the content-addressed store, hash-verified

1150// NormalizeOAuthExcludedModels cleans provider -> excluded models mappings by normalizing provider keys
1151// and applying model exclusion normalization to each entry.
1152func NormalizeOAuthExcludedModels(entries map[string][]string) map[string][]string {
1153 if len(entries) == 0 {
1154 return nil
1155 }
1156 out := make(map[string][]string, len(entries))
1157 for provider, models := range entries {
1158 key := strings.ToLower(strings.TrimSpace(provider))
1159 if key == "" {
1160 continue
1161 }
1162 normalized := NormalizeExcludedModels(models)
1163 if len(normalized) == 0 {
1164 continue
1165 }
1166 out[key] = normalized
1167 }
1168 if len(out) == 0 {
1169 return nil
1170 }
1171 return out
1172}
1173
1174// hashSecret hashes the given secret using bcrypt.
1175func hashSecret(secret string) (string, error) {

Callers 4

ParseConfigBytesFunction · 0.85
LoadConfigOptionalFunction · 0.85

Calls 1

NormalizeExcludedModelsFunction · 0.85

Tested by

no test coverage detected