diff --git a/backend/windmill-api/openapi-deref.yaml b/backend/windmill-api/openapi-deref.yaml index 043dc34e75..3a6201018a 100644 --- a/backend/windmill-api/openapi-deref.yaml +++ b/backend/windmill-api/openapi-deref.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.233.0 + version: 1.237.0 title: Windmill API contact: name: Windmill Team @@ -10295,6 +10295,8 @@ paths: type: boolean cancel_upload: type: boolean + s3_resource_path: + type: string required: - file_key - part_content_base64 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 6df6460e66..6de37e7158 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -6893,6 +6893,8 @@ paths: type: boolean cancel_upload: type: boolean + s3_resource_path: + type: string required: - file_key - part_content_base64 diff --git a/backend/windmill-api/src/job_helpers.rs b/backend/windmill-api/src/job_helpers.rs index e797e5f098..906ffa79fc 100644 --- a/backend/windmill-api/src/job_helpers.rs +++ b/backend/windmill-api/src/job_helpers.rs @@ -755,6 +755,8 @@ struct UploadFileQuery { pub is_final: bool, // whether it's the final chunk pub cancel_upload: bool, // whether the upload should be cancelled. upload_id should be set. subsequent calls with this upload_id will fail + + pub s3_resource_path: Option, // custom S3 resource to use for this upload. It None, the workspace S3 resource will be used } #[derive(Deserialize, Serialize, Clone)] @@ -784,7 +786,21 @@ async fn multipart_upload_s3_file( query.is_final ); let file_key = query.file_key.clone(); - let s3_resource_opt = get_workspace_s3_resource(&authed, &user_db, &db, &token, &w_id).await?; + + let s3_resource_opt = match query.s3_resource_path.clone() { + Some(s3_resource_path) => { + get_s3_resource( + &authed, + &user_db, + &db, + &token, + &w_id, + s3_resource_path.as_str(), + ) + .await? + } + None => get_workspace_s3_resource(&authed, &user_db, &db, &token, &w_id).await?, + }; let s3_resource = s3_resource_opt.ok_or(error::Error::InternalErr( "No files storage resource defined at the workspace level".to_string(),