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 2021/12/14 00:36:08 UTC

[GitHub] [incubator-teaclave] mssun opened a new pull request #588: API updates

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


   ## Description
   
   This PR contains several API changes and bug fixes:
   
   ### New APIs and API Updates
   
   I added the following APIs to help with function management and user management.
   
   **TeaclaveFrontend**:
   ```
   service TeaclaveFrontend {
     rpc UpdateFunction (UpdateFunctionRequest) returns (UpdateFunctionResponse);
     rpc ListFunctions (ListFunctionsRequest) returns (ListFunctionsResponse);
     rpc DeleteFunction (DeleteFunctionRequest) returns (DeleteFunctionResponse);
   }
   ```
   
   **TeaclaveAuthenticationApi**:
   
   ```
   service TeaclaveAuthenticationApi {
     rpc UserUpdate(UserUpdateRequest) returns (UserUpdateResponse);
   }
   ```
   
   **TeaclaveAuthenticationApi**
   ```
   service TeaclaveAuthenticationApi {
     rpc UserRegister(UserRegisterRequest) returns (UserRegisterResponse);
     rpc UserUpdate(UserUpdateRequest) returns (UserUpdateResponse);
   }
   ```
   `UserRegisterRequest` now contains role and attribute for role-based access control in user management.
   
   ### Role-based User Management
   
   We introduce four roles:
   
   ```
   pub enum UserRole {
       PlatformAdmin,
       FunctionOwner,
       DataOwnerManager(String),   // Manager of the data owner (attribute can be the organization name
       DataOwner(String),          // Data owner (attribute are the organization name)
       Invalid,
   }
   ```
   
   Different roles have different privileges to access API endpoints.
   
   ### User Management
   
   Since we have introduced the role-based user management, only "PlatformAdmin" and "DataOwnerManager" can register new users with certain privileges.
   
   As a result, `UserRegisterRequest` have two new fields: *role* and *attribute*. The role is an enum but string encoded. Possible roles are "PlatformAdmin", "FunctionOwner", "DataOwnerManager", "DataOwner".
   
   ### Bug fixes
   
   - Incorrect toolchain version in CI for Swift SDK
   - Change to multithreaded file service
   - Fix issue that re-build protobuf in each build
   
   ## Type of change (select or add applied and delete the others)
   
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [x] New feature (non-breaking change which adds functionality)
   - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [x] API change with a documentation update
   
   ## How has this been tested?
   CI test.
   
   ## Checklist
   
   - [x] Fork the repo and create your branch from `master`.
   - [x] If you've added code that should be tested, add tests.
   - [x] If you've changed APIs, update the documentation.
   - [x] Ensure the tests pass (see CI results).
   - [x] 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.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

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 commented on a change in pull request #588: API updates

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



##########
File path: examples/c/builtin_ordered_set_intersect.c
##########
@@ -267,6 +235,25 @@ int main()
     char user1_output_id[BUFFER_SIZE] = {0};
     char serialized_response[BUFFER_SIZE] = {0};
     size_t serialized_response_len = BUFFER_SIZE;
+    const char *admin_user_id = "admin";
+    const char *admin_user_password = "teaclave";
+
+    /* Register */
+    ret = login(admin_user_id, admin_user_password, token, &token_len);
+    if (ret != 0) {
+        fprintf(stderr, "[-] Failed to login.\n");

Review comment:
       Good suggestion. I'll polish it in the following PRs.




-- 
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: notifications-unsubscribe@teaclave.apache.org

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 #588: API updates

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


   


-- 
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: notifications-unsubscribe@teaclave.apache.org

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] bigdata-memory commented on a change in pull request #588: API updates

Posted by GitBox <gi...@apache.org>.
bigdata-memory commented on a change in pull request #588:
URL: https://github.com/apache/incubator-teaclave/pull/588#discussion_r768286681



##########
File path: examples/c/builtin_ordered_set_intersect.c
##########
@@ -267,6 +235,25 @@ int main()
     char user1_output_id[BUFFER_SIZE] = {0};
     char serialized_response[BUFFER_SIZE] = {0};
     size_t serialized_response_len = BUFFER_SIZE;
+    const char *admin_user_id = "admin";
+    const char *admin_user_password = "teaclave";
+
+    /* Register */
+    ret = login(admin_user_id, admin_user_password, token, &token_len);
+    if (ret != 0) {
+        fprintf(stderr, "[-] Failed to login.\n");

Review comment:
       Such `fprintf(stderr, "[-]...` statement has been used everywhere so It may worth to wrap it up as a macro in `utils.h`.




-- 
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: notifications-unsubscribe@teaclave.apache.org

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