Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 11 additions & 30 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ anymap = "0.12"
arrayvec = "0.7.2"
async-stream = "0.3.6"
async-trait = "0.1.68"
axum = { version = "0.7", features = ["tracing"] }
axum-extra = { version = "0.9", features = ["typed-header"] }
axum = { version = "0.8.4", features = ["tracing"] }
axum-extra = { version = "0.10", features = ["typed-header"] }
backtrace = "0.3.66"
base64 = "0.21.2"
bigdecimal = "0.4.7"
Expand Down
2 changes: 0 additions & 2 deletions crates/client-api/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ pub struct SpacetimeAuthHeader {
auth: Option<SpacetimeAuth>,
}

#[async_trait::async_trait]
impl<S: NodeDelegate + Send + Sync> axum::extract::FromRequestParts<S> for SpacetimeAuthHeader {
type Rejection = AuthorizationRejection;
async fn from_request_parts(parts: &mut request::Parts, state: &S) -> Result<Self, Self::Rejection> {
Expand Down Expand Up @@ -461,7 +460,6 @@ impl SpacetimeAuthHeader {

pub struct SpacetimeAuthRequired(pub SpacetimeAuth);

#[async_trait::async_trait]
impl<S: NodeDelegate + Send + Sync> axum::extract::FromRequestParts<S> for SpacetimeAuthRequired {
type Rejection = AuthorizationRejection;
async fn from_request_parts(parts: &mut request::Parts, state: &S) -> Result<Self, Self::Rejection> {
Expand Down
10 changes: 5 additions & 5 deletions crates/client-api/src/routes/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ pub async fn reset<S: NodeDelegate + ControlStateDelegate + Authorization>(
host_type,
}): Query<ResetDatabaseQueryParams>,
Extension(auth): Extension<SpacetimeAuth>,
program_bytes: Option<Bytes>,
program_bytes: Bytes,
) -> axum::response::Result<axum::Json<PublishResult>> {
let database_identity = name_or_identity.resolve(&ctx).await?;
let database = worker_ctx_find_database(&ctx, &database_identity)
Expand All @@ -631,7 +631,7 @@ pub async fn reset<S: NodeDelegate + ControlStateDelegate + Authorization>(
&auth.claims.identity,
DatabaseResetDef {
database_identity,
program_bytes,
program_bytes: Some(program_bytes),
num_replicas,
host_type: Some(host_type),
},
Expand Down Expand Up @@ -716,7 +716,7 @@ pub async fn publish<S: NodeDelegate + ControlStateDelegate + Authorization>(
host_type,
}),
Extension(auth),
Some(program_bytes),
program_bytes,
)
.await;
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ where
.route("/names", self.names_put)
.route("/identity", self.identity_get)
.route("/subscribe", self.subscribe_get)
.route("/call/:reducer", self.call_reducer_procedure_post)
.route("/call/{reducer}", self.call_reducer_procedure_post)
.route("/schema", self.schema_get)
.route("/logs", self.logs_get)
.route("/sql", self.sql_post)
Expand All @@ -1254,7 +1254,7 @@ where

axum::Router::new()
.route("/", self.root_post)
.nest("/:name_or_identity", db_router)
.nest("/{name_or_identity}", db_router)
.route_layer(axum::middleware::from_fn_with_state(ctx, anon_auth_middleware::<S>))
}
}
2 changes: 1 addition & 1 deletion crates/client-api/src/routes/energy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ where
{
use axum::routing::get;
axum::Router::new().route(
"/:identity",
"/{identity}",
get(get_energy_balance::<S>)
.put(set_energy_balance::<S>)
.post(add_energy::<S>),
Expand Down
4 changes: 2 additions & 2 deletions crates/client-api/src/routes/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ where
.route("/", self.create_post)
.route("/public-key", self.public_key_get)
.route("/websocket-token", self.websocket_token_post)
.route("/:identity/verify", self.verify_get)
.route("/:identity/databases", self.databases_get)
.route("/{identity}/verify", self.verify_get)
.route("/{identity}/databases", self.databases_get)
}
}
4 changes: 1 addition & 3 deletions crates/client-api/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use crate::{log_and_500, ControlStateReadAccess};

pub struct ByteStringBody(pub ByteString);

#[async_trait::async_trait]
impl<S: Send + Sync> FromRequest<S> for ByteStringBody {
type Rejection = axum::response::Response;

Expand Down Expand Up @@ -165,8 +164,7 @@ impl fmt::Display for NameOrIdentity {

pub struct EmptyBody;

#[async_trait::async_trait]
impl<S> FromRequest<S> for EmptyBody {
impl<S: Sync> FromRequest<S> for EmptyBody {
type Rejection = axum::response::Response;
async fn from_request(req: Request, _state: &S) -> Result<Self, Self::Rejection> {
let body = req.into_body();
Expand Down
3 changes: 1 addition & 2 deletions crates/client-api/src/util/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ pub enum WebSocketUpgradeRejection {
KeyMissing,
}

#[async_trait::async_trait]
impl<S> FromRequestParts<S> for WebSocketUpgrade {
impl<S: Sync> FromRequestParts<S> for WebSocketUpgrade {
type Rejection = WebSocketUpgradeRejection;
async fn from_request_parts(parts: &mut http::request::Parts, _state: &S) -> Result<Self, Self::Rejection> {
use WebSocketUpgradeRejection::*;
Expand Down
Loading