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

Function parsePluginAuthFile

sdk/auth/filestore.go:344–356  ·  view source on GitHub ↗
(parser PluginAuthParser, req pluginapi.AuthParseRequest)

Source from the content-addressed store, hash-verified

342}
343
344func parsePluginAuthFile(parser PluginAuthParser, req pluginapi.AuthParseRequest) ([]*cliproxyauth.Auth, bool, error) {
345 if parser == nil {
346 return nil, false, nil
347 }
348 if multiParser, ok := parser.(PluginMultiAuthParser); ok {
349 return multiParser.ParseAuths(context.Background(), req)
350 }
351 auth, handled, errParse := parser.ParseAuth(context.Background(), req)
352 if errParse != nil || !handled || auth == nil {
353 return nil, handled, errParse
354 }
355 return []*cliproxyauth.Auth{auth}, true, nil
356}
357
358func compactPluginAuths(auths []*cliproxyauth.Auth) []*cliproxyauth.Auth {
359 if len(auths) == 0 {

Callers 1

readAuthFilesMethod · 0.85

Calls 2

ParseAuthsMethod · 0.65
ParseAuthMethod · 0.65

Tested by

no test coverage detected