Skip to content

Commit 8768b6c

Browse files
chore(deps): update axum requirement from 0.7 to 0.8 (#221)
* chore(deps): update axum requirement from 0.7 to 0.8 Updates the requirements on [axum](https://github.com/tokio-rs/axum) to permit the latest version. - [Release notes](https://github.com/tokio-rs/axum/releases) - [Changelog](https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/axum/commits) --- updated-dependencies: - dependency-name: axum dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore: migrate to native async traits where possible * chore: migrate routes to new axum syntax --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: janskiba <jan.skiba@dkfz-heidelberg.de>
1 parent bab8f39 commit 8768b6c

File tree

18 files changed

+24
-35
lines changed

18 files changed

+24
-35
lines changed

broker/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ beam-lib = { workspace = true }
1414
tokio = { version = "1", features = ["full"] }
1515
serde = { version = "1", features = ["derive"] }
1616
serde_json = "1"
17-
axum = { version = "0.7", features = [ "query" ] }
17+
axum = { version = "0.8", features = [ "query" ] }
1818
#axum-macros = "0.3.7"
1919
dashmap = "6.0"
2020

@@ -30,7 +30,7 @@ futures-core = { version = "0.3", default-features = false }
3030
once_cell = "1"
3131
# Socket dependencies
3232
bytes = { version = "1", optional = true }
33-
axum-extra = { version = "0.9", features = ["typed-header"] }
33+
axum-extra = { version = "0.10", features = ["typed-header"] }
3434
hyper = { version = "1", default-features = false, optional = true}
3535
hyper-util = { version = "0.1", default-features = false, features = ["tokio"], optional = true}
3636

broker/src/crypto.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
use std::{future::Future, mem::discriminant};
22

3-
use axum::{
4-
async_trait,
5-
http::{header, method, uri::Scheme, Method, Request, StatusCode, Uri},
6-
};
3+
use axum::http::{header, method, uri::Scheme, Method, Request, StatusCode, Uri};
74
use serde::{Deserialize, Serialize};
85
use shared::{
9-
config,
10-
crypto::{parse_crl, CertificateCache, CertificateCacheUpdate, GetCerts},
11-
errors::SamplyBeamError,
12-
http_client::{self, SamplyHttpClient}, openssl::x509::X509Crl, reqwest::{self, Url},
6+
async_trait, config, crypto::{parse_crl, CertificateCache, CertificateCacheUpdate, GetCerts}, errors::SamplyBeamError, http_client::{self, SamplyHttpClient}, openssl::x509::X509Crl, reqwest::{self, Url}
137
};
148
use std::time::Duration;
159
use tokio::time::timeout;

broker/src/serve_health.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct HealthOutput {
1919
pub(crate) fn router(health: Arc<RwLock<Health>>) -> Router {
2020
Router::new()
2121
.route("/v1/health", get(handler))
22-
.route("/v1/health/proxies/:proxy_id", get(proxy_health))
22+
.route("/v1/health/proxies/{proxy_id}", get(proxy_health))
2323
.route("/v1/health/proxies", get(get_all_proxies))
2424
.route("/v1/control", get(get_control_tasks).layer(axum::middleware::from_fn(log_version_mismatch)))
2525
.with_state(health)

broker/src/serve_pki.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ pub(crate) fn router() -> Router {
4747
.route("/v1/pki/certs", get(get_certificate_list))
4848
.route("/v1/pki/certs/im-ca", get(get_im_cert))
4949
.route(
50-
"/v1/pki/certs/by_serial/:serial",
50+
"/v1/pki/certs/by_serial/{serial}",
5151
get(get_certificate_by_serial),
5252
)
5353
}
5454

55-
#[tracing::instrument(name = "/v1/pki/certs/by_serial/:serial")]
55+
#[tracing::instrument(name = "/v1/pki/certs/by_serial/{serial}")]
5656
async fn get_certificate_by_serial(
5757
ConnectInfo(addr): ConnectInfo<SocketAddr>,
5858
Path(serial): Path<String>,

broker/src/serve_sockets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl Default for SocketState {
4242
pub(crate) fn router() -> Router {
4343
Router::new()
4444
.route("/v1/sockets", get(get_socket_requests).post(post_socket_request))
45-
.route("/v1/sockets/:id", get(connect_socket))
45+
.route("/v1/sockets/{id}", get(connect_socket))
4646
.with_state(SocketState::default())
4747
}
4848

broker/src/serve_tasks.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub(crate) fn router() -> Router {
4040
let state = TasksState::default();
4141
Router::new()
4242
.route("/v1/tasks", get(get_tasks).post(post_task))
43-
.route("/v1/tasks/:task_id/results", get(get_results_for_task))
44-
.route("/v1/tasks/:task_id/results/:app_id", put(put_result))
43+
.route("/v1/tasks/{task_id}/results", get(get_results_for_task))
44+
.route("/v1/tasks/{task_id}/results/{app_id}", put(put_result))
4545
.with_state(state)
4646
}
4747

@@ -82,7 +82,7 @@ async fn get_results_for_task(
8282
}
8383
}
8484

85-
// GET /v1/tasks/:task_id/results
85+
// GET /v1/tasks/{task_id}/results
8686
async fn get_results_for_task_nostream(
8787
addr: SocketAddr,
8888
state: TasksState,
@@ -354,7 +354,7 @@ async fn post_task(
354354
))
355355
}
356356

357-
// PUT /v1/tasks/:task_id/results/:app_id
357+
// PUT /v1/tasks/{task_id}/results/{app_id}
358358
async fn put_result(
359359
ConnectInfo(addr): ConnectInfo<SocketAddr>,
360360
Path((task_id, app_id)): Path<(MsgId, AppOrProxyId)>,

proxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ shared = { path = "../shared", features = ["config-for-proxy"] }
1212
beam-lib = { workspace = true }
1313

1414
tokio = { version = "1", features = ["full"] }
15-
axum = { version = "0.7", features = ["macros"] }
15+
axum = { version = "0.8", features = ["macros"] }
1616
bytes = { version = "1" }
1717
httpdate = "1.0"
1818

proxy/src/auth.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::collections::HashMap;
22

33
use axum::{
4-
async_trait,
54
extract::{FromRequest, FromRequestParts},
65
http::{header::{self, HeaderName}, request::Parts, Request, StatusCode},
76
};
@@ -14,7 +13,6 @@ use tracing::{debug, Span, debug_span, warn};
1413

1514
pub(crate) struct AuthenticatedApp(pub(crate) AppId);
1615

17-
#[async_trait]
1816
impl<S: Send + Sync> FromRequestParts<S> for AuthenticatedApp {
1917
type Rejection = (StatusCode, [(HeaderName, &'static str); 1]);
2018

proxy/src/crypto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use axum::{async_trait, body::Bytes, http::{header, request, Method, Request, StatusCode, Uri}, response::Response, Json};
1+
use axum::{body::Bytes, http::{header, request, Method, Request, StatusCode, Uri}, response::Response, Json};
22
use beam_lib::AppOrProxyId;
33
use shared::{
4-
config, config_proxy::Config, config_shared::ConfigCrypto, crypto::GetCerts, errors::{CertificateInvalidReason, SamplyBeamError}, http_client::SamplyHttpClient, reqwest, EncryptedMessage, MsgEmpty
4+
async_trait, config, config_proxy::Config, config_shared::ConfigCrypto, crypto::GetCerts, errors::{CertificateInvalidReason, SamplyBeamError}, http_client::SamplyHttpClient, reqwest, EncryptedMessage, MsgEmpty
55
};
66
use tracing::{debug, info, warn, error};
77

proxy/src/serve_sockets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub(crate) fn router(client: SamplyHttpClient) -> Router {
5858

5959
Router::new()
6060
.route("/v1/sockets", get(get_tasks))
61-
.route("/v1/sockets/:app_or_id", post(create_socket_con).get(connect_socket))
61+
.route("/v1/sockets/{app_or_id}", post(create_socket_con).get(connect_socket))
6262
.with_state(state)
6363
.layer(Extension(task_secret_map))
6464
}

0 commit comments

Comments
 (0)