Xuanwo commented on code in PR #5880:
URL: https://github.com/apache/opendal/pull/5880#discussion_r2015957007


##########
core/src/services/aliyun_drive/core.rs:
##########
@@ -121,13 +123,17 @@ impl AliyunDriveCore {
         })
         .map_err(new_json_serialize_error)?;
         let req = Request::post(format!("{}/oauth/access_token", 
self.endpoint))
+            // Inject operation to the request.
+            .extension(Operation::Read)

Review Comment:
   This operation is not read.



##########
core/src/services/aliyun_drive/core.rs:
##########
@@ -100,6 +100,8 @@ impl AliyunDriveCore {
                     .expect("access token must be valid header value"),
             );
         }
+        // Inject operation to the request.
+        req.extensions_mut().insert(Operation::Stat);

Review Comment:
   Hi, this operaiton is not `Stat`.



##########
core/src/services/aliyun_drive/core.rs:
##########
@@ -121,13 +123,17 @@ impl AliyunDriveCore {
         })
         .map_err(new_json_serialize_error)?;
         let req = Request::post(format!("{}/oauth/access_token", 
self.endpoint))
+            // Inject operation to the request.
+            .extension(Operation::Read)
             .body(Buffer::from(body))
             .map_err(new_request_build_error)?;
         self.send(req, None).await
     }
 
     async fn get_drive_id(&self, token: Option<&str>) -> Result<Buffer> {
         let req = Request::post(format!("{}/adrive/v1.0/user/getDriveInfo", 
self.endpoint))
+            // Inject operation to the request.
+            .extension(Operation::Read)

Review Comment:
   Like previous, we don't need to set operation if we don't know what's it for.



##########
core/src/services/aliyun_drive/core.rs:
##########
@@ -427,6 +453,8 @@ impl AliyunDriveCore {
             "{}/adrive/v1.0/openFile/getUploadUrl",
             self.endpoint
         ))
+        // Inject operation to the request.
+        .extension(Operation::Read)

Review Comment:
   This is for write.



##########
core/src/services/aliyun_drive/core.rs:
##########
@@ -262,6 +270,8 @@ impl AliyunDriveCore {
         })
         .map_err(new_json_serialize_error)?;
         let req = Request::post(format!("{}/adrive/v1.0/openFile/create", 
self.endpoint))
+            // Inject operation to the request.
+            .extension(Operation::CreateDir)

Review Comment:
   This is a write operation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@opendal.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to