-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
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?
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.
|
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. |
I will check this |
do you mean here to use $allowedProviders = $this->appConfig->getValueArray('core', 'unified_search.providers_allowed'); which is set via ./occ config:app:set --value '["files","settings"]' --type array core unified_search.providers_allowed |
b7a3c9a
to
923692a
Compare
923692a
to
41d2e62
Compare
Looks good to me. Could you answer my previous question? #48841 (review) |
41d2e62
to
9fcd189
Compare
Not sure what "endpoint" mean. |
No, I meant if you make requests to the search controllers, I suspect that disabled providers will still answer results. |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
You are right... ..the GET call to "disabled" controller I should also disable it |
9fcd189
to
da9d705
Compare
I moved the logic into the Now API call to disabled provider delivers same response as request to not existing search provider e.g. <?xml version="1.0"?>
<ocs>
<meta>
<status>failure</status>
<statuscode>996</statuscode>
<message>Internal Server Error
</message>
</meta>
<data/>
</ocs> |
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.
The admin documentation should mention somewhere that this is possible and how! Nice to have is probably a new follow issue covers the complete implementation of the occ command with list and dis/enable features.
Looks good @printminion-co. Can you rebase? |
…rch.providers_allowed reduce search providers by setting core config value to unified_search.providers_allowed = [ 'files', 'setting' ] ./occ config:app:set --value '["files","settings"]' --type array core unified_search.providers_allowed Signed-off-by: Misha M.-Kupriyanov <[email protected]>
da9d705
to
8e57004
Compare
rebase done
|
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
./occ config:app:set --value '["files","settings"]' --type array core unified_search.providers_allowed
TODO
/ocs/v2.php/search/providers/settings/search?term=f&from=%2Fapps%2Ffiles%2Ffiles
Checklist