Skip to content

feat: adding cookie (exist , not exist) conditions - #376

Merged
JosephSamirL merged 1 commit into
main-convertfrom
feat/adding-exist-not-exist-cookie-condition
Apr 15, 2026
Merged

feat: adding cookie (exist , not exist) conditions#376
JosephSamirL merged 1 commit into
main-convertfrom
feat/adding-exist-not-exist-cookie-condition

Conversation

@JosephSamirL

@JosephSamirL JosephSamirL commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Changes:
1- Add exists, not_exists, and doesNotExist comparison methods to evaluate cookie presence/absence without value matching
2- Update RuleManager.isValidRule() to allow existence operators without a value field
3- Update RuleManager._processRuleItem() to correctly evaluate existence operators when the key is missing or data is empty
4- Add unit tests for all new comparison methods and rule evaluation scenarios

@JosephSamirL JosephSamirL self-assigned this Apr 15, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces 'exists' and 'doesNotExist' operators to the rule engine, enabling checks for the presence or absence of data keys. The changes include updates to rule validation in RuleManager, new comparison logic in the Comparisons utility, and comprehensive unit tests. Review feedback identifies a logic bug where existence checks may be unreachable when the input data object is empty and recommends including the 'not_exists' alias in both validation and processing logic for consistency.

Comment thread packages/rules/src/rule-manager.ts Outdated
Comment thread packages/rules/src/rule-manager.ts Outdated
@JosephSamirL
JosephSamirL force-pushed the feat/adding-exist-not-exist-cookie-condition branch from 9bd703d to 8cbf791 Compare April 15, 2026 13:28
@JosephSamirL
JosephSamirL requested a review from abbaseya April 15, 2026 13:32
Comment thread packages/rules/src/rule-manager.ts Outdated
@JosephSamirL
JosephSamirL force-pushed the feat/adding-exist-not-exist-cookie-condition branch from 8cbf791 to ecae4f6 Compare April 15, 2026 13:44
@JosephSamirL
JosephSamirL force-pushed the feat/adding-exist-not-exist-cookie-condition branch from ecae4f6 to 8183b67 Compare April 15, 2026 13:48
@sonarqubecloud

Copy link
Copy Markdown

@JosephSamirL
JosephSamirL requested a review from abbaseya April 15, 2026 13:50
@JosephSamirL
JosephSamirL merged commit f5529c3 into main-convert Apr 15, 2026
5 checks passed
@JosephSamirL
JosephSamirL deleted the feat/adding-exist-not-exist-cookie-condition branch April 15, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants