proto/service/ldap.proto
menghaiwen@fusen.cn 68dcd3bf8f 新增
2024-03-05 10:29:27 +08:00

347 lines
11 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3"; //版本声明使用v3版本
package ldap;
option go_package = "gitlab.fusenpack.com/backend/ldap;service";
// 导入google/api/annotations.proto 注释依赖
import "service/basic.proto";
//定义服务
service ldap {
// 心跳
rpc Ping(basic.Request) returns (basic.Response) {}
//获取ldap部门列表
rpc GetLdapOrganizations(basic.Request) returns(GetLdapOrganizationsRsp){}
//添加ldap部门
rpc CreateLdapOrganization(CreateLdapOrganizationReq)returns(basic.Response){}
//删除ldap部门
rpc DeleteLdapOrganization(DeleteLdapOrganizationReq) returns(basic.Response){}
//修改ldap部门
rpc UpdateLdapOrganization(UpdateLdapOrganizationReq) returns(basic.Response){}
//添加ldap用户帐号
rpc CreateLdapUser(CreateLdapUserReq) returns(basic.Response){}
//修改ldap用户信息
rpc UpdateLdapUser(UpdateLdapUserReq) returns(basic.Response){}
//修改ldap用户密码
rpc UpdateLdapUserPwd(UpdateLdapUserPwdReq) returns(basic.Response){}
//禁用ldap用户帐号
rpc DisableLdapUser(DisableLdapUserReq) returns(basic.Response){}
//删除ldap用户帐号
rpc DeleteLdapUser(DeleteLdapUserReq) returns(basic.Response){}
//获取用户信息
rpc GetLdapUserInfo(GetLdapUserInfoReq) returns(GetLdapUserInfoRsp){}
//获取用户信息--批量
rpc GetLdapUsersByUserIds(GetLdapUsersByUserIdsReq) returns(GetLdapUsersRsp){}
//ldap部门添加成员
rpc AddLdapOrganizationMember(AddLdapOrganizationMemberReq) returns(basic.Response){}
//ldap部门移除成员
rpc RemoveLdapOrganizationMember(RemoveLdapOrganizationMemberReq) returns(basic.Response){}
//获取ldap组织成员列表
rpc GetLdapOrganizationMembers(GetLdapOrganizationMembersReq) returns(GetLdapOrganizationMembersRsp){}
//创建用户基础组
rpc CreateLdapUserBaseGroup(basic.Request) returns (basic.Response) {}
//获取基础用户组中成员列表
rpc GetLdapUsers(GetLdapUsersReq) returns (GetLdapUsersRsp) {}
//登录
rpc LdapUserLogin(LdapUserLoginReq) returns (LdapUserLoginRsp) {}
//解析token
rpc LdapParseToken(LdapParseTokenReq) returns (LdapParseTokenRsp) {}
//获取权限组列表
rpc GetLdapGroups(GetLdapGroupsReq) returns (GetLdapGroupsRsp);
//获取权限组详情
rpc GetLdapGroupDetail(GetLdapGroupDetailReq) returns (GetLdapGroupDetailRsp);
//保存权限组
rpc SaveLdapGroup(SaveLdapGroupReq) returns (SaveLdapGroupRsp);
//删除权限组
rpc DeleteLdapGroup(DeleteLdapGroupReq) returns (DeleteLdapGroupRsp);
//权限组授权--新增
rpc SetLdapGroupAuth(SetLdapGroupAuthReq) returns (SetLdapGroupAuthRsp);
//权限组授权--移除
rpc RemoveLdapGroupAuth(RemoveLdapGroupAuthReq) returns (RemoveLdapGroupAuthRsp);
//验证权限组
rpc VerifyAuthorityGroup(VerifyAuthorityGroupReq) returns (VerifyAuthorityGroupRsp);
}
message VerifyAuthorityGroupReq {
string path = 1;
string method = 2;
string category = 3;
int64 group_id = 4;
}
message VerifyAuthorityGroupRsp {
}
message GetLdapGroupsReq {
LdapGroupFilter filter = 1;
int64 current_page = 101;
int64 per_page = 102;
string order_by = 103;
}
message GetLdapGroupsRsp {
repeated LdapGroup list = 1;
basic.Meta meta = 2;
}
message GetLdapGroupDetailReq {
LdapGroupFilter filter = 1;
}
message GetLdapGroupDetailRsp {
LdapGroup info = 1;
repeated int64 apis =2;
}
message SaveLdapGroupReq {
LdapGroupFilter filter = 1;
LdapGroupFilter save = 2;
}
message SaveLdapGroupRsp {
LdapGroup info = 1;
}
message DeleteLdapGroupReq {
LdapGroupFilter filter = 1;
}
message DeleteLdapGroupRsp {
}
message SetLdapGroupAuthReq {
int64 group_id = 1;
GroupAuth group_auth = 2;
}
message SetLdapGroupAuthRsp {
int64 group_id = 1;
}
message RemoveLdapGroupAuthReq {
int64 group_id = 1;
GroupAuth group_auth = 2;
}
message RemoveLdapGroupAuthRsp {
int64 group_id = 1;
}
message GroupAuth {
int64 id = 1;
string name = 2;
string type = 3;
}
message LdapGroup {
int64 id = 1;
string type = 2;
string name = 3;
string keyword = 4;
string remark = 5;
int64 status = 6;
int64 sort = 7;
bytes metadata = 101;
string ctime = 102;
string utime = 103;
}
message LdapGroupFilter {
optional int64 id = 1;
optional string type = 2;
optional string name = 3;
optional string keyword = 4;
optional string remark = 5;
optional int64 status = 6;
optional int64 sort = 7;
optional bytes other_filter = 101; // 其他过滤条件
repeated int64 ldap_grouop_ids = 102; // 资源ID列表
optional bytes metadata = 103;
}
//获取ldap部门列表
message GetLdapOrganizationsRsp{
repeated LdapOrganization list = 1;
}
message LdapOrganization {
int32 member_count = 1; //成员数
string organization_name = 2; //部分名字
string organization_dn = 3; //部门dn
string owner_name = 4; //负责人名字
string owner_dn = 5; //负责人dn
int32 level = 6; //层级
string parent_organization_dn = 7;//父级部门dn
int32 sort = 8; //序号
repeated LdapOrganization child = 9;//子部门
}
//添加ldap部门
message CreateLdapOrganizationReq{
string organization_name = 1; //部门名
string parent_organization_dn = 2; //父级部门dn
string owner_dn = 3 ; //负责人dn
}
//删除ldap部门
message DeleteLdapOrganizationReq{
repeated string organization_dns = 1;//要删除的部门dn集合
}
//修改ldap部门
message UpdateLdapOrganizationReq{
string organization_dn = 1; //组织dn
string organization_name = 2; //组织分类名称
string organization_owner_dn = 3; //负责人dn
}
//添加ldap用户帐号
message CreateLdapUserReq{
string user_name = 1; //用户名
string email = 2; //邮箱
string password = 3; //密码
string mobile = 4; //手机号
string avatar = 5; //头像地址
int64 employee_type = 6; //1正式 2实习 3外包
int64 group_id = 7; //授权分组id
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
int64 status = 10; //状态 1正常0离职
}
//修改ldap用户信息
message UpdateLdapUserReq{
string user_dn = 1; //用户dn
string user_name = 2; //用户名
string mobile = 3; //手机号
string avatar = 4; //头像地址
int64 status = 5; //状态 1正常0离职
int64 employee_type = 6; //1正式 2实习 3外包
int64 group_id = 7; //权限分组id
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
}
//修改ldap用户密码
message UpdateLdapUserPwdReq{
string user_dn = 1; //用户dn
string new_password = 2;//新密码
string old_password = 3;//旧密码
}
//禁用ldap用户帐号
message DisableLdapUserReq{
string user_dn = 1;//用户dn
}
//删除ldap用户帐号
message DeleteLdapUserReq{
string user_dn = 1;//用户dn
}
//获取用户信息
message GetLdapUserInfoReq{
string user_dn = 1;//用户dn
}
//获取用户信息--批量
message GetLdapUsersByUserIdsReq{
repeated int64 user_ids = 1;//用户ID
}
//获取用户信息--批量
message GetLdapUsersByUserIdsRsp{
repeated GetLdapUsersItem list = 1;
string paging_cookie = 2;
}
message GetLdapUserInfoRsp{
int64 user_id = 1; //用户id
string user_dn = 2; //用户dn
string user_name = 3; //用户名
string email = 4; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7;//雇佣类型 1正式 2实习 3外包
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
repeated string belong_organization = 10;//属于哪些部门
repeated string manage_organization = 11; //负责哪些部门
int64 status = 12 ; //状态 1正常0离职
}
//ldap部门添加成员
message AddLdapOrganizationMemberReq{
string organization_dn = 1 ; //目标组织DN
string user_dn = 2; //用户DN
}
//ldap部门移除成员
message RemoveLdapOrganizationMemberReq{
string organization_dn = 1; //目标组织DN
string user_dn = 2; //用户DN
}
//获取ldap组织成员列表
message GetLdapOrganizationMembersReq{
string organization_dn = 1; //组织dn
string user_name = 2; //用户名(模糊搜索)
}
message GetLdapOrganizationMembersRsp {
repeated GetLdapOrganizationMembersItem list = 1;
}
message GetLdapOrganizationMembersItem {
int64 userId = 1; //用户id
string user_dn = 2 ; //用户dn
string user_name = 3 ; //用户名
string email = 4 ; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7 ; //雇佣类型
int64 gender = 8 ; //性别 1男 2女 3未知
string birthday = 9 ; //生日
repeated string belong_organizations = 10; //属于哪些部门
repeated string manage_organizations = 11 ;//管理哪些部门
int64 status = 12 ; //状态 1正常0离职
int64 group_id = 13; //权限分组id
}
//获取基础用户组中成员列表
message GetLdapUsersReq{
string page_cookie = 1; //下一页分页游标,传空/不传就是第一页
string user_name = 2 ; //用户名用于模糊搜索
int64 gender = 3; //性别 0所有 1男 2女 3未知
int64 employee_type = 4;//员工类型0所有 1正式 2实习 3外包
}
message GetLdapUsersRsp{
repeated GetLdapUsersItem list = 1;
string paging_cookie = 2;
}
message GetLdapUsersItem {
int64 user_id = 1; //用户id
string user_dn = 2; //用户dn
string user_name = 3; //用户名
string email = 4; //邮箱
string mobile = 5; //手机号
string avatar = 6; //头像地址
int64 employee_type = 7; //雇佣类型 1正式 2实习 3外包
int64 gender = 8; //性别 1男 2女 3未知
string birthday = 9; //生日
repeated string belong_organizations = 10 ;//属于哪些部门
repeated string manage_organizations = 11 ;//管理哪些部门
int64 status = 12 ; //状态 1正常0离职
int64 group_id = 13; //权限分组id
}
//登录
message LdapUserLoginReq{
string email = 1; //邮箱
string password = 2;//密码
}
message LdapUserLoginRsp{
string token = 1;
}
//解析token
message LdapParseTokenReq{
string token = 1;
}
message LdapParseTokenRsp{
string UserDn = 1;
int64 UserId = 2;
string UserEmail = 3;
int64 group_id = 4;
int64 gender = 5;//性别
string birthday = 6;//生日
repeated string belong_to_organizations = 7;//属于部门DN集合
repeated string belong_to_organization_names = 8;//属于部门名字集合
repeated string manage_organizations = 9;//管理的部门dn集合
repeated string manage_organization_names = 10;//管理的部门名字集合
int64 status = 11; //状态 1正常0离职
}