Skip to content

outbound-networking refactoring #3168

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

Merged
merged 2 commits into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions crates/loader/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use spin_locked_app::{
values::{ValuesMap, ValuesMapBuilder},
};
use spin_manifest::schema::v2::{self, AppManifest, KebabId, WasiFilesMount};
use spin_outbound_networking_config::allowed_hosts::{
AllowedHostsConfig, SERVICE_CHAINING_DOMAIN_SUFFIX,
};
use spin_outbound_networking_config::allowed_hosts::{AllowedHostConfig, AllowedHostsConfig};
use spin_serde::DependencyName;
use std::collections::BTreeMap;
use tokio::{io::AsyncWriteExt, sync::Semaphore};
Expand Down Expand Up @@ -841,19 +839,7 @@ fn requires_service_chaining(component: &spin_manifest::schema::v2::Component) -
}

fn is_chaining_host(pattern: &str) -> bool {
use spin_outbound_networking_config::allowed_hosts::{AllowedHostConfig, HostConfig};

let Ok(allowed) = AllowedHostConfig::parse(pattern) else {
return false;
};

match allowed.host() {
HostConfig::List(hosts) => hosts
.iter()
.any(|h| h.ends_with(SERVICE_CHAINING_DOMAIN_SUFFIX)),
HostConfig::AnySubdomain(domain) => domain == SERVICE_CHAINING_DOMAIN_SUFFIX,
_ => false,
}
AllowedHostConfig::parse(pattern).is_ok_and(|config| config.is_for_service_chaining())
}

const SLOTH_WARNING_DELAY_MILLIS: u64 = 1250;
Expand Down
Loading
Loading