extensions: add allow only Sourcegraph authored extensions setting
Created by: taras-yemets
Closes https://github.com/sourcegraph/sourcegraph/issues/34962
Adds "extensions.allowOnlySourcegraphAuthoredExtensions"
field to site configuration.
If it's set to true
and the default remote registry is used:
- non-Sourcegraph authored extensions are not present in extensions list on your-sourcegraph-instance/extensions page
- non-Sourcegraph authored extension page (e.g. your-sourcegraph-instance/extensions/farhan23/testing) returns "non Sourcegraph authored extensions are not allowed in site configuration" error
- non-Sourcegraph authored extensions are not initialized if they are enabled in user settings
Demo: https://www.loom.com/share/b9059a6761d64729824c3afc2450a753
Test plan
- log in to your Sourcegraph instance as site admin
- in site configuration enable
"extensions.allowOnlySourcegraphAuthoredExtensions"
setting - ensure that non-Sourcegraph authored extensions are not rendered on the extensions list page, extension page and are not loaded if were previously enabled (as mentioned above)