8000 request-filter: Allow altering request type by olix0r · Pull Request #685 · linkerd/linkerd2-proxy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

request-filter: Allow altering request type #685

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 1 commit into from
Sep 30, 2020
Merged

Conversation

olix0r
Copy link
Member
@olix0r olix0r commented Sep 30, 2020

The request filter takes ownership of the request but does not support
changing its type. Furthermore, the trait requires that the error type
be named even though it always coerced to an Error.

This change cleans up the request-filter module as follows:

  • The RequestFilter trait is now named FilterRequest (traits
    generally are verbs). This type now has a Request type attribute
    instead of an Error type attribute.
  • The Service has been renamed to RequestFilter and the
    RequstFilterLayer type has been eliminated.
  • The manual future implementation can be eliminated with Either.
  • The stack helper has been removed, as it's only used in one place.

The request filter takes ownership of the request but does not support
changing its type. Furthermore, the trait requires that the error type
be named even though it always coerced to an `Error`.

This change cleans up the request-filter module as follows:

- The `RequestFilter` trait is now named `FilterRequest` (traits
  generally are verbs). This type now has a `Request` type attribute
  instead of an `Error` type attribute.
- The `Service` has been renamed to `RequestFilter` and the
  `RequstFilterLayer` type has been eliminated.
- The manual future implementation can be eliminated with `Either`.
- The stack helper has been removed, as it's only used in one place.
@olix0r olix0r requested a review from a team September 30, 2020 22:28
hawkw
< 8000 svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check">
Copy link
Contributor
@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this all seems good to me!

i had to double check whether or not RequestFilter was derived from an upstream Tower thing that we might want to contribute back to, but it looks like the tower::filter stuff has a separate heritage.

@olix0r olix0r merged commit fb6e5bd into main Sep 30, 2020
@olix0r olix0r deleted the ver/request-filter branch September 30, 2020 23:30
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Oct 2, 2020
This release includes changes to TCP metrics to ensure that peer
identities are encoded via the `client_id` and `server_id` labels.

---

* outbound: Explicitly ignore the source address for tap (linkerd/linkerd2-proxy#680)
* Update proxy-api and tonic (linkerd/linkerd2-proxy#682)
* http: Lazily build http/tcp stacks (linkerd/linkerd2-proxy#681)
* outbound: Remove required identity from HttpLogical (linkerd/linkerd2-proxy#683)
* profiles: Expose the fully_qualified_name (linkerd/linkerd2-proxy#684)
* request-filter: Support altering the request type (linkerd/linkerd2-proxy#685)
* tracing: Set contexts in new_service/make_service (linkerd/linkerd2-proxy#686)
* discover: Allow resolution streams to terminate (linkerd/linkerd2-proxy#689)
* metrics: add peer identities to all TLS metric labels (linkerd/linkerd2-proxy#687)
* outbound: Return a default endpoint on reject (linkerd/linkerd2-proxy#690)
* Skip endpoint resolution when profile lookup is rejected (linkerd/linkerd2-proxy#691)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Oct 2, 2020
This release includes changes to TCP metrics to ensure that peer
identities are encoded via the `client_id` and `server_id` labels.

---

* outbound: Explicitly ignore the source address for tap (linkerd/linkerd2-proxy#680)
* Update proxy-api and tonic (linkerd/linkerd2-proxy#682)
* http: Lazily build http/tcp stacks (linkerd/linkerd2-proxy#681)
* outbound: Remove required identity from HttpLogical (linkerd/linkerd2-proxy#683)
* profiles: Expose the fully_qualified_name (linkerd/linkerd2-proxy#684)
* request-filter: Support altering the request type (linkerd/linkerd2-proxy#685)
* tracing: Set contexts in new_service/make_service (linkerd/linkerd2-proxy#686)
* discover: Allow resolution streams to terminate (linkerd/linkerd2-proxy#689)
* metrics: add peer identities to all TLS metric labels (linkerd/linkerd2-proxy#687)
* outbound: Return a default endpoint on reject (linkerd/linkerd2-proxy#690)
* Skip endpoint resolution when profile lookup is rejected (linkerd/linkerd2-proxy#691)
cratelyn added a commit that referenced this pull request Mar 14, 2025
this commit updates our tower dependency from 0.4 to 0.5.

note that this commit does not affect the `tower-service` and
`tower-layer` crates, reëxported by `tower` itself. the `Service<T>`
trait and the closely related `Layer<S>` trait have not been changed.

the `tower` crate's utilities have changed in various ways, some of
particular note for the linkerd2 proxy. see these items, excerpted from
the tower changelog:

- **retry**: **Breaking Change** `retry::Policy::retry` now accepts `&mut Req` and `&mut Res` instead of the previous mutable versions. This
  increases the flexibility of the retry policy. To update, update your method signature to include `mut` for both parameters. ([#584])
- **retry**: **Breaking Change** Change Policy to accept &mut self ([#681])
- **retry**: Add generic backoff utilities ([#685])
- **retry**: **Breaking Change** `Budget` is now a trait. This allows end-users to implement their own budget and bucket implementations. ([#703])
- **util**: **Breaking Change** `Either::A` and `Either::B` have been renamed `Either::Left` and `Either::Right`, respectively. ([#637])
- **util**: **Breaking Change** `Either` now requires its two services to have the same error type. ([#637])
- **util**: **Breaking Change** `Either` no longer implemenmts `Future`. ([#637])
- **buffer**: **Breaking Change** `Buffer<S, Request>` is now generic over `Buffer<Request, S::Future>.` ([#654])

the `Either` trait bounds are particularly impactful for us.

* <tower-rs/tower@v0.4.x...master>
* <https://github.com/tower-rs/tower/blob/master/tower/CHANGELOG.md>
* <tower-rs/tower#815>
* <tower-rs/tower#817>
* <tower-rs/tower#818>

this work is based upon #3504. for more information, see:

* linkerd/linkerd2#8733
* #3504

Signed-off-by: katelyn martin <kate@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0