Skip to content

feat: 增加同步账户用户信息的接口 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 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
5 changes: 5 additions & 0 deletions .changeset/giant-llamas-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/scow-scheduler-adapter-interface": minor
---

增加同步账户用户数据接口 SyncAccountUserInfo
87 changes: 87 additions & 0 deletions protos/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,90 @@ message GetAllAccountsWithUsersAndBlockedDetailsResponse {
// ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************


message SyncAccountInfo {
message UserInAccount {
string user_id = 1;
bool blocked = 2;
optional bool deleted = 3;
}
string account_name = 1;
repeated UserInAccount users = 2;
optional string owner_id = 3;
bool blocked_in_cluster = 4;
optional uint32 whitelist_id = 5;

message AssignedPartitions {
repeated string partitions = 1;
}
// use assigned partitions or all partitions
oneof unblocked_partitions {
AssignedPartitions assigned_partitions = 6;
bool use_all_partitions = 7;
}

optional bool deleted = 8;
}

message SyncAccountUserInfoRequest {
// session id during one same data sync operation
// the scheduler can only process the same data once with the same session_id.
string session_id = 1;
repeated SyncAccountInfo sync_accounts = 2;
}

message SyncAccountUserInfoResponse {

message CreateAccountOperation {
string account_name = 1;
}
message BlockAccountOperation {
string account_name = 1;
}
message UnblockAccountOperation {
string account_name = 1;
}
message AddUserToAccountOperation {
string account_name = 1;
string user_id = 2;
}
message RemoveUserFromAccountOperation {
string account_name = 1;
string user_id = 2;
}
message BlockUserInAccountOperation {
string account_name = 1;
string user_id = 2;
}
message UnblockUserInAccountOperation {
string account_name = 1;
string user_id = 2;
}
message DeleteAccountOperation {
string account_name = 1;
}
message DeleteUserOperation {
string user_id = 1;
}

message SyncOperationResult {
oneof sync_operation {
CreateAccountOperation create_account = 1;
BlockAccountOperation block_account = 2;
UnblockAccountOperation unblock_account = 3;
AddUserToAccountOperation add_user_to_account = 4;
RemoveUserFromAccountOperation remove_user_from_account = 5;
BlockUserInAccountOperation block_user_in_account = 6;
UnblockUserInAccountOperation unblock_user_in_account = 7;
DeleteAccountOperation delete_account = 8;
DeleteUserOperation delete_user = 9;
}
bool success = 10;
// if success = false, return the failure message
optional string failure_message = 11;
}
repeated SyncOperationResult sync_results = 1;
}

service AccountService {

/**
Expand Down Expand Up @@ -271,4 +355,7 @@ service AccountService {
*/
rpc GetAllAccountsWithUsersAndBlockedDetails(GetAllAccountsWithUsersAndBlockedDetailsRequest) returns (GetAllAccountsWithUsersAndBlockedDetailsResponse);
// ********** Above is the interfaces for optional feature: RESOURCE_MANAGEMENT ***************

// sync accounts and related users
rpc SyncAccountUserInfo(SyncAccountUserInfoRequest) returns (SyncAccountUserInfoResponse);
}
Loading