Skip to content

Commit

Permalink
refactor(proxy/http): create linkerd-http-insert crate
Browse files Browse the repository at this point in the history
this pulls out the `insert` module from `linkerd-proxy-http`.

a reëxport is added so that this does not affect the public api of the
http crate.

NB: based on #3379.

Signed-off-by: katelyn martin <[email protected]>
  • Loading branch information
cratelyn committed Nov 21, 2024
1 parent 9241bbb commit 3a3807e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,17 @@ dependencies = [
name = "linkerd-http-h2"
version = "0.1.0"

[[package]]
name = "linkerd-http-insert"
version = "0.1.0"
dependencies = [
"futures",
"http",
"linkerd-stack",
"pin-project",
"tower",
]

[[package]]
name = "linkerd-http-metrics"
version = "0.1.0"
Expand Down Expand Up @@ -2166,6 +2177,7 @@ dependencies = [
"linkerd-http-classify",
"linkerd-http-executor",
"linkerd-http-h2",
"linkerd-http-insert",
"linkerd-http-version",
"linkerd-io",
"linkerd-proxy-balance",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ members = [
"linkerd/http/classify",
"linkerd/http/executor",
"linkerd/http/h2",
"linkerd/http/insert",
"linkerd/http/metrics",
"linkerd/http/prom",
"linkerd/http/retry",
Expand Down
18 changes: 18 additions & 0 deletions linkerd/http/insert/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "linkerd-http-insert"
version = "0.1.0"
authors = ["Linkerd Developers <[email protected]>"]
license = "Apache-2.0"
edition = "2021"
publish = false
description = """
Tower middleware to insert parameters into HTTP extensions.
"""

[dependencies]
futures = { version = "0.3", default-features = false }
http = "0.2"
pin-project = "1"
tower = { version = "0.4", default-features = false }

linkerd-stack = { path = "../../stack" }
File renamed without changes.
1 change: 1 addition & 0 deletions linkerd/proxy/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ linkerd-http-box = { path = "../../http/box" }
linkerd-http-classify = { path = "../../http/classify" }
linkerd-http-executor = { path = "../../http/executor" }
linkerd-http-h2 = { path = "../../http/h2" }
linkerd-http-insert = { path = "../../http/insert" }
linkerd-http-version = { path = "../../http/version" }
linkerd-io = { path = "../../io" }
linkerd-proxy-balance = { path = "../balance" }
Expand Down
2 changes: 1 addition & 1 deletion linkerd/proxy/http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ mod glue;
pub mod h1;
pub mod h2;
mod header_from_target;
pub mod insert;
pub mod normalize_uri;
pub mod orig_proto;
mod override_authority;
Expand Down Expand Up @@ -48,6 +47,7 @@ pub use http::{
pub use hyper::body::HttpBody;
pub use linkerd_http_box::{BoxBody, BoxRequest, BoxResponse, EraseResponse};
pub use linkerd_http_executor::TracingExecutor;
pub use linkerd_http_insert as insert;
pub use linkerd_http_version::{self as version, Version};

#[derive(Clone, Debug)]
Expand Down

0 comments on commit 3a3807e

Please sign in to comment.