| 379 | } |
| 380 | |
| 381 | function hasMidStringWildcard(pattern: string): boolean { |
| 382 | // Wildcards we DO support: bare `*`, `service:*`, `prefix*` (single |
| 383 | // trailing `*`). Anything else (mid-string `*` or `?`) is mid-string. |
| 384 | if (pattern === "*") return false; |
| 385 | if (pattern.endsWith(":*")) return false; |
| 386 | if (pattern.endsWith("*") && !pattern.slice(0, -1).includes("*")) return false; |
| 387 | return pattern.includes("*") || pattern.includes("?"); |
| 388 | } |
| 389 | |
| 390 | function actionMatches(pattern: string, action: string): boolean { |
| 391 | if (pattern === "*") return true; |