Skip to content

[DT-3848][risk=no] Add the typed search request check (5b/6) - #3351

Open
otchet-broad wants to merge 2 commits into
otchet-dt-3848-fixture-testfrom
otchet-dt-3848-request-check
Open

otchet-broad wants to merge 2 commits into
otchet-dt-3848-fixture-testfrom
otchet-dt-3848-request-check

Conversation

@otchet-broad

@otchet-broad otchet-broad commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Addresses

https://broadworkbench.atlassian.net/browse/DT-3848 (epic DT-4500)
Security risk: no — test files only; no application code or configuration changes.

Summary

Adds TypedSearchRequestCheck, which checks a request against the contract (#3342) and the registry key lists: the scope (its value, the branded library keys, the scopes of each view and the roles that can use them), the fields each view accepts, filter keys and kinds (values, number and date ranges, booleans), facets, sort keys, page limits, and the projection allowed for each scope and role.

TypedSearchRequestTest checks that the status of each fixture fits the order of the checks in contract section 9: a scope that the roles cannot use gets 403 before any other 400; a 400 request breaks a rule of the check or names a serverCheck; any other request breaks none.

Stacked on 5a (#3350); merge that first. This is slice 5b of 6 for DT-3848.


Have you read CONTRIBUTING.md lately? If not, do that first.

  • Label PR with a Jira ticket number and include a link to the ticket
  • Label PR with a security risk modifier [no, low, medium, high]
  • PR describes scope of changes
  • Get a minimum of one thumbs worth of review, preferably two if enough team members are available
  • Get PO sign-off for all non-trivial UI or workflow changes
  • Verify all tests go green
  • Test this change deployed correctly and works on dev environment after deployment

🤖 Generated with Claude Code

Add TypedSearchRequestCheck, which checks a request against the contract and the registry
key lists, and TypedSearchRequestTest, which checks that the status of each fixture fits
the order of the checks: a scope that the roles cannot use gets 403 before any 400, a 400
request breaks a rule or names a serverCheck, and a 200 request breaks none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@otchet-broad
otchet-broad requested a review from a team as a code owner November 25, 2026 22:00
@otchet-broad
otchet-broad requested review from fboulnois and kevinmarete and removed request for a team November 25, 2026 22:00
…t-check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@rushtong rushtong left a comment

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.

Reviewed with Claude and Codex, no medium or high findings 👍

Low Findings

  • Offset check is not exact: src/test/java/org/broadinstitute/consent/http/typedsearch/TypedSearchRequestCheck.java:94 An offset above the largest long wraps and is rejected. An offset of 1.0 passes, but limit must be an integer.
  • Possible null pointer: src/test/java/org/broadinstitute/consent/http/typedsearch/TypedSearchRequestCheck.java:107 A scope with no scopeProjections entry makes rule null, and the check throws.

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.

3 participants