API for JQL search on behalf of JSM customer

I’m looking for a Java API to do an arbitrary JQL search (queries are configured by Jira admins) on behalf of JSM customer in customer portal.
In other words, I want to do a JQL search on JSM requests that are visible to the current user (jsm customer).

I’m currently investigating only Server/DC for now, as Cloud definetely has no API that can remotely be useful for this case.

I’m assuming com.atlassian.jira.bc.issue.search.SearchService is no use by default, because it’s applying regular product permisions, which does not align with JSM permissions.

The closest thing I could find is com.atlassian.servicedesk.api.request.ServiceDeskCustomerRequestService#getCustomerRequests, but it doesn’t support arbitrary queries

So the my idea is to use something like com.atlassian.jira.issue.search.SearchProvider#search with isOverrideSecurity=true and jsm permissions query in luceneQuery.
But if it’s the only option, this raises the question if there’s a service that can build the permissions query, because building it myself is not a very good idea from security standpoint.