Skip to content

Resolver returns empty results for namespace-level entity queries with empty match_nodes #11

Closed

Description

@kurtseifried

What

Many entity registry entries have `match_nodes: []` — the entry holds namespace-level metadata (official_name, common_name, urls, etc.) but doesn't pattern-match any specific products or services. When a client queries one of these at the namespace level, the resolver returns `status: "found"` but `results: []`.

Example:

```
$ curl 'https://secid.cloudsecurityalliance.org/api/v1/resolve?secid=secid:entity/adobe.com'
{
"secid_query": "secid:entity/adobe.com",
"status": "found",
"results": []
}
```

But the data IS in the registry:

```
$ curl 'https://secid.cloudsecurityalliance.org/api/v1/registry.json' | jq '.entity["adobe.com"]'
{
"namespace": "adobe.com",
"type": "entity",
"official_name": "Adobe Systems Incorporated",
"urls": [...],
"match_nodes": []
}
```

Scope

Affects every entity entry with empty match_nodes. Before today's sweep that was ~50 entries; after CloudSecurityAlliance/SecID#83 it's ~525 entries (475 new auto-generated stubs + the older ones).

Also potentially affects entries in other types with empty match_nodes, though I haven't audited.

Proposed fix

When the parsed query has a type+namespace but no name, and the namespace's match_nodes is empty (or doesn't exist), return a `RegistryResult` carrying the namespace-level metadata: `official_name`, `common_name`, `alternate_names`, `notes`, `urls`, `wikidata`, `wikipedia`. So:

```json
{
"secid_query": "secid:entity/adobe.com",
"status": "found",
"results": [
{
"secid": "secid:entity/adobe.com",
"data": {
"official_name": "Adobe Systems Incorporated",
"urls": [{"type": "website", "url": "https://adobe.com"}],
"source_count": 0
}
}
]
}
```

This mirrors what `listSources` does for a namespace with match_nodes, just without the per-source enumeration.

Code location (best guess)

`src/resolver.ts` — the `listSources` function handles the namespace-level case. It already iterates `ns.match_nodes.map(...)`; when that array is empty, the resulting array is empty (which is the current behavior). The fix is to return a single fallback RegistryResult with the namespace metadata in that case.

Acceptance criteria

  • `curl secid:entity/adobe.com` returns one result with the metadata, status "found"
  • `curl secid:entity/cisco.com` (which HAS match_nodes) returns its match_node listings unchanged
  • Same fix works for other types — control entries with empty match_nodes, reference entries with empty match_nodes, etc.

Related

  • CloudSecurityAlliance/SecID#83 — added 475 entity stubs that made this gap more visible
  • The pre-existing entity entries (Amazon, etc.) have always had this behavior; the new stubs just multiply the visible cases

🤖 Generated from session

Activity

  1. kurtseifried commented on Nov 5, 2026

    @kurtseifried
    ContributorAuthor

    Agent: Gemini (SecID governing agent)

    Resolved and deployed to production in #64 (verified via post-merge deploy run 41938751408 and live endpoint checks at https://secid.cloudsecurityalliance.org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions