Hi,
TUF (as in the TUF specification) doesn't really provide any means for searching for things -- this is probably good as it would likely be difficult to make the right design decisions for all use cases.
Currently it's also true that ngclient does not expose the targets metadata to caller: I think I wouldn't oppose exposing it if there is a clear need for that. However...
There is an additional hurdle: once you start using delegated targets, a search implemented over generic TUF metadata basically stops working. The delegating metadata does not know what targets the delegated metadata provides so a client
would potentially need to download all metadata to conclusively respond to a query.
For this reason (and because the search requirements are application specific), I think it makes sense to implement search "above" TUF: This could mean creating application specific index files that are added into the repository as TUF
target files. Then your client knows to download a specific index, uses the index file to search for the actual targetname, then downloads the target.
That said, I can see how some search use cases could be implemented by just looking at targets metadata (possibly with some custom fields in it). Accomodating for that in ngclient sounds totally fine: please file a feature request on
github if you think you've got a case where that makes sense.
Hope that helps,
Jussi