Skip to content

feat(policy): add search support to ListKeyAccessServers - #3557

Merged
c-r33d merged 2 commits into
search-term-implfrom
dspx-2740-listkeyaccessservers-search
Jun 2, 2026
Merged

feat(policy): add search support to ListKeyAccessServers#3557
c-r33d merged 2 commits into
search-term-implfrom
dspx-2740-listkeyaccessservers-search

Conversation

@c-r33d

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

Copy link
Copy Markdown
Contributor

Summary

  • Adds ListKeyAccessServers RPC search support by wiring request search into the policy DB list query.
  • Applies escaped, case-insensitive matching in the KAS registry SQL path and adds integration coverage for search behavior, wildcard literals, empty search, and pagination after filtering.

@coderabbitai

coderabbitai Bot commented Jun 1, 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: 66f2fa8a-c9fe-4a3b-b826-1a17e8ea3d06

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 dspx-2740-listkeyaccessservers-search

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.

@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 introduces search capabilities to the ListKeyAccessServers RPC, enabling users to filter results by name or URI. The implementation leverages a new SQL filtering layer that ensures case-insensitive matching while correctly handling wildcard characters. Additionally, the changes include robust integration tests to verify the search logic, pagination, and edge cases like empty search terms.

Highlights

  • Search Functionality: Added search support to the ListKeyAccessServers RPC, allowing for case-insensitive matching on KAS names and URIs.
  • Database Layer: Updated the SQL query logic to include a filtering step using LIKE patterns, with support for escaping wildcard literals.
  • Integration Testing: Introduced comprehensive integration tests covering search behavior, empty queries, whitespace handling, and pagination consistency after filtering.
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 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.


The search is added to the list, / No KAS shall now be missed. / With patterns clear and SQL tight, / The registry is now just right.

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.

@github-actions github-actions Bot added comp:db DB component comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) size/s labels Jun 1, 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 implements search functionality for key access servers by name and URI. It introduces a filtered CTE in the SQL query to perform case-insensitive matching using LIKE with wildcard escaping, and adds comprehensive integration tests to verify this behavior. The feedback suggests removing the redundant LOWER(kas.name) call in the SQL query, as the name is already stored in lowercase, which will optimize query execution.

Comment thread service/policy/db/queries/key_access_server_registry.sql Outdated
@github-actions

github-actions Bot commented Jun 1, 2026

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 189.42602ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 442.653944ms
Throughput 225.91 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.162426435s
Average Latency 439.054756ms
Throughput 113.22 requests/second

@c-r33d
c-r33d marked this pull request as ready for review June 2, 2026 13:59
@c-r33d
c-r33d requested review from a team as code owners June 2, 2026 13:59
@c-r33d

c-r33d commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Jun 2, 2026

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 176.25024ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 464.618759ms
Throughput 215.23 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.784333423s
Average Latency 436.040118ms
Throughput 114.20 requests/second

c-r33d added 2 commits June 2, 2026 10:10
@c-r33d
c-r33d force-pushed the dspx-2740-listkeyaccessservers-search branch from 4c15967 to 32999de Compare June 2, 2026 15:10
@github-actions

github-actions Bot commented Jun 2, 2026

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 195.789299ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

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

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 431.137485ms
Throughput 231.94 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 46.17866477s
Average Latency 459.923514ms
Throughput 108.28 requests/second

@github-actions

github-actions Bot commented Jun 2, 2026

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 b21822a into search-term-impl Jun 2, 2026
35 checks passed
@c-r33d
c-r33d deleted the dspx-2740-listkeyaccessservers-search branch June 2, 2026 15:31
c-r33d added a commit that referenced this pull request Jun 15, 2026
## Summary
- Adds ListKeyAccessServers RPC search support by wiring request search
into the policy DB list query.
- Applies escaped, case-insensitive matching in the KAS registry SQL
path and adds integration coverage for search behavior, wildcard
literals, empty search, and pagination after filtering.

---------

Signed-off-by: Chris Reed <creed@virtru.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:db DB component comp:policy Policy Configuration ( attributes, subject mappings, resource mappings, kas registry) size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants