Skip to content

Introduce parameterized query attributes for GrantTypeSqlQueryBuilder - #2931

Open
aktaskaan wants to merge 12 commits into
masterfrom
ccd_5259_ccd_6209
Open

Introduce parameterized query attributes for GrantTypeSqlQueryBuilder#2931
aktaskaan wants to merge 12 commits into
masterfrom
ccd_5259_ccd_6209

Conversation

@aktaskaan

@aktaskaan aktaskaan commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/CCD-5259
https://tools.hmcts.net/jira/browse/CCD-6209

Change description

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

… to enhance security and flexibility in dynamic query construction. Tightened field ID validation in `SortOrderQueryBuilder`
@aktaskaan aktaskaan changed the title Introduce parameterized query attributes for GrantTypeSqlQueryBuilder… Introduce parameterized query attributes for GrantTypeSqlQueryBuilder Jul 23, 2026
@aktaskaan
aktaskaan force-pushed the ccd_5259_ccd_6209 branch from 8f603a3 to 28db210 Compare July 24, 2026 12:40

public static final String CASE_ACCESS_CATEGORY = "data" + " #>> '{CaseAccessCategory}'";

public static final String JURISDICTION_PARAM = "jurisdiction_%s_%s";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These ABAC parameter names are predictable and share the same namespace as user search criteria params. A user field like case.region_1_basic is allowed, becomes
region_1_basic, and is bound after ABAC params in SearchQueryFactoryOperation, overwriting this predicate value. Please use a reserved/collision-proof prefix for all ABAC
params and add a regression test.

Supporting refs if needed:
SearchQueryFactoryOperation.java:89-90
Criterion.java:26-27
FieldMapSanitizeOperation.java:19

…e query safety, enforce collision checks, and update test cases for parameter consistency validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants