Enforce marketplace source policy for curated plugins (#41953)

## Why

Marketplace source restrictions should cover curated plugins backed by the OpenAI plugins repository, not only user-configured marketplaces.

## What changed

- Validate both local curated catalogs against the existing OpenAI plugins Git source allowlist.
- Apply that policy to catalog discovery, installation, cached plugin and skill loading, and startup repository sync.
- Keep bundled and remote installed plugins independent of the curated Git source policy.

## Testing

Added coverage for exact and shorthand Git allowlist entries, host patterns, blocked and invalid rules, curated catalog variants, plugin skills, startup sync, and remote installed plugins.

GitOrigin-RevId: 04617acb4a93040c70a13759eb4ce872877ba211
This commit is contained in:
willwang-openai authored and copyberry committed 2026-09-01 01:37:15 +00:00
1 parent 55e5158e18
commit 633ab199cf
8 files changed
+388 -3

No files matched your search

+7 -1
View File
@@ -69,6 +69,7 @@ use crate::remote_plugin_id_resolver::RemoteInstalledPluginsSnapshot;
use crate::remote_plugin_id_resolver::RemotePluginIdResolver;
use crate::remote_plugin_id_resolver::persisted_remote_plugin_id_for_installation;
use crate::skill_snapshots::new_plugin_skill_snapshots;
use crate::startup_sync::OPENAI_PLUGINS_GIT_URL;
use crate::startup_sync::curated_plugins_api_marketplace_path;
use crate::startup_sync::curated_plugins_repo_path;
use crate::startup_sync::read_curated_plugins_sha;
@@ -677,7 +678,12 @@ impl PluginsManager {
config: &PluginsConfigInput,
on_effective_plugins_changed: Option<EffectivePluginsChangedCallback>,
) {
if config.plugins_enabled && !self.remote_global_catalog_active(config) {
if config.plugins_enabled
&& !self.remote_global_catalog_active(config)
&& MarketplacePolicy::from_requirements(config.config_layer_stack.requirements())
.validate_git_source(OPENAI_PLUGINS_GIT_URL, /*ref_name*/ None)
.is_ok()
{
self.start_curated_repo_sync(
config.http_client_factory.clone(),
on_effective_plugins_changed,