-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: reduce search providers per config value "unified_search_providers_allowed" #48841
base: master
Are you sure you want to change the base?
feat: reduce search providers per config value "unified_search_providers_allowed" #48841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the endpoint also not responding when searching in disabled providers?
* @param array $providers | ||
* @return array | ||
*/ | ||
private function reduceProviders(array $providers): array { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private function reduceProviders(array $providers): array { | |
private function filterProviders(array $providers): array { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure, as far as I know we do not have documentation about available search providers. So this config would be blind-guessing.
Maybe it is safer to make it an app config first until we have a occ command to list search providers?
@printminion-co would this be ok for you? |
I've added more description and screenshots to better describe the feature.
|
…ders_allowed reduce search providers by setting config value to unified_search_providers_allowed = [ 'files', 'setting' ] ./occ config:system:set unified_search_providers_allowed 0 --value files ./occ config:system:set unified_search_providers_allowed 1 --value settings Signed-off-by: Misha M.-Kupriyanov <[email protected]>
8939114
to
a30aba1
Compare
For you this might be true, but my fear is that this will confuse other administrators of Nextcloud systems, because of the missing listing / documentation.
Well if you know that API endpoint to retrive the available providers yes. What I meant is: That is why I asked if instead of system config also an app config would work? Instead of writing it to the config.php just have it as an From my side no blocker, but just wanted to bring this up as this might lead to confusion in the future. |
* | ||
* For example: Set to ['files', 'settings'] to only allow file and settings search. | ||
*/ | ||
'unified_search_providers_allowed' => [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep the same format for all related options:
'unified_search_providers_allowed' => [], | |
'unified_search.providers_allowed' => [], |
I will check this |
Summary
This feature should help to restrict not desired search providers by allowing only desired search providers.
Before
One can see the
/ocs/v2.php/search/providers
deliver various search providers (you may see other providers on your nextcloud instance depending on installed/disabled apps).After feature activation
One can see we allowed only the
files
andsettings
search providers (since we do not want to allow any other search providers).CLI Example: restrict search providers to
files
andsettings
TODO
Checklist