You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2020/06/02 10:57:11 UTC

[GitHub] [incubator-teaclave] renxingliang opened a new pull request #330: Solve the problem that the external link of the input file or output …

renxingliang opened a new pull request #330:
URL: https://github.com/apache/incubator-teaclave/pull/330


   …file is invalid
   
   ## Description
   
   Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
   
   Fixes # (issue)
   
   ## Type of change (select or add applied and delete the others)
   
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] API change with a documentation update
   - [ ] Additional test coverage
   - [ ] Code cleanup or just sync with upstream third-party crates
   
   ## How has this been tested?
   
   ## Checklist
   
   - [ ] Fork the repo and create your branch from `master`.
   - [ ] If you've added code that should be tested, add tests.
   - [ ] If you've changed APIs, update the documentation.
   - [ ] Ensure the tests pass (see CI results).
   - [ ] Make sure your code lints/format.
   


----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] m4sterchain commented on a change in pull request #330: Solve the problem that the external link of the input file or output …

Posted by GitBox <gi...@apache.org>.
m4sterchain commented on a change in pull request #330:
URL: https://github.com/apache/incubator-teaclave/pull/330#discussion_r434221570



##########
File path: services/management/enclave/src/service.rs
##########
@@ -90,6 +91,37 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none
+    fn update_input_file(
+        &self,
+        request: Request<UpdateInputFileRequest>,
+    ) -> TeaclaveServiceResponseResult<UpdateInputFileResponse> {
+        let user_id = self.get_request_user_id(request.metadata())?;
+        let request = request.message;
+
+        let old_input_file: TeaclaveInputFile = self
+            .read_from_db(&request.data_id)
+            .map_err(|_| ServiceError::PermissionDenied)?;
+
+        ensure!(
+            old_input_file.owner.contains(&user_id),

Review comment:
       file.owner == vec![user_id] 

##########
File path: services/management/enclave/src/service.rs
##########
@@ -106,6 +138,33 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none

Review comment:
       Same as above.

##########
File path: services/management/enclave/src/service.rs
##########
@@ -90,6 +91,37 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none

Review comment:
       // 1. exisiting_file.owner_list.len() == 1
   // 2. user_id in existing_file.owner_list

##########
File path: services/management/enclave/src/service.rs
##########
@@ -90,6 +91,37 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none
+    fn update_input_file(
+        &self,
+        request: Request<UpdateInputFileRequest>,
+    ) -> TeaclaveServiceResponseResult<UpdateInputFileResponse> {
+        let user_id = self.get_request_user_id(request.metadata())?;
+        let request = request.message;
+
+        let old_input_file: TeaclaveInputFile = self
+            .read_from_db(&request.data_id)
+            .map_err(|_| ServiceError::PermissionDenied)?;
+
+        ensure!(
+            old_input_file.owner.contains(&user_id),
+            ServiceError::PermissionDenied
+        );
+
+        let input_file = TeaclaveInputFile::new(
+            request.url,
+            old_input_file.cmac,
+            old_input_file.crypto_info,
+            vec![user_id],

Review comment:
       We should preserve the old_input_file's owner list, update only the url field.

##########
File path: services/management/enclave/src/service.rs
##########
@@ -106,6 +138,33 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none
+    fn update_output_file(
+        &self,
+        request: Request<UpdateOutputFileRequest>,
+    ) -> TeaclaveServiceResponseResult<UpdateOutputFileResponse> {
+        let user_id = self.get_request_user_id(request.metadata())?;
+        let request = request.message;
+
+        let old_output_file: TeaclaveOutputFile = self
+            .read_from_db(&request.data_id)
+            .map_err(|_| ServiceError::PermissionDenied)?;
+
+        ensure!(
+            old_output_file.owner.contains(&user_id),
+            ServiceError::PermissionDenied
+        );
+
+        let output_file =
+            TeaclaveOutputFile::new(request.url, old_output_file.crypto_info, vec![user_id]);

Review comment:
       We should preserve the old_input_file's owner list, update only the url field.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun merged pull request #330: Solve the problem that the external link of the input file or output …

Posted by GitBox <gi...@apache.org>.
mssun merged pull request #330:
URL: https://github.com/apache/incubator-teaclave/pull/330


   


----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] renxingliang commented on a change in pull request #330: Solve the problem that the external link of the input file or output …

Posted by GitBox <gi...@apache.org>.
renxingliang commented on a change in pull request #330:
URL: https://github.com/apache/incubator-teaclave/pull/330#discussion_r434267083



##########
File path: services/management/enclave/src/service.rs
##########
@@ -90,6 +91,37 @@ impl TeaclaveManagement for TeaclaveManagementService {
         Ok(response)
     }
 
+    // access control: none
+    fn update_input_file(
+        &self,
+        request: Request<UpdateInputFileRequest>,
+    ) -> TeaclaveServiceResponseResult<UpdateInputFileResponse> {
+        let user_id = self.get_request_user_id(request.metadata())?;
+        let request = request.message;
+
+        let old_input_file: TeaclaveInputFile = self
+            .read_from_db(&request.data_id)
+            .map_err(|_| ServiceError::PermissionDenied)?;
+
+        ensure!(
+            old_input_file.owner.contains(&user_id),

Review comment:
       Okay, thank you very much m4sterchain. There is indeed a problem with the update logic, I will modify it.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org