Skip to content

Commit

Permalink
Merge pull request #20 from libxengine/develop
Browse files Browse the repository at this point in the history
V3.8.0.1001 Merge
  • Loading branch information
xengine-qyt authored Aug 11, 2023
2 parents 2f72e7d + 8d4a6d6 commit 2395033
Show file tree
Hide file tree
Showing 50 changed files with 787 additions and 624 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
XEngine_Authorize V3.8.0.1001

添加:管理端用户地址列表支持
增加:多端登录支持以及合并用时
更新:匹配XEngine V8.15
修改:次数卡类型用户登录后就修改了
修改:不在允许管理用户三方验证了
修改:管理接口不在限制单点登录了
修改:会话模块内部代码重构
修改:功能开关支持多端登录了
删除:普通用户http登录接口

added:client addr for user list of the management app
added:mulit device login supported and Merge Time
update:match xengine v8.15
modify:login to modify number of time for time serial type
modify:does not allow http hook for admin user
modify:the management interface does not limit single login now
modify:refator code for session module
modify:function switch supported multi login
delete:http login for normal user
================================================================
XEngine_Authorize V3.7.0.1001

添加:登录支持动态验证码功能
Expand Down
9 changes: 5 additions & 4 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ V2 Version can be update to V3,V3 DB Compatible with V2 Databse
## Software feature
A simple and high-performance cross-platform network authentication and authorization server developed and implemented based on XEngine
feature list:
1. support tcp,http.websocket protocols
1. support http.websocket protocols
2. Support Encrypto communication
3. Support User Management
4. Support Serial Management
Expand All @@ -44,11 +44,12 @@ feature list:
16. local cdkey support
17. announecement management
18. support dynamic verifaction code
19. support mulit login and merge time

## install

#### XEngine Evn
you must install XEngine,need V7.46 or above,install XEngine can be refer to xengine Readme docment
you must install XEngine,need V8.15 or above,install XEngine can be refer to xengine Readme docment
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine

Expand All @@ -64,11 +65,11 @@ Just Run it,use XEngine_AuthorizeService
XEngine_AuthorizeApp is pc management tools

#### Linux
use makefile compile,UBUNTU20.04 x64 or CENTOS8 x64
use makefile compile,UBUNTU22.04 x64 or RockyLinux 9 x64
Run it on the terminal,use XEngine_AuthorizeService

#### Macos
use makefile compile,mac 12 and above
use makefile compile,mac 13 and above
Run it on the terminal,use XEngine_AuthorizeService

##### compile command
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ V2可以直接升级到V3版本,因为数据库并没有修改,直接替换程
## 软件特性
基于XEngine开发并实现的一套简洁高性能跨平台网络验证授权服务器
软件特性:
1. 支持HTTP,TCP,WEBSOCKET协议
1. 支持TCP,WEBSOCKET协议
2. 支持加密通信
3. 支持用户管理
4. 支持序列卡管理
Expand All @@ -44,11 +44,12 @@ V2可以直接升级到V3版本,因为数据库并没有修改,直接替换程
16. 本地cdkey生成验证支持
17. 支持功公告管理
18. 支持动态验证码登录
19. 支持多端登录和合并用时

## 安装教程

#### XEngine环境
必须安装XEngine,版本需要V7.46或者以上版本,安装XEngine可以参考其Readme文档
必须安装XEngine,版本需要V8.15或者以上版本,安装XEngine可以参考其Readme文档
GITEE:https://gitee.com/xyry/libxengine
GITHUB:https://github.com/libxengine/xengine

Expand All @@ -64,11 +65,11 @@ macos执行:./XEngine_LINEnv.sh -i 3
XEngine_AuthorizeApp为PC端管理工具

#### Linux
Linux使用Makefile编译,UBUNTU20.04 x64或者CENTOS8 x64
Linux使用Makefile编译,UBUNTU22.04 x64或者RockyLinux 9 x64
在控制台运行,使用XEngine_AuthorizeService

#### Macos
使用makefile编译,控制台运行,需要mac 12以及以上版本
使用makefile编译,控制台运行,需要mac 13以及以上版本
在控制台运行,使用XEngine_AuthorizeService

##### 编译命令
Expand Down Expand Up @@ -132,9 +133,9 @@ V3版本为全新版本,为了适应过多环境要求开发

## 开发计划
mfc转qt界面库(我们需要会Qt的人员加入一起开发)
天数卡按照使用天数计费,不使用不计费
多端登录注册类型开关
短信登录,扫码登录
支持多端登录
多端登录合并用时
生成会话TOKEN分布式鉴权
token 自动续期
密码加密
Expand Down
4 changes: 3 additions & 1 deletion XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace std;
//Linux::g++ -std=c++17 -Wall -g Auth_APPClient.cpp -o Auth_APPClient.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Core -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Client -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_Socket -lNetHelp_APIClient -lpthread -ljsoncpp -Wl,-rpath=../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Core:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Client:../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp,--disable-new-dtags
//Macos::g++ -std=c++17 -Wall -g Auth_APPClient.cpp -o Auth_APPClient.exe -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_BaseLib -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Core -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_Client -L ../../../XEngine/XEngine_Release/XEngine_Linux/Ubuntu/XEngine_NetHelp -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_Socket -lNetHelp_APIClient -lpthread -ljsoncpp

#define _DYNAMIC_CODE
//#define _DYNAMIC_CODE
bool bRun = true;
bool bLogin = true;
bool bTimeOut = true;
Expand Down Expand Up @@ -376,6 +376,8 @@ int main()
AuthClient_Notice();
AuthClient_GetPass();
AuthClient_GetTime();

std::this_thread::sleep_for(std::chrono::seconds(60));
AuthClient_Delete();
AuthClient_Try();

Expand Down
Binary file modified XEngine_Docment/Docment_en.docx
Binary file not shown.
Binary file modified XEngine_Docment/Docment_zh.docx
Binary file not shown.
11 changes: 9 additions & 2 deletions XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@
"nDynamicTimeout":30,
"nVerTime":5,
"nVerMode":1,
"nTryTime":5,
"nTryTime":30,
"nTryMode":1
},
"XLogin":{
"bMultiLogin":true,
"bHTTPAuth":false,
"bPassAuth":false,
"nHTTPAuthTime":10,
"nMultiMode":0,
"st_PassUrl":{
"tszPassLogin":"http://127.0.0.1:5303/auth/pass/login",
"tszPassLogout":"http://127.0.0.1:5303/auth/pass/logout",
"tszPassTimeout":"http://127.0.0.1:5303/auth/pass/timeout"
},
"st_MulitLogin":{
"bMinute":true,
"bDay":true,
"bTime":true,
"bCustom":true
}
},
"XCrypto":{
Expand All @@ -46,6 +52,7 @@
"LogLeave":32
},
"XVer":[
"V3.8.0.1001 Build20230811",
"V3.7.0.1001 Build20230421",
"V3.6.0.1001 Build20230224",
"V3.5.0.1001 Build20230203",
Expand Down
3 changes: 2 additions & 1 deletion XEngine_Release/XEngine_Config/XEngine_SwitchConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"bSwitchTime":true,
"bSwitchCDKey":true,
"bSwitchNotice":true,
"bSwitchDCode":false
"bSwitchDCode":false,
"bSwitchMulti":false
}
11 changes: 10 additions & 1 deletion XEngine_Source/AuthorizeModule_Configure/Config_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,24 @@ typedef struct
}st_XVerification;
struct
{
bool bMultiLogin; //是否允许多端登录
bool bHTTPAuth; //是否开启HTTP授权登录,支持HTTP授权验证
bool bPassAuth; //是否启用三方认证
int nHTTPAuthTime; //HTTP验证超时时间,单位秒
int nMultiMode; //多端登录模式,0按照平台(PC,WEB,PAD,PHONE 4种),1按照类型(每种都可以)
struct
{
XCHAR tszPassLogin[MAX_PATH]; //三方认证登录验证
XCHAR tszPassLogout[MAX_PATH]; //三方认证登出通知
XCHAR tszPassTimeout[MAX_PATH]; //三方认证超时通知
}st_PassUrl;
//多端登录支持的计时方式
struct
{
bool bMinute;
bool bDay;
bool bTime;
bool bCustom;
}st_MulitLogin;
}st_XLogin;
struct
{
Expand Down Expand Up @@ -85,6 +93,7 @@ typedef struct
bool bSwitchCDKey; //是否允许本地CDKEY创建使用
bool bSwitchNotice; //是否开启公告系统
bool bSwitchDCode; //动态验证码
bool bSwitchMulti; //多端登录开关
}XENGINE_FUNCTIONSWITCH;
//////////////////////////////////////////////////////////////////////////
// 导出的函数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,28 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
pSt_ServerConfig->st_XVerification.nTryTime = st_JsonXVerification["nTryTime"].asInt();
pSt_ServerConfig->st_XVerification.nTryMode = st_JsonXVerification["nTryMode"].asInt();
//登录配置
if (st_JsonRoot["XLogin"].empty() || (5 != st_JsonRoot["XLogin"].size()))
if (st_JsonRoot["XLogin"].empty() || (6 != st_JsonRoot["XLogin"].size()))
{
Config_IsErrorOccur = true;
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XVER;
return false;
}
Json::Value st_JsonXLogin = st_JsonRoot["XLogin"];
pSt_ServerConfig->st_XLogin.bMultiLogin = st_JsonXLogin["bMultiLogin"].asBool();
pSt_ServerConfig->st_XLogin.bHTTPAuth = st_JsonXLogin["bHTTPAuth"].asBool();
pSt_ServerConfig->st_XLogin.bPassAuth = st_JsonXLogin["bPassAuth"].asBool();
pSt_ServerConfig->st_XLogin.nHTTPAuthTime = st_JsonXLogin["nHTTPAuthTime"].asInt();
pSt_ServerConfig->st_XLogin.nMultiMode = st_JsonXLogin["nMultiMode"].asInt();

Json::Value st_JsonXLoginUrl = st_JsonXLogin["st_PassUrl"];
_tcsxcpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassLogin, st_JsonXLoginUrl["tszPassLogin"].asCString());
_tcsxcpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassLogout, st_JsonXLoginUrl["tszPassLogout"].asCString());
_tcsxcpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassTimeout, st_JsonXLoginUrl["tszPassTimeout"].asCString());

Json::Value st_JsonMulitLogin = st_JsonXLogin["st_MulitLogin"];
pSt_ServerConfig->st_XLogin.st_MulitLogin.bCustom = st_JsonMulitLogin["bCustom"].asBool();
pSt_ServerConfig->st_XLogin.st_MulitLogin.bDay = st_JsonMulitLogin["bDay"].asBool();
pSt_ServerConfig->st_XLogin.st_MulitLogin.bMinute = st_JsonMulitLogin["bMinute"].asBool();
pSt_ServerConfig->st_XLogin.st_MulitLogin.bTime = st_JsonMulitLogin["bTime"].asBool();
//加密配置
if (st_JsonRoot["XCrypto"].empty() || (2 != st_JsonRoot["XCrypto"].size()))
{
Expand Down Expand Up @@ -252,5 +258,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_Switch(LPCXSTR lpszConfigFile,
pSt_ServerConfig->bSwitchCDKey = st_JsonRoot["bSwitchCDKey"].asBool();
pSt_ServerConfig->bSwitchNotice = st_JsonRoot["bSwitchNotice"].asBool();
pSt_ServerConfig->bSwitchDCode = st_JsonRoot["bSwitchDCode"].asBool();
pSt_ServerConfig->bSwitchMulti = st_JsonRoot["bSwitchMulti"].asBool();
return true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ bool CDatabase_SQLite::Database_SQLite_UserLeave(AUTHREG_PROTOCOL_TIME* pSt_Time
else if (ENUM_HELPCOMPONENTS_AUTHORIZE_SERIAL_TYPE_TIME == pSt_TimeProtocol->enSerialType)
{
//次数卡不需要在线时间,直接减去一次就可以了
_xstprintf(tszSQLStatement, _X("UPDATE Authorize_User SET LeftTime = '%lld' WHERE UserName = '%s'"), _ttxoll(pSt_TimeProtocol->tszLeftTime) - 1, pSt_TimeProtocol->tszUserName);
_xstprintf(tszSQLStatement, _X("UPDATE Authorize_User SET LeftTime = '%lld' WHERE UserName = '%s'"), _ttxoll(pSt_TimeProtocol->tszLeftTime), pSt_TimeProtocol->tszUserName);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CDatabase_SQLite
bool Database_SQLite_Destroy(); //销毁
public:
bool Database_SQLite_UserDelete(LPCXSTR lpszUserName); //删除用户
bool Database_SQLite_UserRegister(AUTHREG_USERTABLE*pSt_UserInfo); //用户注册
bool Database_SQLite_UserRegister(AUTHREG_USERTABLE*pSt_UserInfo); //用户注册
bool Database_SQLite_UserQuery(LPCXSTR lpszUserName, AUTHREG_USERTABLE* pSt_UserInfo = NULL); //用户查询
bool Database_SQLite_UserPay(LPCXSTR lpszUserName,LPCXSTR lpszSerialName); //充值卡充值
bool Database_SQLite_UserLeave(AUTHREG_PROTOCOL_TIME* pSt_TimeProtocol); //用户离开更新表
Expand Down
22 changes: 22 additions & 0 deletions XEngine_Source/AuthorizeModule_Help/AuthHelp_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ extern "C" bool AuthHelp_DynamicCode_Create(XNETHANDLE* pxhToken, int* pInt_Dyna
*********************************************************************/
extern "C" bool AuthHelp_DynamicCode_Get(XNETHANDLE xhToken, int nDynamicCode);
/************************************************************************/
/* 多端登录导出定义 */
/************************************************************************/
/********************************************************************
函数名称:AuthHelp_MultiLogin_GetRange
函数功能:获取多端登录范围
参数.一:nClientDevice
In/Out:In
类型:整数型
可空:N
意思:输入要判断的设备类型
参数.二:pInt_IDType
In/Out:In
类型:整数型指针
可空:N
意思:输出设备范围类型
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool AuthHelp_MultiLogin_GetRange(int nClientDevice, int* pInt_IDType);
/************************************************************************/
/* 剪贴板导出定义 */
/************************************************************************/
#ifdef _MSC_BUILD
Expand Down
6 changes: 5 additions & 1 deletion XEngine_Source/AuthorizeModule_Help/AuthHelp_Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@
#define ERROR_AUTHORIZE_MODULE_HELP_DYNAMIC_THREAD 0x0050020 //线程创建失败
#define ERROR_AUTHORIZE_MODULE_HELP_DYNAMIC_PARAMENT 0x0050021 //参数错误
#define ERROR_AUTHORIZE_MODULE_HELP_DYNAMIC_NOTFOUND 0x0050022 //没有找到
#define ERROR_AUTHORIZE_MODULE_HELP_DYNAMIC_NOTMATCH 0x0050023 //动态码不匹配
#define ERROR_AUTHORIZE_MODULE_HELP_DYNAMIC_NOTMATCH 0x0050023 //动态码不匹配
/************************************************************************/
/* 多端登录 */
/************************************************************************/
#define ERROR_AUTHORIZE_MODULE_HELP_MULTI_NOTSUPPORT 0x0050030 //不支持
Loading

0 comments on commit 2395033

Please sign in to comment.