diff --git a/authorization.proto b/authorization.proto index bdcb013..96bdbf6 100644 --- a/authorization.proto +++ b/authorization.proto @@ -2,27 +2,27 @@ syntax = "proto3"; package authorization; -import "base_message.proto"; import "authorization_message.proto"; +import "base_message.proto"; service AuthorizationService { - rpc InternalAuthorizationDeleteCache(base.Empty) returns(base.StatusRes); - rpc InternalInitRoutes(InternalInitRoutesReq) returns (base.StatusRes){} - rpc InternalGetUserIdentityBasic(GetUserReq) returns(UserIdentityBasic){} - rpc InternalGetUserIAM(GetUserReq) returns(InternalIAM){} - rpc CheckIAM(CheckIAMReq) returns (InternalIAM){} + rpc InternalAuthorizationDeleteCache(base.Empty) returns (base.StatusRes); + rpc InternalInitRoutes(InternalInitRoutesReq) returns (base.StatusRes) {} + rpc InternalGetUserIdentityBasic(GetUserReq) returns (UserIdentityBasic) {} + rpc InternalGetUserIAM(GetUserReq) returns (InternalIAM) {} + rpc CheckIAM(CheckIAMReq) returns (InternalIAM) {} - rpc UserLoginSendOTP(UserSendOtpReq) returns (UserSendOtpRes){} - rpc UserLoginWithOTP(UserLoginReq) returns (UserAccessTokenRes){} - rpc UserGetAccessTokenByRefreshToken(UserRefreshTokenReq) returns (UserAccessTokenRes){} + rpc UserLoginSendOTP(UserSendOtpReq) returns (UserSendOtpRes) {} + rpc UserLoginWithOTP(UserLoginReq) returns (UserAccessTokenRes) {} + rpc UserGetAccessTokenByRefreshToken(UserRefreshTokenReq) returns (UserAccessTokenRes) {} - rpc UserGetUserPermission(InternalIAM) returns (PermissionList){} + rpc UserGetUserPermission(InternalIAM) returns (PermissionList) {} - rpc UserGetIdentity(InternalIAM) returns (Identity){} - rpc UserUpdateIdentity(UserUpdateIdentityReq) returns (base.StatusRes){} + rpc UserGetIdentity(InternalIAM) returns (Identity) {} + rpc UserUpdateIdentity(UserUpdateIdentityReq) returns (base.StatusRes) {} - rpc UserGetBankInfoList(InternalIAM) returns (BankInfoList){} - rpc UserUpdateBankInfo(UserUpdateBankInfoReq) returns (base.StatusRes){} + rpc UserGetBankInfoList(InternalIAM) returns (BankInfoList) {} + rpc UserUpdateBankInfo(UserUpdateBankInfoReq) returns (base.StatusRes) {} - rpc GetUser(GetUserReq) returns (User){} -} \ No newline at end of file + rpc GetUser(GetUserReq) returns (User) {} +} diff --git a/authorization_message.proto b/authorization_message.proto index 8bbf771..7d43ea7 100644 --- a/authorization_message.proto +++ b/authorization_message.proto @@ -3,10 +3,10 @@ syntax = "proto3"; package authorization; /* - Internal - */ + Internal +*/ -message InternalInitRoutesReq{ +message InternalInitRoutesReq { repeated InternalRoute routes = 1; } message InternalRoute { @@ -16,14 +16,14 @@ message InternalRoute { } /* Role Permission */ -message Role{ - int64 id = 1; +message Role { + int64 id = 1; string title = 2; string Key = 3; string type = 4; } -message Permission{ - int64 id = 1; +message Permission { + int64 id = 1; string title = 2; string key = 3; string route = 4; @@ -35,8 +35,8 @@ message PermissionList { } /* - UserSendOtp - */ + UserSendOtp +*/ message UserSendOtpReq { string mobile = 1; @@ -46,8 +46,8 @@ message UserSendOtpRes { } /* - UserLogin - */ + UserLogin +*/ message UserLoginReq { string mobile = 1; @@ -63,26 +63,26 @@ message UserAccessTokenRes { } /* - IAM - */ + IAM +*/ -message CheckIAMReq{ +message CheckIAMReq { string access_token = 1; string route = 2; string method = 3; } message InternalIAM { - User user = 1; + User user = 1; IdentityBasic identity = 2; } /* - User - */ + User +*/ message GetUserReq { - int64 user_id = 1; - string national_id =2; + int64 user_id = 1; + string national_id = 2; } message User { @@ -93,6 +93,12 @@ message User { repeated int64 roles = 5; } +message Company { + int64 id = 1; + string name = 2; + string location = 3; +} + message Identity { string national_id = 1; string national_serial_id = 2; @@ -114,7 +120,8 @@ message Identity { string updated_at = 18; string created_at = 19; string email = 20; - + Company company = 21; + optional string employee_info = 22; } message IdentityBasic { @@ -156,4 +163,4 @@ message BankInfo { int32 status = 5; string updated_at = 6; string created_at = 7; -} \ No newline at end of file +}