mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-04 03:05:39 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user