Skip to content

Commit 9fc8af9

Browse files
committed
Update axum
1 parent c5f1d8d commit 9fc8af9

File tree

11 files changed

+72
-420
lines changed

11 files changed

+72
-420
lines changed

Cargo.lock

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ anymap = "0.12"
129129
arrayvec = "0.7.2"
130130
async-stream = "0.3.6"
131131
async-trait = "0.1.68"
132-
axum = { version = "0.7", features = ["tracing"] }
133-
axum-extra = { version = "0.9", features = ["typed-header"] }
132+
axum = { version = "0.8.4", features = ["tracing", "ws"] }
133+
axum-extra = { version = "0.10", features = ["typed-header"] }
134134
backtrace = "0.3.66"
135135
base64 = "0.21.2"
136136
bigdecimal = "0.4.7"

crates/client-api/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ futures = "0.3"
4141
bytes = "1"
4242
tracing.workspace = true
4343
bytestring = "1"
44-
tokio-tungstenite.workspace = true
4544
itoa.workspace = true
4645
derive_more = "0.99.17"
4746
uuid.workspace = true

crates/client-api/src/auth.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ pub struct SpacetimeAuthHeader {
264264
auth: Option<SpacetimeAuth>,
265265
}
266266

267-
#[async_trait::async_trait]
268267
impl<S: NodeDelegate + Send + Sync> axum::extract::FromRequestParts<S> for SpacetimeAuthHeader {
269268
type Rejection = AuthorizationRejection;
270269
async fn from_request_parts(parts: &mut request::Parts, state: &S) -> Result<Self, Self::Rejection> {
@@ -341,7 +340,6 @@ impl SpacetimeAuthHeader {
341340

342341
pub struct SpacetimeAuthRequired(pub SpacetimeAuth);
343342

344-
#[async_trait::async_trait]
345343
impl<S: NodeDelegate + Send + Sync> axum::extract::FromRequestParts<S> for SpacetimeAuthRequired {
346344
type Rejection = AuthorizationRejection;
347345
async fn from_request_parts(parts: &mut request::Parts, state: &S) -> Result<Self, Self::Rejection> {

crates/client-api/src/routes/database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,14 +778,14 @@ where
778778
.route("/names", self.names_put)
779779
.route("/identity", self.identity_get)
780780
.route("/subscribe", self.subscribe_get)
781-
.route("/call/:reducer", self.call_reducer_post)
781+
.route("/call/{reducer}", self.call_reducer_post)
782782
.route("/schema", self.schema_get)
783783
.route("/logs", self.logs_get)
784784
.route("/sql", self.sql_post);
785785

786786
axum::Router::new()
787787
.route("/", self.root_post)
788-
.nest("/:name_or_identity", db_router)
788+
.nest("/{name_or_identity}", db_router)
789789
.route_layer(axum::middleware::from_fn_with_state(ctx, anon_auth_middleware::<S>))
790790
}
791791
}

crates/client-api/src/routes/energy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
{
126126
use axum::routing::get;
127127
axum::Router::new().route(
128-
"/:identity",
128+
"/{identity}",
129129
get(get_energy_balance::<S>)
130130
.put(set_energy_balance::<S>)
131131
.post(add_energy::<S>),

crates/client-api/src/routes/identity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,6 @@ where
144144
.route("/", post(create_identity::<S>))
145145
.route("/public-key", get(get_public_key::<S>))
146146
.route("/websocket-token", post(create_websocket_token::<S>))
147-
.route("/:identity/verify", get(validate_token))
148-
.route("/:identity/databases", get(get_databases::<S>))
147+
.route("/{identity}/verify", get(validate_token))
148+
.route("/{identity}/databases", get(get_databases::<S>))
149149
}

0 commit comments

Comments
 (0)