feat(policy): add search support to ListKeys#3558
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds substring search filtering to KAS registry key listing. The source SQL query gains an optional ChangesKAS Registry Key Search
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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. Comment |
Summary of ChangesHello, 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 introduces search capabilities to the ListKeys RPC, allowing users to filter keys by ID. The changes involve updating the database query layer to support partial, case-insensitive matching while ensuring that special characters are properly escaped. Additionally, the integration test suite has been expanded to validate the new search functionality across various edge cases and pagination scenarios. Highlights
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. Using Gemini Code AssistThe 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
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 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. The keys we list with search in mind, / A specific match we hope to find. / With SQL tweaks and tests in place, / We search the list at steady pace. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements search functionality for listing Key Access Server (KAS) keys. It updates the database queries to support a search term parameter that filters keys by ID using a case-insensitive LIKE match with wildcard escaping. Additionally, a comprehensive suite of integration tests has been added to verify search behavior, including combining search with other filters, handling empty queries, whitespace, wildcards, and pagination. No review comments were provided, so there is no additional feedback.
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.
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
f891fba to
0bd2c0e
Compare
X-Test Failure Report |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@service/integration/kas_registry_key_test.go`:
- Around line 819-831: Test_ListKeys_SearchTrimsWhitespace_Succeeds currently
only verifies left-trimming by passing " "+keyID; extend the test to also verify
trailing-space and whitespace-only inputs so both TrimSpace behaviors are
covered. Update the test (using the existing createListKeysSearchTestKeys helper
and ListKeys call) to include: a ListKeys request with Search.Term set to
keyID+" " (trailing space) and another with Search.Term set to " " (or multiple
spaces) to ensure a whitespace-only query returns the same single result; assert
NoError, Len==1, returned key ID equals keyIDsByKID[keyID], and pagination
total==1 for each case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e389b9ce-bb1d-41c0-a755-4b3360632afa
📒 Files selected for processing (4)
service/integration/kas_registry_key_test.goservice/policy/db/key_access_server_registry.goservice/policy/db/key_access_server_registry.sql.goservice/policy/db/queries/key_access_server_registry.sql
Signed-off-by: Chris Reed <creed@virtru.com>
6d62d91 to
bea7b8e
Compare
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
Invalidated by push of a064ce2
Benchmark results, click to expandBenchmark authorization.GetDecisions Results:
Benchmark authorization.v2.GetMultiResourceDecision Results:
Benchmark Statistics
Bulk Benchmark Results
TDF3 Benchmark Results:
|
|
## Summary - Adds ListKeys RPC search support by wiring request search into the policy DB list query. - Applies escaped, case-insensitive matching in the KAS key SQL path and adds integration coverage for search behavior, wildcard literals, empty search, whitespace handling, and pagination after filtering. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Search capability for KAS registry keys by key ID. * Search input automatically trims leading and trailing whitespace. * Wildcard characters in search queries are properly escaped. * Search results work seamlessly with existing filters and pagination. * **Tests** * Added comprehensive test coverage for search functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Chris Reed <creed@virtru.com>
Summary
Summary by CodeRabbit
Release Notes
New Features
Tests