feat(targets): gate sidecar runtime policy (#3388)

* feat(targets): gate sidecar runtime policy

* fix(admin): add extension route policy specs
This commit is contained in:
安正超
2026-06-12 17:42:12 +08:00
committed by GitHub
parent 434b71e569
commit e80b72ae79
4 changed files with 243 additions and 5 deletions
+8 -3
View File
@@ -22,7 +22,7 @@ use crate::manifest::{
TargetPluginExternalRuntimeContract, TargetPluginManifest, TargetPluginMarketplaceManifest, TargetPluginRuntimeTransport,
installable_target_marketplace_manifest,
};
use crate::runtime::sidecar::SidecarPluginRuntime;
use crate::runtime::sidecar::{SidecarPluginRuntime, SidecarRuntimePolicy, SidecarRuntimeSafetyChecks};
use crate::runtime::sidecar_protocol::{SIDECAR_RUNTIME_PROTOCOL_VERSION, SidecarHandshake, SidecarPluginCapability};
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -76,8 +76,13 @@ pub fn example_external_webhook_plugin() -> ExampleInstallableTargetPlugin {
};
let mut runtime = SidecarPluginRuntime::new("grpc://127.0.0.1:50051", handshake);
runtime
.enable(base.plugin_id, TargetDomain::Notify)
.expect("example sidecar plugin handshake should validate");
.enable_with_policy(
base.plugin_id,
TargetDomain::Notify,
&SidecarRuntimePolicy::verified_external(16, std::time::Duration::from_secs(5), 3),
&SidecarRuntimeSafetyChecks::verified(0),
)
.expect("example sidecar plugin policy should validate");
ExampleInstallableTargetPlugin {
manifest,