MCPcopy Index your code
hub / github.com/chainreactors/EvilProxy / matchingAuthConfig

Function matchingAuthConfig

internal/pluginstore/auth.go:191–204  ·  view source on GitHub ↗
(auth []AuthConfig, requestURL string, kind string)

Source from the content-addressed store, hash-verified

189}
190
191func matchingAuthConfig(auth []AuthConfig, requestURL string, kind string) (AuthConfig, bool) {
192 requestURL = strings.TrimSpace(requestURL)
193 kind = strings.ToLower(strings.TrimSpace(kind))
194 for _, item := range NormalizeAuthConfigs(auth) {
195 if !pluginStoreURLMatchesAuthRule(requestURL, item.Match) {
196 continue
197 }
198 if !authAppliesTo(item, kind) {
199 continue
200 }
201 return item, true
202 }
203 return AuthConfig{}, false
204}
205
206func pluginStoreURLMatchesAuthRule(requestURL string, matchURL string) bool {
207 request, errRequest := url.Parse(strings.TrimSpace(requestURL))

Callers 3

AuthConfiguredFunction · 0.85
applyPluginStoreAuthFunction · 0.85

Calls 3

authAppliesToFunction · 0.85
NormalizeAuthConfigsFunction · 0.70

Tested by

no test coverage detected