(parser PluginAuthParser, req pluginapi.AuthParseRequest)
| 212 | } |
| 213 | |
| 214 | func parsePluginFileAuths(parser PluginAuthParser, req pluginapi.AuthParseRequest) ([]*coreauth.Auth, bool, error) { |
| 215 | if parser == nil { |
| 216 | return nil, false, nil |
| 217 | } |
| 218 | if multiParser, ok := parser.(PluginMultiAuthParser); ok { |
| 219 | return multiParser.ParseAuths(context.Background(), req) |
| 220 | } |
| 221 | auth, handled, errParse := parser.ParseAuth(context.Background(), req) |
| 222 | if errParse != nil || !handled || auth == nil { |
| 223 | return nil, handled, errParse |
| 224 | } |
| 225 | return []*coreauth.Auth{auth}, true, nil |
| 226 | } |
| 227 | |
| 228 | func compactPluginAuths(auths []*coreauth.Auth) []*coreauth.Auth { |
| 229 | if len(auths) == 0 { |
no test coverage detected