(requestPath string, rulePath string)
| 219 | } |
| 220 | |
| 221 | func pluginStorePathMatchesAuthRule(requestPath string, rulePath string) bool { |
| 222 | if rulePath == "" || rulePath == "/" { |
| 223 | return true |
| 224 | } |
| 225 | if requestPath == "" { |
| 226 | requestPath = "/" |
| 227 | } |
| 228 | if requestPath == rulePath { |
| 229 | return true |
| 230 | } |
| 231 | if strings.HasSuffix(rulePath, "/") { |
| 232 | return strings.HasPrefix(requestPath, rulePath) |
| 233 | } |
| 234 | return strings.HasPrefix(requestPath, rulePath+"/") |
| 235 | } |
| 236 | |
| 237 | func authAppliesTo(item AuthConfig, kind string) bool { |
| 238 | if len(item.ApplyTo) == 0 { |
no outgoing calls
no test coverage detected