feat(ipns): server-side name search on ListKeys - #103
Merged
Conversation
ListKeys only returned all keys. The portal /api/ipns/keys endpoint is a queryutil list endpoint, so name substring search can run server-side via filters[name][contains] with zero portal changes, rather than fetch-then-filter client-side. Add ListKeyOption/WithFilterName threading the contains filter onto the request query as filters[name][contains]=<name>. ListKeys keeps its no-filters call path unchanged for existing callers; the mock is updated to the variadic signature. End-to-end test asserts the contains filter is sent server-side and that a plain ListKeys sends no filter; mutation-verified the query wiring.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Coverage ReportTotal Coverage: 11.2% Generated from commit: 6ccf2fc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds server-side name search to IPNS key listing, matching the request-editor pattern already used by portal-sdk.
The portal /api/ipns/keys endpoint is a queryutil list endpoint supporting filters[name][contains] for name substring search. The ipfs-sdk ListKeys ignored this, so name search would have to be client-side. Now it runs server-side.
Changes:
End-to-end test asserts the contains filter is actually sent server-side and that a plain ListKeys sends no filter. Wiring mutation-verified. All ipfs-sdk tests pass.
Summary
This PR adds server-side name search capability to the IPNS key listing functionality (
ListKeys).Changes
API Enhancement
ListKeysnow accepts optionalListKeyOptionparameters, enabling callers to filter IPNS keys by name.ListKeyOptiontype with aWithFilterName(name string)method was introduced, allowing callers to narrow results to keys whose names contain a given substring.Server-Side Filtering
filters[name][contains]=<name>query parameter to the portal's/api/ipns/keysendpoint.Supporting Changes
IPNSServiceinterface signature was updated to accept variadicListKeyOptionparameters.ListKeyscall sends the correctfilters[name][contains]query parameter.ListKeyscall sends no filters.No portal-side changes are required since the endpoint already supports queryutil list-query filtering.