You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request a feature to intercept and validate search queries. The purpose of this feature is to ensure that access to certain products and channels can be gated before the query is processed and send to Typesense.
Use Case
In my use case, I need to restrict the usage of specific channels in the search input filter to enforce access control. For example:
Certain channels should not be available for selection in the search filter for unauthorized users.
If no channel is specified, instead of using the default channel, I want to search in all channels the user has access to. Like this, exclusive products stay protected from unauthorized access
Additionally, I might need to validate and potentially modify other search input parameter to align with custom business rules.
Currently, overriding the search query would typically allow me to achieve this. However, since the AdvancedSearchPlugin is already overriding the search query, further overrides would result in bad practice and potential maintenance issues.
Proposed Solution
I suggest introducing an InjectableStrategy that allows validation and manipulation of the search input before it is processed and sent to the underlying search service (e.g., Typesense). This strategy could provide the following benefits:
Allow developers to validate inputs and ensure they conform to business logic (e.g., preventing use of restricted channels).
Enable safe and modular manipulation of search inputs without conflicting with the existing query-building logic in the AdvancedSearchPlugin.
A hook to validate search inputs before they are processed.
A way to modify or filter inputs programmatically, e.g., disallowing the default channel or limiting searches to only the channels the user has access to.
Benefits
Improved flexibility and control over search queries.
Input parameter validation
Tracking of search queries, other then clickhouse (own, custom logic)
Cleaner architecture by avoiding multiple conflicting overrides.
Enhanced security and compliance with access restrictions. (in my case)
The text was updated successfully, but these errors were encountered:
Summary
I would like to request a feature to intercept and validate search queries. The purpose of this feature is to ensure that access to certain products and channels can be gated before the query is processed and send to Typesense.
Use Case
In my use case, I need to restrict the usage of specific channels in the search input filter to enforce access control. For example:
Currently, overriding the search query would typically allow me to achieve this. However, since the
AdvancedSearchPlugin
is already overriding the search query, further overrides would result in bad practice and potential maintenance issues.Proposed Solution
I suggest introducing an
InjectableStrategy
that allows validation and manipulation of the search input before it is processed and sent to the underlying search service (e.g., Typesense). This strategy could provide the following benefits:AdvancedSearchPlugin
.Expected Behavior
The new
InjectableStrategy
should provide:Benefits
The text was updated successfully, but these errors were encountered: