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
46 changes: 44 additions & 2 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion objectstore-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ publish = false
[dependencies]
anyhow = { workspace = true }
argh = "0.1.13"
axum = "0.8.4"
async-stream = "0.3.6"
axum = { version = "0.8.4", features = ["multipart"] }
axum-extra = "0.10.1"
bytes = { workspace = true }
console = "0.16.1"
elegant-departure = { version = "0.3.2", features = ["tokio"] }
figment = { version = "0.10.19", features = ["env", "test", "yaml"] }
futures = { workspace = true }
futures-util = { workspace = true }
humantime = { workspace = true }
humantime-serde = { workspace = true }
Expand Down
28 changes: 28 additions & 0 deletions objectstore-server/src/endpoints/batch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use axum::Router;
use axum::extract::DefaultBodyLimit;
use axum::http::StatusCode;
use axum::response::{IntoResponse, Response};
use axum::routing;
use objectstore_service::id::ObjectContext;

use crate::auth::AuthAwareService;
use crate::endpoints::common::ApiResult;
use crate::extractors::{BatchRequest, Xt};
use crate::state::ServiceState;

const MAX_BODY_SIZE: usize = 1024 * 1024 * 1024; // 1 GB

pub fn router() -> Router<ServiceState> {
Router::new()
.route("/objects:batch/{usecase}/{scopes}/", routing::post(batch))
// Enforced by https://github.com/tokio-rs/axum/blob/4404f27cea206b0dca63637b1c76dff23772a5cc/axum/src/extract/multipart.rs#L78
.layer(DefaultBodyLimit::max(MAX_BODY_SIZE))
}

async fn batch(
_service: AuthAwareService,
Xt(_context): Xt<ObjectContext>,
_request: BatchRequest,
) -> ApiResult<Response> {
Ok(StatusCode::NOT_IMPLEMENTED.into_response())
}
5 changes: 4 additions & 1 deletion objectstore-server/src/endpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ use axum::Router;

use crate::state::ServiceState;

mod batch;
pub mod common;
mod health;
mod objects;

pub fn routes() -> Router<ServiceState> {
let routes_v1 = Router::new().merge(objects::router());
let routes_v1 = Router::new()
.merge(objects::router())
.merge(batch::router());

Router::new()
.merge(health::router())
Expand Down
Loading