(parser PluginAuthParser, req pluginapi.AuthParseRequest)
| 342 | } |
| 343 | |
| 344 | func 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 | |
| 358 | func compactPluginAuths(auths []*cliproxyauth.Auth) []*cliproxyauth.Auth { |
| 359 | if len(auths) == 0 { |
no test coverage detected