Skip to content

[DT-3848][risk=no] Add the typed search request self-test (5c/6) - #3353

Open
otchet-broad wants to merge 2 commits into
otchet-dt-3848-request-checkfrom
otchet-dt-3848-request-self-test
Open

otchet-broad wants to merge 2 commits into
otchet-dt-3848-request-checkfrom
otchet-dt-3848-request-self-test

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 TypedSearchRequestSelfTest and self-test/requests.json: 24 requests that each break one rule of the contract, a request one past each limit of contract section 6 (10,001 ids, 1,025 filters, 1,025 values, 1,001 characters of search text or of a filter value), and an offset past the largest int that must pass. Each must be rejected by TypedSearchRequestCheck.

Stacked on 5b (#3351); merge that first. This is slice 5c 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 TypedSearchRequestSelfTest and self-test/requests.json: 24 requests that each break one
rule, a request one past each limit of the contract (ids, filters, values, text), and an
offset past the largest int that must pass.

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
…st-self-test

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.

1. [Medium] Self-test does not exercise the role rules: src/test/java/org/broadinstitute/consent/http/typedsearch/TypedSearchRequestSelfTest.java:69 Each bad request runs with the roles fixed to ADMIN. The test discards the access errors and asserts only that a shape error exists. The "cannot use scope" (403) rule and the "cannot use projection" rule never fire, so their removal leaves the test green. The class Javadoc claims that each rule is checked.

Low Findings

  • Limits tested only above the limit: src/test/java/org/broadinstitute/consent/http/typedsearch/TypedSearchRequestSelfTest.java:44 No case asserts that a request exactly at a limit passes, so an off-by-one error stays hidden.

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