-
Notifications
You must be signed in to change notification settings - Fork 271
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
refactor(proxy/http): extricate Body
middleware types
#3382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! A few minor style nits, nothing substantial.
Cargo.toml
Outdated
@@ -85,7 +87,7 @@ members = [ | |||
"opencensus-proto", | |||
"opentelemetry-proto", | |||
"spiffe-proto", | |||
"tools", | |||
"tools", "linkerd/http/override-authority", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format nit: sort and put on it's own line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for spotting this!
this is moved onto its own sorted line in the amended commit 5f9c146
@@ -23,6 +26,27 @@ pub struct OverrideAuthority<S, H> { | |||
inner: S, | |||
} | |||
|
|||
/// Sets the [`Authority`][uri::Authority] of the given URI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: This can just be [`Authority`]
since it's already imported, but I'm not sure what our style guidelines are around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thanks! i appreciate the close eye. 🦅
this is fixed in the amended commit 5f9c146
5f9c146
to
1631681
Compare
rebased to address a minor typo in a commit message 👼 |
in this case we already had a crate defining the classify traits, but the http body and other assorted middleware were defined in `linkerd-proxy-http`. this commit moves those types to the `linkerd-http-classify` crate, which astute readers may notice, is a concrete step towards simplifying the `linkerd-proxy-http` crate's upgrade process. one small detail worth calling out: we implement `http_body::Body` directly, to avoid taking on a `hyper` dependency. otherwise, nothing has changed in the `channel`, `gate`, and `insert` middleware. Signed-off-by: katelyn martin <[email protected]>
this moves the `Retain` middleware from `linkerd-proxy-http` into a new `linkerd-http-retain` crate. as previously, reëxports are added to make this a backwards compatible change. this moves another http body middleware out of the proxy's core http crate. great news. Signed-off-by: katelyn martin <[email protected]>
) this commit outlines the stream timeout middleware, pulling it out of `linkerd-proxy-http` and into a standalone crate. again, reëxports are added to make this a backwards compatible change. Signed-off-by: katelyn martin <[email protected]>
…3382) NB: based on #3379 and #3380. this pull the `override_authority` submodule out of `linkerd-http-proxy` and into a standalone crate. Signed-off-by: katelyn martin <[email protected]>
1631681
to
7f564f9
Compare
in this case we already had a crate defining the classify traits, but the http body and other assorted middleware were defined in `linkerd-proxy-http`. this commit moves those types to the `linkerd-http-classify` crate, which astute readers may notice, is a concrete step towards simplifying the `linkerd-proxy-http` crate's upgrade process. one small detail worth calling out: we implement `http_body::Body` directly, to avoid taking on a `hyper` dependency. otherwise, nothing has changed in the `channel`, `gate`, and `insert` middleware. Signed-off-by: katelyn martin <[email protected]>
this moves the `Retain` middleware from `linkerd-proxy-http` into a new `linkerd-http-retain` crate. as previously, reëxports are added to make this a backwards compatible change. this moves another http body middleware out of the proxy's core http crate. great news. Signed-off-by: katelyn martin <[email protected]>
) this commit outlines the stream timeout middleware, pulling it out of `linkerd-proxy-http` and into a standalone crate. again, reëxports are added to make this a backwards compatible change. Signed-off-by: katelyn martin <[email protected]>
…3382) NB: based on #3379 and #3380. this pull the `override_authority` submodule out of `linkerd-http-proxy` and into a standalone crate. Signed-off-by: katelyn martin <[email protected]>
7f564f9
to
cb9f511
Compare
this is only used in once place, so as a brief chore before we move the upgrade submodule out into its own crate, we pull `is_bad_request()` next to its call site. Signed-off-by: katelyn martin <[email protected]>
this moves the inter-related `upgrade` and `glue` submodules out of the `linkerd-proxy-http` library and into a new standalone crate. Signed-off-by: katelyn martin <[email protected]>
cb9f511
to
61d2a63
Compare
rebased onto the latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is looking good to me.
this branch pulls a number of components providing
http_body::Body
middleware out oflinkerd-proxy-http
and into new libraries:linkerd-http-classify
,linkerd-http-stream-timeouts
,linkerd-http-retain
, andlinkerd-http-override-authority
.these are each performed in distinct commits, to facilitate review.