Commit 8d83315
refactor: add PROPERTY_OPERATORS constant for match_property (#448)
* feat: add semver targeting support to local flag evaluation
Implement 9 semver comparison operators (semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, semver_wildcard) for feature flag local evaluation. Uses regex-based parsing that matches the server-side sortableSemver behavior to handle v-prefix, whitespace, pre-release suffixes, and non-standard version formats.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* fix: guard against ReDoS in semver regex parsing
Add input length limit before regex search to prevent polynomial
backtracking on adversarial input (CodeQL py/polynomial-redos).
* fix: replace regex with string parsing to resolve ReDoS warning
Replace SEMVER_EXTRACT_RE regex with simple string splitting to
eliminate nested quantifiers that CodeQL flagged as polynomial-redos.
* refactor: inline semver operator tuple to match existing patterns
* refactor: add PROPERTY_OPERATORS constant for match_property
Extract all operator strings into a single source-of-truth tuple and
validate against it early in match_property, replacing the fallthrough
at the end of the function.
* refactor: split PROPERTY_OPERATORS into composable sub-groups
Break the flat tuple into category-specific tuples (EQUALITY_OPERATORS,
STRING_OPERATORS, etc.) that compose into PROPERTY_OPERATORS via
concatenation. The semver dispatch code now references
SEMVER_OPERATORS and SEMVER_COMPARISON_OPERATORS instead of
repeating the full operator lists inline.
* fix: add unreachable fallthrough to satisfy mypy return check
* add release
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>1 parent 1e1e566 commit 8d83315
2 files changed
Lines changed: 36 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
21 | 45 | | |
22 | 46 | | |
23 | 47 | | |
| |||
385 | 409 | | |
386 | 410 | | |
387 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
388 | 415 | | |
389 | 416 | | |
390 | 417 | | |
| |||
505 | 532 | | |
506 | 533 | | |
507 | 534 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 535 | + | |
519 | 536 | | |
520 | 537 | | |
521 | 538 | | |
522 | 539 | | |
523 | 540 | | |
524 | 541 | | |
525 | 542 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
| 543 | + | |
534 | 544 | | |
535 | 545 | | |
536 | 546 | | |
| |||
578 | 588 | | |
579 | 589 | | |
580 | 590 | | |
581 | | - | |
| 591 | + | |
| 592 | + | |
582 | 593 | | |
583 | 594 | | |
584 | 595 | | |
| |||
0 commit comments