Repository navigation
fix(resolver,api): apply qualifier filters across cross-source searches and REST query params - #56
Merged
Conversation
…es and REST query params - Apply applyQualifierFilters (?parsability, ?content_type, ?lang) and lang validation/metadata in typeScopedSearch and namespaceScopedSearch - Filter out URL-less RegistryResult note entries when ?parsability or ?content_type is requested, returning qualifierNotFoundResponse if no URL results remain - Report available parsability values and combined qualifier mismatches in qualifierNotFoundResponse - Support ?parsability, ?content_type, and ?lang as top-level /api/v1/resolve query parameters (and merge unencoded '&' qualifiers) - Strip and forward qualifiers on bare identifier searches in searchBareIdentifier and on type-only SecID strings in parser.ts - Add regression tests across resolver, KV resolver, and REST API test suites Closes #55 Closes #10 AI-Agent: Gemini
…alifiers before slash
Address all 4 P2 findings from fresh-context OpenAI Codex review:
1. Pass top-level HTTP query qualifiers (?parsability, ?content_type, ?lang)
structurally into resolveQuery via capture.qualifiers instead of
string-splicing onto decoded SecID, avoiding subpath corruption when
source-level qualifiers precede '#'.
2. Merge extraQualifiers with parsed.qualifiers inside resolveFromKV and
searchBareIdentifier ({ ...extra, ...inline }) so inline SecID qualifiers
always take precedence regardless of position or key casing.
3. Prevent parameter pollution when decoded top-level query param values
contain '&' or '='.
4. Strip source-level ?qualifiers from head before splitting on '/' in
extractSecIDType and parseSecID so MIME-type slashes (e.g.
secid:advisory?content_type=application/json) are not treated as path
separators.
AI-Agent: Gemini
Contributor
Author
|
Agent: Gemini (SecID governing agent) Independent Two-Review SummaryReview 1: Self-Review (Gemini)
Review 2: Fresh-Context Cross-Vendor Review (OpenAI Codex
|
kurtseifried
added a commit
to CloudSecurityAlliance/SecID-Server-API
that referenced
this pull request
Nov 3, 2026
…ort HTTP qualifier params (#3) (#30) * fix(resolver,api): filter qualifiers across all search paths and support HTTP qualifier params (#3) - Apply _apply_qualifier_filters (?parsability=, ?content_type=, ?lang=) in namespace_scoped_search, type_scoped_search, and _search_bare_identifier to match CloudSecurityAlliance/SecID-Service#56. - Exclude URL-less RegistryResult entries when parsability or content_type qualifiers are requested. - Strip source-level ?qualifiers from head before splitting on '/' in extract_secid_type and parse_secid so MIME slashes do not split head. - Accept top-level parsability, content_type, and lang query parameters on GET /api/v1/resolve and merge them structurally with inline qualifiers. Closes #3 AI-Agent: Gemini * fix(resolver): address Codex review findings on lang weight and diagnostics (#3) - Preserve declared weight in _child_hit (do not add +1 default-lang bonus during cross-source and bare searches). - Use node_matches(..., scoped=scoped) and skip version_required sources in _lang_not_found_message callers so open patterns without known_values do not suppress the related fallback. - Check availability of all active qualifiers in _qualifier_not_found before blaming lang on combined qualifier misses. AI-Agent: Gemini
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.
Agent: Gemini (SecID governing agent)
Summary
Fixes qualifier filtering (
?parsability=,?content_type=,?lang=) across all resolution paths and REST API query parameters:typeScopedSearchandnamespaceScopedSearch(src/resolver.ts):applyQualifierFilters(results, parsed.qualifiers)and returnsqualifierNotFoundResponsewhen qualifiers filter out all results (e.g.,secid:advisory/CVE-2026-0019?parsability=structured).child.data.langagainstparsed.qualifiers.lang, setsres.langon child matches, and surfacesbuildLangNotFoundMessagewhen an identifier matched children whose available languages exclude the requested language.applyQualifierFilters(src/resolver.ts):RegistryResultguidance notes (!("url" in r)) when?parsability=or?content_type=is requested, and signalsnot_foundwhenfiltered.length === 0 && results.length > 0.qualifierNotFoundResponse(src/resolver.ts):parsabilityvalues when?parsability=removes all results, and reports combined qualifier mismatches when each qualifier value exists on different results.src/api.ts):&parsability=,&content_type=, and&lang=query parameters on/api/v1/resolveinto the query when not already present insidesecid=, matching the documented examples inAPI-RESPONSE-FORMAT.mdand handling unencoded&after a SecID qualifier.src/kv-resolve.ts,src/parser.ts):?qualifierson bare identifier searches (e.g.,CVE-2026-0019?parsability=structured) insearchBareIdentifier, and strips inline?qualifiersfrom type-only SecID strings (e.g.,secid:control?country=DE) inextractSecIDTypeandparseSecID.Verification
npm run typecheck(0 errors)npm test(all 17 test files / 899 tests pass)Closes #55
Closes #10