Skip to content

Commit

Permalink
Merge pull request rust-lang#5605 from Turbo87/conduit-axum
Browse files Browse the repository at this point in the history
Migrate from raw `hyper` server to `axum`
  • Loading branch information
Turbo87 authored Dec 12, 2022
2 parents d3ec06f + 159f5f7 commit c02ac7d
Show file tree
Hide file tree
Showing 19 changed files with 297 additions and 236 deletions.
185 changes: 167 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ path = "src/tests/all.rs"
[dependencies]
anyhow = "=1.0.66"
aws-sigv4 = "=0.51.0"
axum = "=0.6.1"
base64 = "=0.13.1"
cargo-registry-index = { path = "cargo-registry-index" }
cargo-registry-markdown = { path = "cargo-registry-markdown" }
Expand All @@ -35,7 +36,7 @@ conduit = "=0.10.0"
conduit-conditional-get = "=0.10.0"
conduit-cookie = "=0.10.0"
conduit-git-http-backend = "=0.10.0"
conduit-hyper = { path = "conduit-hyper" }
conduit-axum = { path = "conduit-axum" }
conduit-middleware = "=0.10.0"
conduit-router = "=0.10.0"
conduit-static = "=0.10.1"
Expand Down
7 changes: 4 additions & 3 deletions conduit-hyper/Cargo.toml → conduit-axum/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "conduit-hyper"
version = "0.4.2"
name = "conduit-axum"
version = "0.0.0"
authors = ["Justin Geibel <jtgeibel@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Host a conduit based web application on a hyper server"
description = "Host a conduit based web application on an axum server"
readme = "README.md"
edition = "2021"
rust-version = "1.56.0"

[dependencies]
axum = "=0.6.1"
conduit = "=0.10.0"
hyper = { version = "=0.14.23", features = ["server", "stream"] }
http = "=0.2.8"
Expand Down
File renamed without changes.
File renamed without changes.
25 changes: 3 additions & 22 deletions conduit-hyper/README.md → conduit-axum/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# conduit-hyper
# conduit-axum

This crate integrates a `hyper 0.14` server with a `conduit 0.10` application
stack.

## Usage

This crate is in maintenance mode, intended only for use within the crates.io
codebase. If you wish to use this crate please reach out to us in the
[issue-tracker](https://github.com/conduit-rust/conduit-hyper/issues).

While some protection against large requests is provided, this server should
not be exposed directly to the public internet. It is highly recommended that
the server be used behind a production-grade reverse-proxy for such
applications.

Potential security vulnerabilities should be reported per our [security policy].

[security policy]: https://github.com/conduit-rust/.github/security/policy
This crate integrates an [axum](https://github.com/tokio-rs/axum) server with
a [conduit](https://github.com/conduit-rust/conduit) application stack.

## Error and Panic Handling

Expand Down Expand Up @@ -47,10 +32,6 @@ noteworthy behavior:

All other methods on `Request` should behave as expected.

## TODO

* Include the `X-Request-Id` header when logging an error

## License

Licensed under either of these:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![deny(clippy::all)]

use conduit::{Body, Handler, RequestExt, ResponseResult};
use conduit_hyper::Server;
use conduit_axum::Server;
use conduit_router::RouteBuilder;
use http::{header, Response};

Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c02ac7d

Please sign in to comment.