Skip to content

chore(policy): List rpc search validation tests - #3612

Merged
c-r33d merged 4 commits into
search-term-implfrom
list-rpc-search-validation-tests
Jun 15, 2026
Merged

chore(policy): List rpc search validation tests#3612
c-r33d merged 4 commits into
search-term-implfrom
list-rpc-search-validation-tests

Conversation

@c-r33d

@c-r33d c-r33d commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds proto validation coverage for policy.Search on each List RPC that supports search.

Changes

  • Added validation tests confirming search can be provided with a non-empty term.
  • Added validation tests confirming search can be omitted.
  • Added validation tests confirming present-but-empty search fails validation.
  • Updated existing ListNamespacesRequest search validation to include the empty-search failure case.

opentdf-automation Bot and others added 4 commits June 15, 2026 14:04
🤖 I have created a release *beep* *boop*
---


##
[0.33.0](protocol/go/v0.32.0...protocol/go/v0.33.0)
(2026-06-12)


### ⚠ BREAKING CHANGES

* **policy:** DSPX-2998 add namespace fields to resource mapping protos
([#3565](#3565))

### Features

* **authz:** make v2 request limits configurable
([#3508](#3508))
([9d16f80](9d16f80))
* **core:** Add search term information to protos.
([#3547](#3547))
([40f35df](40f35df))
* **policy:** DSPX-2998 add namespace fields to resource mapping protos
([#3565](#3565))
([e4a04ed](e4a04ed))


### Bug Fixes

* **ci:** Prefer go.work for toolchain info
([#3285](#3285))
([3c05b22](3c05b22))
* **deps:** bump the external group across 1 directory with 4 updates
([#3494](#3494))
([5b87b2b](5b87b2b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: opentdf-automation[bot] <149537512+opentdf-automation[bot]@users.noreply.github.com>
1.) Set `min_len` of search term to 1 when the field is present
2.) Remove `Search` from `ListRegisteredResourceValues` and
`ListObligationTriggers`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Enforced minimum length validation for search terms to prevent empty
searches.
  * Fixed field numbering conflicts in request messages.

* **Refactor**
* Updated request schemas to improve pagination handling in policy
service requests.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Chris Reed <creed@virtru.com>
@c-r33d
c-r33d requested review from a team as code owners June 15, 2026 19:13
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 68a858a7-f83d-465c-bc4b-acc16a51f2ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch list-rpc-search-validation-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) comp:ci Github Actions Work docs Documentation labels Jun 15, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of search functionality across multiple List RPCs by introducing strict validation rules for search terms. By enforcing a minimum length on the search term, the system ensures that invalid or empty search queries are rejected early. The changes include updates to protocol buffer definitions, expanded test suites to verify these validation rules, and cleanup of generated documentation.

Highlights

  • Proto Validation Update: Updated the policy.Search message definition to enforce a minimum length of 1 for the term field using buf.validate.
  • Test Coverage Expansion: Added comprehensive validation tests for various List RPCs to ensure search terms are correctly validated, including cases for valid terms, omitted search, and empty search strings.
  • Documentation Cleanup: Removed outdated search field documentation from generated gRPC HTML files.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: docs/openapi/**/* (7)
    • docs/openapi/policy/attributes/attributes.openapi.yaml
    • docs/openapi/policy/kasregistry/key_access_server_registry.openapi.yaml
    • docs/openapi/policy/namespaces/namespaces.openapi.yaml
    • docs/openapi/policy/obligations/obligations.openapi.yaml
    • docs/openapi/policy/registeredresources/registered_resources.openapi.yaml
    • docs/openapi/policy/selectors.openapi.yaml
    • docs/openapi/policy/subjectmapping/subject_mapping.openapi.yaml
  • Ignored by pattern: protocol/**/* (4)
    • protocol/go/CHANGELOG.md
    • protocol/go/policy/obligations/obligations.pb.go
    • protocol/go/policy/registeredresources/registered_resources.pb.go
    • protocol/go/policy/selectors.pb.go
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


A search term must have some length, To give our validation strength. No empty strings allowed to pass, We keep our data clean, alas.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@c-r33d c-r33d changed the title List rpc search validation tests chore(policy): List rpc search validation tests Jun 15, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the search term in selectors.proto to enforce a minimum length of 1, removes the search field from ListObligationTriggersRequest and ListRegisteredResourceValuesRequest, and adds corresponding validation tests. Feedback suggests adding a pattern constraint to the search term to prevent whitespace-only inputs and removing an extra empty line in obligations.proto left after the field removal.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread service/policy/selectors.proto
Comment thread service/policy/obligations/obligations.proto
@github-actions

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 269.623776ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 94.732623ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 587.620359ms
Throughput 170.18 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.60676318s
Average Latency 433.663492ms
Throughput 114.66 requests/second

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • examples
  • otdfctl
  • sdk
  • service
  • lib/fixtures
  • tests-bdd

See the workflow run for details.

@c-r33d
c-r33d merged commit 12e8a22 into search-term-impl Jun 15, 2026
35 of 39 checks passed
@c-r33d
c-r33d deleted the list-rpc-search-validation-tests branch June 15, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:ci Github Actions Work comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) docs Documentation size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants