`ResponseWithPeekTrailers` wraps an inner service `S`.
upon inspection, it turns out that this structure is no longer used by
any code elsewhere in the project.
this commit removes `ResponseWithPeekTrailers`, its associated type
aliases, and its `tower::Service<T>` implementation.
Signed-off-by: katelyn martin <kate@buoyant.io>
some aspects of `linkerd-http-upgrade` are incompatible with the 1.0
interface of the `http` crate (_see: hyperium/http#395,
linkerd/linkerd2#8733_).
this new bound requiring that extensions must now be cloneable motivated
me to read through this library's internals to gain a lucid
understanding of how it works, in order to understand how to gracefully
address
[this](https://github.com/linkerd/linkerd2-proxy/blob/main/linkerd/http/upgrade/src/upgrade.rs#L25-L26)
comment affixed to the `linkerd_http_upgrade::upgrade::Http11Upgrade`
request/response extension:
```rust
// Note: this relies on their only having been 2 Inner clones, so don't
// implement `Clone` for this type. [sic]
pub struct Http11Upgrade {
half: Half,
inner: Arc<Inner>,
}
```
broadly, this library deals with some moderately arcane corners of the
HTTP protocol family. the `Upgrade` header is not supported in HTTP/2,
and was not yet introduced in HTTP/1.0, so it is a feature specific to
HTTP/1.1. moreover, some behavior provided by this library falls into
parts of the spec(s) that we `MUST` uphold, and isn't currently well
documented.
this branch includes a sequence of commits adding documentation and
additional comments linking to, and quoting, the relevant parts of [RFC
9110](https://www.rfc-editor.org/rfc/rfc9110). some links to RFC 7231,
which was obsoleted by RFC 9110 since the original time of writing, are
additionally updated.
some comments also did not accurately describe internal logic, or
included typos, and are also updated.
---
* docs(http/upgrade): add crate-level docs, rfc link
Signed-off-by: katelyn martin <kate@buoyant.io>
* docs(http/upgrade): update link to obsolete rfc
rfc 9110 obsoletes the following rfc's: 2818, 7230, 7231, 7232, 7233,
7235, 7538, 7615, and 7694.
this updates a comment related to connection upgrade logic, linking to
the current rfc, 9110. this information now lives in section 9.3.6,
paragraph 12.
Signed-off-by: katelyn martin <kate@buoyant.io>
* nit(http/upgrade): update incorrect comment
this function has since been renamed `halves()`.
Signed-off-by: katelyn martin <kate@buoyant.io>
* docs(http/upgrade): add comments to `wants_upgrade`
this adds a comment additionally clarifying that HTTP/2 does not support
upgrades.
Signed-off-by: katelyn martin <kate@buoyant.io>
* docs(http/upgrade): document `strip_connection_headers()`
this function performs some important behavior that we MUST implement,
as a proxy/intermediary.
to help elucidate the mandated behavior expected of us by the HTTP/1
specification, add documentation comments noting the related passages
from rfc 9110 § 7.6.1.
Signed-off-by: katelyn martin <kate@buoyant.io>
* nit(http/upgrade): fix typo in `Http11Upgrade` comment
Signed-off-by: katelyn martin <kate@buoyant.io>
* docs(http/upgrade): update incorrect comment
this comment is not true.
this commit updates it, reflecting the current state of the upgrade
body's `Drop` logic.
Signed-off-by: katelyn martin <kate@buoyant.io>
---------
Signed-off-by: katelyn martin <kate@buoyant.io>
the `linkerd-http-upgrade` crate supports HTTP/1.1 upgrades. currently, it
exposes a number of functions and types in its public interface that are
strictly internal helpers. this branch redefines various interfaces and fields
as private, to clarify the public interface of the crate.
---
* refactor(proxy/http): `h1::is_upgrade()` is private
this function is not used elsewhere, so it does not have to be
`pub(crate)`.
Signed-off-by: katelyn martin <kate@buoyant.io>
* refactor(http/upgrade): `halves()` is private
this commit restricts `Http11Upgrade::halves` so that it is now a
private interface.
this is an internal interface that is not used elsewhere.
Signed-off-by: katelyn martin <kate@buoyant.io>
* refactor(http/upgrade): `Http11UpgradeHalves` is private
with `halves()` having been made private, this type is also not used by
other external code. we can make it, and its constituent fields,
private.
Signed-off-by: katelyn martin <kate@buoyant.io>
* refactor(http/upgrade): `UpgradeBody::upgrade` is private
this commit makes the `upgrade` field of the `UpgradeBody` type private.
it contains two pieces of state that are used in the `Drop`
implementation of an upgrade body.
because these are not accessed or modified elsewhere, this field can be
made private.
Signed-off-by: katelyn martin <kate@buoyant.io>
* refactor(http/upgrade): `UpgradeBody::new` is `pub(crate)`
this function is not, and *should* not, be used by external callers. we
install the `UpgradeBody` in `Service`.
Signed-off-by: katelyn martin <kate@buoyant.io>
---------
Signed-off-by: katelyn martin <kate@buoyant.io>
see #8733.
the tests for the replay body use the `hyper::Body` type removed in the
1.0 release.
this commit replaces this with `BoxBody` where possible, and adds
comments with context about how to update code once upgrading to hyper
1.0.
see #3467 and #3468 which added `from_static()` and `empty()`,
respectively.
Signed-off-by: katelyn martin <kate@buoyant.io>
`UpgradeResponseBody` currently wraps a `hyper::Body`. this type is
removed in hyper 1.0.
this commit replaces this with a generic `B`-typed body.
see https://github.com/linkerd/linkerd2-proxy/pull/3479, which performs
the same change in `linkerd-http-upgrade`.
see https://github.com/linkerd/linkerd2/issues/8733 for more information
on upgrading to hyper 1.0.
Signed-off-by: katelyn martin <kate@buoyant.io>
The OpenTelemetry spec defines the semantic conventions that HTTP services should use for the labels included in traces: https://opentelemetry.io/docs/specs/semconv/http/http-spans/
Previously, we were using an outdated version of this spec for the OpenCensus traces. This updates the labels to match the current spec.
The notable changes updates to the path for HTTP method and status code, the fields that include the URL parts, and more rigorously following the standard for propagating the Host header.
Signed-off-by: Scott Fleener <scott@buoyant.io>
this commit upgrades to hyper 0.14.32, removing the manifest's `[patch]`
section.
hyperium/hyper#3796 backported a method we use when building http/2
connections. #3457 patched the workspace to rely on a git dependency
of hyper at commit `a24f0c0a`.
this work has been released in version 0.14.32.
this commit also changes `deny.toml`, removing the exception we carved
out for hyper in #3457.
for more information, see:
* hyperium/hyper#3796
* linkerd/linkerd2#8733
* https://github.com/hyperium/hyper/commits/0.14.x
* #3457
* 03f55779
Signed-off-by: katelyn martin <kate@buoyant.io>
Co-authored-by: Oliver Gould <ver@buoyant.io>
* chore(http/upgrade): replace `hyper::Body` with `BoxBody`
`hyper::Body` is removed in the 1.0 version.
this commit removes it from our upgrade facilities, using a generic body
parameter that defaults to BoxBody.
see <https://github.com/linkerd/linkerd2/issues/8733>.
Signed-off-by: katelyn martin <kate@buoyant.io>
* review(http/upgrade): remove frivolous `Unpin` bound
https://github.com/linkerd/linkerd2-proxy/pull/3479/files#r1894068885
in `main` this isn't currently pinned, so this was needed to add the `B`
parameter originally in development, but tweaking how we poll the body
(_see lines 70-80, below_) means this bound is indeed frivolous now.
this commit removes an extraneous `Unpin` bound.
Co-authored-by: Scott Fleener <scott@buoyant.io>
Signed-off-by: katelyn martin <kate@buoyant.io>
---------
Signed-off-by: katelyn martin <kate@buoyant.io>
Co-authored-by: Scott Fleener <scott@buoyant.io>
if this build script panics due to an invalid proxy version environment
variable, the panic can be somewhat cryptic. a message saying
`LINKERD2_PROXY_VERSION must be semver` is printed, but the proxy
version that caused this is not shown.
this commit adds the version and the error to this panic message.
now, building with an invalid proxy version provides us with the
following:
```
; LINKERD2_PROXY_VERSION='invalid' cargo build -p linkerd-app-core
Compiling linkerd-app-core v0.1.0 (/linkerd2-proxy/linkerd/app/core)
error: failed to run custom build command for `linkerd-app-core v0.1.0 (/linkerd2-proxy/linkerd/app/core)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `/linkerd2-proxy/target/debug/build/linkerd-app-core-756fc82028bfbcc0/build-script-build` (exit status: 101)
--- stdout
cargo:rustc-env=GIT_SHA=e53b6b9d
cargo:rustc-env=LINKERD2_PROXY_BUILD_DATE=2024-12-20T01:18:08Z
--- stderr
thread 'main' panicked at linkerd/app/core/build.rs:18:17:
LINKERD2_PROXY_VERSION must be semver: version='invalid' error='unexpected character 'i' while parsing major version number'
```
Signed-off-by: katelyn martin <kate@buoyant.io>