Repository navigation
Conversation
moise10r
left a comment
There was a problem hiding this comment.
Hey @blackmore-technology-group, thanks for jumping on this one! 🙌
I opened #46 because a deny rule that quietly stops matching is the kind of bug that keeps me up at night, so it's great to see it handled this carefully.
What I checked
I checked out your branch and threw the nasty inputs at it:
windows: [null]utcOffsetMinutes: "abc"and99999days: "mon", which I hadn't even thought of
Every one of them now fails loudly with policies[0].match.windows[0] in the message, and the suites are all green on my machine. I also liked that you went through the entries one by one so every bad window gets reported, not just the first. I'd have missed that.
Before I merge
- Could you please bump all four packages in the changeset?
@memnox/cli,@memnox/proxyand@memnox/interceptorsshould sit atpatchnext to@memnox/core, since they always ship together.
The comment about the error message is only a thought, so no pressure there.
Really appreciate you taking the time on this. Hope to see you around the repo again!
| --- | ||
| '@memnox/core': patch | ||
| --- | ||
|
|
||
| Reject malformed policy time windows and UTC offsets outside -840 to 840 minutes so invalid time-scoped rules fail validation instead of crashing or silently not matching. |
There was a problem hiding this comment.
Small one: our four packages always release together, so could you add @memnox/cli, @memnox/proxy and @memnox/interceptors as a patch alongside @memnox/core? Thanks!
| issues.push( | ||
| `${itemPath} needs startHour 0-23, endHour 1-24, days 0-6 when present, and utcOffsetMinutes -840 to 840 when present`, | ||
| ); |
There was a problem hiding this comment.
Totally optional: right now this message lists every constraint, even when only one field is off. If it named the field that failed (something like utcOffsetMinutes must be an integer from -840 to 840), it would point people straight at the fix. Happy to merge either way.
|
Thanks for the review and for checking those edge cases. I’ve pushed the requested changeset update in |
Summary
match.windowsentry as an object before treating it as a time windowutcOffsetMinutesvalues outside-840..840policies[0].match.windows[0]policy-validator.test.tsandtime-window.test.ts@memnox/coreValidation
Passed locally:
git diff --checkOn this Windows environment, the repository-wide test suite has unrelated nondeterministic failures. Repeated differential checks against the untouched base commit on the same machine used 3 isolated A/B rounds for the suspect tests and 2 fresh full-suite A/B rounds; they showed no reproducible failure unique to this change. The repository's Ubuntu/macOS Node 22/24 CI remains the authoritative full-suite validation.
Closes #46