Skip to content

Commit dae8ca3

Browse files
authored
Merge pull request #3167 from spinframework/outbound-networking-config
Move outbound networking config to new crate
2 parents 4a99166 + 6333c35 commit dae8ca3

File tree

19 files changed

+1021
-947
lines changed

19 files changed

+1021
-947
lines changed

Cargo.lock

Lines changed: 17 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/factor-outbound-http/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use http::{
1313
};
1414
use intercept::OutboundHttpInterceptor;
1515
use spin_factor_outbound_networking::{
16-
BlockedNetworks, ComponentTlsClientConfigs, OutboundAllowedHosts, OutboundNetworkingFactor,
16+
config::{allowed_hosts::OutboundAllowedHosts, blocked_networks::BlockedNetworks},
17+
ComponentTlsClientConfigs, OutboundNetworkingFactor,
1718
};
1819
use spin_factors::{
1920
anyhow, ConfigureAppContext, Factor, PrepareContext, RuntimeFactors, SelfInstanceBuilder,

crates/factor-outbound-http/src/wasi.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use anyhow::Context;
44
use http::{header::HOST, Request};
55
use http_body_util::BodyExt;
66
use spin_factor_outbound_networking::{
7-
BlockedNetworks, ComponentTlsClientConfigs, OutboundAllowedHosts, TlsClientConfig,
7+
config::{allowed_hosts::OutboundAllowedHosts, blocked_networks::BlockedNetworks},
8+
ComponentTlsClientConfigs, TlsClientConfig,
89
};
910
use spin_factors::{wasmtime::component::ResourceTable, RuntimeFactorsInstanceState};
1011
use tokio::{net::TcpStream, time::timeout};

crates/factor-outbound-mqtt/src/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration};
22

33
use anyhow::Result;
44
use spin_core::{async_trait, wasmtime::component::Resource};
5-
use spin_factor_outbound_networking::OutboundAllowedHosts;
5+
use spin_factor_outbound_networking::config::allowed_hosts::OutboundAllowedHosts;
66
use spin_world::v2::mqtt::{self as v2, Connection, Error, Qos};
77
use tracing::{instrument, Level};
88

crates/factor-outbound-mysql/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ mod host;
33

44
use client::Client;
55
use mysql_async::Conn as MysqlClient;
6-
use spin_factor_outbound_networking::{OutboundAllowedHosts, OutboundNetworkingFactor};
6+
use spin_factor_outbound_networking::{
7+
config::allowed_hosts::OutboundAllowedHosts, OutboundNetworkingFactor,
8+
};
79
use spin_factors::{Factor, InitContext, RuntimeFactors, SelfInstanceBuilder};
810
use spin_world::v1::mysql as v1;
911
use spin_world::v2::mysql::{self as v2};

crates/factor-outbound-networking/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@ anyhow = { workspace = true }
99
futures-util = { workspace = true }
1010
http = { workspace = true }
1111
ip_network = "0.4.1"
12-
ip_network_table = "0.2.0"
1312
rustls = { workspace = true }
1413
rustls-pki-types = { workspace = true }
1514
serde = { workspace = true }
16-
spin-expressions = { path = "../expressions" }
1715
spin-factor-variables = { path = "../factor-variables" }
1816
spin-factor-wasi = { path = "../factor-wasi" }
1917
spin-factors = { path = "../factors" }
2018
spin-locked-app = { path = "../locked-app" }
2119
spin-manifest = { path = "../manifest" }
20+
spin-outbound-networking-config = { path = "../outbound-networking-config" }
2221
spin-serde = { path = "../serde" }
2322
tracing = { workspace = true }
2423
url = { workspace = true }
25-
urlencoding = "2"
2624
webpki-roots = "0.26"
2725

2826
[dev-dependencies]

0 commit comments

Comments
 (0)