Skip to content

Commit

Permalink
fix: header name serialization should be transparent (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagojez authored Nov 26, 2024
1 parent 2442dea commit f9d8e2c
Show file tree
Hide file tree
Showing 20 changed files with 824 additions and 513 deletions.
1,173 changes: 741 additions & 432 deletions Cargo.lock

Large diffs are not rendered by default.

51 changes: 26 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ members = [
"integrationos-database",
"integrationos-unified",
"integrationos-watchdog",
"integrationos-emit",
"integrationos-emit"
]

[workspace.dependencies]
anyhow = "1.0.75"
async-recursion = "1.0.5"
async-trait = "0.1.74"
anyhow = "1.0.93"
async-recursion = "1.1.1"
async-trait = "0.1.83"
axum = { version = "0.7", features = ["macros"] }
base64 = "0.21.5"
base64 = "0.21.7"
base64ct = { version = "1.6.0", features = ["alloc"] }
bson = "2.7.0"
chrono = { version = "0.4.31", features = ["serde"] }
bson = "2.13.0"
chrono = { version = "0.4.38", features = ["serde"] }
convert_case = "0.6.0"
dotenvy = "0.15.7"
envconfig = "0.10.0"
fake = { version = "2.9.2", features = [
fake = { version = "2.10.0", features = [
"uuid",
"derive",
"dummy",
Expand All @@ -35,36 +35,37 @@ fake = { version = "2.9.2", features = [
"serde_json",
"semver",
] }
futures = "0.3.28"
futures-util = "0.3.28"
handlebars = "4.4.0"
futures = "0.3.31"
futures-util = "0.3.31"
handlebars = "4.5.0"
http = "1.1.0"
http-serde-ext = "1.0.2"
http-serde-ext-ios = "1.0.0"
js-sandbox-ios = "0.1.1"
jsonpath_lib = "0.3.0"
jsonwebtoken = "8.3.0"
kube = "0.95.0"
k8s-openapi = "0.23.0"
mockito = "1.2.0"
moka = { version = "0.12.4", features = ["future"] }
mongodb = "2.8.0"
mockito = "1.6.1"
moka = { version = "0.12.8", features = ["future"] }
mongodb = "2.8.2"
num_cpus = "1"
openapiv3 = { version = "2.0.0", features = ["skip_serializing_defaults"] }
rand = "0.8.5"
redis = { version = "0.27", features = ["connection-manager", "tokio-comp"] }
reqwest = { version = "0.12.7", features = [
reqwest = { version = "0.12.9", features = [
"json",
"rustls-tls",
], default-features = false }
semver = { version = "1.0.20", features = ["serde"] }
serde = { version = "1.0.189", features = ["derive", "rc"] }
serde_json = "1.0.107"
schemars = "0.8.16"
sha2 = "0.10.6"
semver = { version = "1.0.23", features = ["serde"] }
serde = { version = "1.0.215", features = ["derive", "rc"] }
serde_json = "1.0.133"
serde_yaml = "0.9.34"
schemars = "0.8.21"
sha2 = "0.10.8"
strum = { version = "0.25", features = ["derive"] }
testcontainers-modules = "0.3"
thiserror = "1.0.56"
tokio = { version = "1.33.0", features = [
thiserror = "1.0.69"
tokio = { version = "1.41.1", features = [
"macros",
"rt-multi-thread",
"time",
Expand All @@ -76,8 +77,8 @@ tower-http = { version = "0.5", features = [
"sensitive-headers",
] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
uuid = { version = "1.5.0", features = ["v4", "serde"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
uuid = { version = "1.11.0", features = ["v4", "serde"] }
validator = { version = "0.16.1", features = ["derive"] }

[profile.release]
Expand Down
10 changes: 5 additions & 5 deletions integrationos-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ envconfig.workspace = true
fake.workspace = true
futures-util.workspace = true
futures.workspace = true
http-serde-ext.workspace = true
http-serde-ext-ios.workspace = true
http.workspace = true
hyper = "0.14.27"
indexmap = "2.1.0"
hyper = "0.14.31"
indexmap = "2.6.0"
integrationos-cache = { path = "../integrationos-cache" }
integrationos-domain = { path = "../integrationos-domain" }
integrationos-unified = { path = "../integrationos-unified" }
Expand All @@ -32,11 +32,11 @@ redis.workspace = true
reqwest.workspace = true
regex = "1"
schemars.workspace = true
segment = "0.2.3"
segment = "0.2.4"
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml = "0.9.34"
serde_yaml.workspace = true
strum.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
Expand Down
2 changes: 1 addition & 1 deletion integrationos-api/src/domain/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub enum MetricType {
Unified(Arc<Connection>),
RateLimited(
Arc<EventAccess>,
#[serde(with = "http_serde_ext::header_value::option")] Option<HeaderValue>,
#[serde(with = "http_serde_ext_ios::header_value::option")] Option<HeaderValue>,
),
}

Expand Down
10 changes: 5 additions & 5 deletions integrationos-api/src/logic/connection_model_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct TestConnectionPayload {
#[serde(rename_all = "camelCase")]
pub struct TestConnectionRequest {
#[serde(
with = "http_serde_ext::header_map::option",
with = "http_serde_ext_ios::header_map::option",
skip_serializing_if = "Option::is_none",
default
)]
Expand All @@ -72,7 +72,7 @@ pub struct TestConnectionRequest {

#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct TestConnectionResponse {
#[serde(with = "http_serde_ext::status_code")]
#[serde(with = "http_serde_ext_ios::status_code")]
pub code: StatusCode,
pub status: TestConnection,
pub meta: Meta,
Expand All @@ -88,7 +88,7 @@ pub struct Meta {
pub connection_definition_id: Id,
pub connection_key: String,
pub model_name: String,
#[serde(with = "http_serde_ext::method")]
#[serde(with = "http_serde_ext_ios::method")]
pub action: http::Method,
}

Expand Down Expand Up @@ -285,10 +285,10 @@ pub struct CreateRequest {
pub path: String,
pub auth_method: AuthMethod,
pub action_name: CrudAction,
#[serde(with = "http_serde_ext::method", rename = "action")]
#[serde(with = "http_serde_ext_ios::method", rename = "action")]
pub http_method: http::Method,
#[serde(
with = "http_serde_ext::header_map::option",
with = "http_serde_ext_ios::header_map::option",
skip_serializing_if = "Option::is_none",
default
)]
Expand Down
2 changes: 1 addition & 1 deletion integrationos-api/src/middleware/blocker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl BlockInvalidHeaders {
loop {
#[derive(Deserialize)]
struct SparseEventAccess {
#[serde(with = "http_serde_ext::header_value", rename = "accessKey")]
#[serde(with = "http_serde_ext_ios::header_value", rename = "accessKey")]
access_key: HeaderValue,
}

Expand Down
12 changes: 6 additions & 6 deletions integrationos-archiver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ chrono.workspace = true
dotenvy.workspace = true
envconfig.workspace = true
futures.workspace = true
google-cloud-storage = "0.22.1"
google-cloud-storage = "0.23.0"
http.workspace = true
integrationos-domain = { path = "../integrationos-domain" }
integrationos-unified = { path = "../integrationos-unified" }
mongodb.workspace = true
reqwest = { workspace = true, features = ["rustls-tls"] }
reqwest-middleware = "0.3.3"
reqwest-retry = "0.6.1"
reqwest-tracing = "0.5.3"
reqwest-middleware = "0.4"
reqwest-retry = "0.7"
reqwest-tracing = "0.5.4"
serde.workspace = true
serde_json.workspace = true
strum = { workspace = true, features = ["derive"] }
tempfile = "3.12.0"
tempfile = "3.14.0"
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tokio-util = "0.7.11"
tokio-util = "0.7.12"
tracing.workspace = true

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions integrationos-database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dotenvy.workspace = true
envconfig.workspace = true
futures-util.workspace = true
futures.workspace = true
http-serde-ext.workspace = true
http-serde-ext-ios.workspace = true
http.workspace = true
hyper = "0.14.27"
hyper = "0.14.31"
integrationos-cache = { path = "../integrationos-cache" }
integrationos-domain = { path = "../integrationos-domain" }
integrationos-unified = { path = "../integrationos-unified" }
Expand Down
22 changes: 11 additions & 11 deletions integrationos-domain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/integration-os/integrationos-domain"
dummy = ["dep:fake"]

[dependencies]
aes = "0.8.3"
aes = "0.8.4"
anyhow.workspace = true
async-recursion.workspace = true
async-trait.workspace = true
Expand All @@ -22,7 +22,7 @@ bson.workspace = true
chrono.workspace = true
ctr = "0.9.2"
digest = "0.10.7"
downcast-rs = "1.2.0"
downcast-rs = "1.2.1"
envconfig.workspace = true
fake = { workspace = true, features = [
"uuid",
Expand All @@ -40,20 +40,20 @@ google-cloud-kms = { version = "0.5.1", features = [
] }
handlebars.workspace = true
hmac = { version = "0.12.1", features = ["std"] }
http-serde-ext.workspace = true
http-serde-ext-ios.workspace = true
http.workspace = true
indexmap = "2.1.0"
indexmap = "2.6.0"
js-sandbox-ios.workspace = true
jsonpath_lib.workspace = true
kube.workspace = true
k8s-openapi = { workspace = true, features = ["latest"] }
mongodb.workspace = true
napi = { version = "2.14.2", default-features = false, features = ["napi4"] }
napi-derive = "2.14.6"
napi = { version = "2.16.13", default-features = false, features = ["napi4"] }
napi-derive = "2.16.12"
openapiv3.workspace = true
percent-encoding = "2.3.1"
pin-project = "1.1.4"
prost = "0.12.3"
pin-project = "1.1.7"
prost = "0.12.6"
rand.workspace = true
reqwest = { workspace = true, features = ["json", "rustls-tls"] }
semver = { workspace = true, features = ["serde"] }
Expand All @@ -80,6 +80,6 @@ tracing-opentelemetry = "0.27"
opentelemetry_sdk = { version = "0.26", features = ["rt-tokio", "trace"] }

[dev-dependencies]
once_cell = "1.19.0"
mockito = "1.2.0"
schemars = "0.8.16"
once_cell = "1.20.2"
mockito = "1.6.1"
schemars = "0.8.21"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct ApiModelConfig {
pub path: String,
pub auth_method: AuthMethod,
#[serde(
with = "http_serde_ext::header_map::option",
with = "http_serde_ext_ios::header_map::option",
skip_serializing_if = "Option::is_none",
default
)]
Expand Down Expand Up @@ -82,7 +82,7 @@ pub struct ResponseModelPaths {
#[serde(rename_all = "camelCase")]
pub struct SamplesInput {
#[serde(
with = "http_serde_ext::header_map::option",
with = "http_serde_ext_ios::header_map::option",
skip_serializing_if = "Option::is_none",
default
)]
Expand All @@ -109,7 +109,7 @@ pub struct SchemasInput {
pub struct ResponseBody {
pub status_code: u16,
#[serde(
with = "http_serde_ext::header_map::option",
with = "http_serde_ext_ios::header_map::option",
skip_serializing_if = "Option::is_none",
default
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct ConnectionModelDefinition {
pub title: String,
pub name: String,
pub model_name: String,
#[serde(with = "http_serde_ext::method")]
#[serde(with = "http_serde_ext_ios::method")]
#[cfg_attr(feature = "dummy", dummy(expr = "http::Method::GET"))]
pub action: http::Method,
pub action_name: CrudAction,
Expand Down
4 changes: 2 additions & 2 deletions integrationos-domain/src/domain/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub struct Event {
pub topic: String,
pub environment: Environment,
pub body: String,
#[serde(with = "http_serde_ext::header_map")]
#[serde(with = "http_serde_ext_ios::header_map")]
pub headers: HeaderMap,
#[serde(with = "chrono::serde::ts_milliseconds")]
pub arrived_at: DateTime<Utc>,
Expand Down Expand Up @@ -66,7 +66,7 @@ pub struct PublicEvent {
pub topic: String,
pub environment: Environment,
pub body: String,
#[serde(with = "http_serde_ext::header_map")]
#[serde(with = "http_serde_ext_ios::header_map")]
pub headers: HeaderMap,
#[serde(with = "chrono::serde::ts_milliseconds")]
pub arrived_at: DateTime<Utc>,
Expand Down
2 changes: 1 addition & 1 deletion integrationos-domain/src/domain/pipeline/destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::prelude::connection::connection_model_definition::CrudAction;
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
pub enum Action {
Passthrough {
#[serde(with = "http_serde_ext::method")]
#[serde(with = "http_serde_ext_ios::method")]
method: http::Method,
#[cfg_attr(feature = "dummy", dummy(expr = "String::new().into()"))]
path: Arc<str>,
Expand Down
2 changes: 1 addition & 1 deletion integrationos-domain/src/domain/pipeline/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::policies::Policies;
pub struct HttpExtractor {
pub key: String,
pub url: String,
#[serde(with = "http_serde_ext::method")]
#[serde(with = "http_serde_ext_ios::method")]
pub method: http::Method,
pub headers: String,
pub data: String,
Expand Down
12 changes: 6 additions & 6 deletions integrationos-emit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ async-trait.workspace = true
chrono.workspace = true
dotenvy.workspace = true
envconfig.workspace = true
fluvio = "0.23.3"
fluvio = "0.23.4"
futures-util.workspace = true
futures.workspace = true
http-serde-ext.workspace = true
http-serde-ext-ios.workspace = true
http.workspace = true
integrationos-domain = { path = "../integrationos-domain" }
mongodb.workspace = true
num_cpus.workspace = true
reqwest = { workspace = true, features = ["rustls-tls"] }
reqwest-middleware = "0.3.3"
reqwest-retry = "0.6.1"
reqwest-tracing = "0.5.3"
reqwest-middleware = "0.4"
reqwest-retry = "0.7"
reqwest-tracing = "0.5.4"
serde = { workspace = true , features = ["derive"] }
serde_json.workspace = true
strum.workspace = true
Expand All @@ -30,7 +30,7 @@ tower-http.workspace = true
tracing.workspace = true
log = "0.4.22"
ctrlc = { version = "3.4.5", features = ["termination"] }
tokio-graceful-shutdown = "0.15.1"
tokio-graceful-shutdown = "0.15.2"

[dev-dependencies]
testcontainers-modules = { workspace = true, features = ["mongo"] }
Expand Down
2 changes: 1 addition & 1 deletion integrationos-event/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ integrationos-domain = { path = "../integrationos-domain" }
integrationos-unified = { path = "../integrationos-unified" }
js-sandbox-ios.workspace = true
metrics = "0.21.1"
metrics-exporter-prometheus = "0.12.1"
metrics-exporter-prometheus = "0.12.2"
moka.workspace = true
mongodb.workspace = true
redis.workspace = true
Expand Down
Loading

0 comments on commit f9d8e2c

Please sign in to comment.