Skip to content

Commit

Permalink
Merge pull request #13 from libxengine/develop
Browse files Browse the repository at this point in the history
V3.2.0.1001 Merge
  • Loading branch information
xengine-qyt authored Sep 23, 2022
2 parents 928fc0a + 6ed771a commit 991f6ec
Show file tree
Hide file tree
Showing 57 changed files with 1,421 additions and 294 deletions.
50 changes: 50 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
XEngine_Authorize V3.2.0.1001

增加:为管理程序增加用户注册功能
增加:日志窗口并且支持日志保存和清理
增加:http支持加密
增加:配置窗口支持加密配置管理
增加:发送消息内存池支持
增加:登录配置选项
增加:指定会话TOKEN用户超时
增加:HTTP用户授权验证
增加:会话网络类型
增加:三方验证支持
增加:分布式验证功能
修改:Session_Authorize_GetTimer 为 Session_Authorize_GetClientForUser 可以获取更多信息
修改:token关闭的时候验证会话也会一起关闭
修改:http管理接口验证权限
修改:程序启动按钮关闭没有禁用
修改:用户管理和用户修改以及序列号验证接口支持加解密了
修改:允许http管理器重复登录了
修改:弹窗消息现在显示在日志窗口了
修正:一个大小写问题
修正:websocket协议不支持加密的问题
修正:token打印问题
修正:添加用户注册级别设置无效的问题
删除:类型字符串

added:user insert for app management
added:log windows and log save and clear
added:encrypto for payload of the http
added:configure dialog supported crypto for management app
added:memory pool for send message
added:login for configure
added:specified user timeout for session token
added:user authorize verification for http
added:nettype for session authorize
added:Third Party Verification
added:distributed verification function
modify:Session_Authorize_GetTimer to Session_Authorize_GetClientForUser for get more information
modify:token close with authorize session
modify:http manage api verification permission now
modify:close buttom is not disable when program start
modify:user manage and user modify and serial management support encrypto
modify:allow repeat login for http management
modify:messagebox to log window
fixed:case problem
fixed:websocket not support crypto
fixed:token print error
fixed:add user level set does not work
delete:type string array
======================================================================================
XEngine_Authorize V3.1.0.1001

添加:删除TOKEN会话功能
Expand Down
23 changes: 20 additions & 3 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@ As long as the repository is not in a suspended state, someone will maintain and
c c++网络验证服务器 网络授权服务器
c c++network Authorize service
the server is network authorize verification service code library,This service mainly provides network authorization verification function.support local and network verification mode
network verification support tcp and websocket protocol verification.it is means:support app program and web
network verification support tcp and websocket and http protocol verification.it is means:support app program and web
first open source C/C++ network authentication server, supporting various languages ​​and platforms for network authentication and authorization
This is a cross-platform simple high-performance network authorization server that provides a complete demo code

#### why choose us
Fast iteration: feature updates are timely
Technical support: complete technical documentation and technical support, quick response to your questions
Unlimited language: don't care about the language your client uses, you can choose your own appropriate communication method
Stable and reliable: based on C/C++, the core framework has been verified for 10 years. It is stable and compatible with high performance
Flexible authentication: supports third-party authentication and authorization, supports distributed authentication and authorization, and can use its own user password system
more functions: support various types of authorization

#### Version difference
V3 version, the protocol is basically reimplemented. It is no longer compatible with the V2 protocol. V3 is basically changed to the HTTP interface for management. The compatibility is better. Please check the documentation for more.
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. use standard private protocol to handle network communication
1. support tcp,http.websocket protocols
2. Support Encrypto communication
3. Support User Management
4. Support Serial Management
Expand All @@ -29,6 +38,8 @@ feature list:
10. Support app program and html web Authorize
11. Support Accesss Control
12. support http management api function,you can write web page to implement network authorize management interface by self
13. support third user verification interface
14. support distributed verification authorize function

## install

Expand Down Expand Up @@ -64,12 +75,13 @@ make FLAGS=CleanAll Clear Complie

## test server
address:app.xyry.org or 159.75.200.173
port :tcp port 5300,websocket port 5301,Transmission verification password: no encryption
port :tcp port 5300,websocket port 5301,http management port 5302,Transmission verification password: no encryption

## Screenshot of the program
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/1.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/2.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/3.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/4.png "在这里输入图片标题")

## Participate in contribution

Expand All @@ -78,6 +90,11 @@ port :tcp port 5300,websocket port 5301,Transmission verification password: no e
3. Submit the code
4. New Pull Request

## development path
The V1 version is an XEngine component. Most of the code is concentrated in XEngine
The V2 version comes out separately with all related modules and is developed separately
The V3 version is a new version, developed to meet the requirements of many environments

## Authorization instructions
Use this software must be open source and indicate the source,If you want closed source and commercial,Then need to be authorized by the author.

Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
c c++网络验证服务器 网络授权服务器
c c++network Authorize service
这是网络授权验证服务器的代码库,这个服务主要提供网络授权验证功能.支持本地和网络两种验证模式
网络验证支持TCP和WEBSOCKET协议验证,也就是说,支持APP程序和WEB网页端
网络验证支持TCP和WEBSOCKET以及HTTP协议验证,也就是说,支持APP程序和WEB网页端
全国首款开源C/C++ 网络验证服务器,支持各种语言各种平台进行网络验证和授时服务
这是一个跨平台简单高性能网络授权服务器,提供了完整的演示代码

#### 为什么选择我们
快速迭代:功能更新及时
技术支持:完善的技术文档和技术支持,快速响应你的问题
不限语言:不关心你的客户端使用的语言,你可以选择自己合适的通信方式
稳定可靠:基于C/C++实现的,核心框架10年+验证.稳定与高性能兼容
灵活验证:支持第三方验证授权,支持分布式验证授权,可以使用自己的用户密码系统
功能丰富:支持各种类型授权,支持时间和次数等等模式

#### 版本区别
V3版本后协议基本重新实现,不在兼容V2协议,V3基本改为HTTP接口进行管理.兼容性更好.请查看文档获取更多.
V2可以直接升级到V3版本,因为数据库并没有修改,直接替换程序即可.数据库兼容V2版本

## 软件特性
基于XEngine开发并实现的一套简洁高性能跨平台网络验证授权服务器
软件特性:
1. 采用标准私协议来处理网络通信
1. 支持HTTP,TCP,WEBSOCKET协议
2. 支持加密通信
3. 支持用户管理
4. 支持序列卡管理
Expand All @@ -29,6 +38,8 @@ V3版本后协议基本重新实现,不在兼容V2协议,V3基本改为HTTP接
10. 支持APP程序和HTML网页授权验证
11. 支持权限控制
12. 支持HTTP管理接口,可以自己写前端实现网络验证管理界面
13. 支持第三方用户验证接口
14. 分布式验证授权功能支持

## 安装教程

Expand Down Expand Up @@ -64,12 +75,13 @@ make FLAGS=CleanAll 清理编译

## 测试服务器
地址:app.xyry.org 或者 159.75.200.173
端口:tcp端口 5300,websocket端口 5301,传输验证密码:无加密
端口:tcp端口 5300,websocket端口 5301,http管理端 5302,传输验证密码:无加密

## 程序截图
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/1.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/2.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/3.png "在这里输入图片标题")
![输入图片说明](https://www.xyry.org/XEngine_StructPic/authorize/4.png "在这里输入图片标题")

## 参与贡献

Expand All @@ -78,6 +90,11 @@ make FLAGS=CleanAll 清理编译
3. 提交代码
4. 新建 Pull Request

## 发展历程
V1版本为XEngine组件.大部分代码集中在XEngine中
V2版本单独出来了所有相关模块,单独开发
V3版本为全新版本,为了适应过多环境要求开发

## 授权说明
使用此软件必须开源并且注明出处,如果想闭源商用,那么需要经过作者授权.

Expand All @@ -89,13 +106,14 @@ make FLAGS=CleanAll 清理编译
如果你有问题,可以在issues中提交

## 开发计划
功能启用关闭(注册,登录,等)
mfc转qt界面库(我们需要会Qt的人员加入一起开发)
支持多端登录
多端登录合并用时
生成会话TOKEN分布式鉴权
支持OAuth验证
mysql支持
列表数据分割,用于大型服务器
支持第三方用户密码验证
支持用户和硬件绑定同时验证
支持自定义序列号插入导入
统计用户所有在线时间
Binary file modified XEngine_Apps/Authorize_APPClient.e
Binary file not shown.
2 changes: 1 addition & 1 deletion XEngine_Apps/Authorize_APPClient/Authorize_APPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int AuthClient_Register()
st_JsonUserInfo["tszEMailAddr"] = lpszEmail;
st_JsonUserInfo["nPhoneNumber"] = nPhoneNumber;
st_JsonUserInfo["nIDNumber"] = nIDNumber;
st_JsonUserInfo["nIDNumber"] = nIDNumber;
st_JsonUserInfo["nUserLevel"] = 5;

st_JsonUserTable["tszHardCode"] = "2FDWAD02JD2091";
st_JsonUserTable["st_UserInfo"] = st_JsonUserInfo;
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.
28 changes: 27 additions & 1 deletion XEngine_Release/XEngine_Config/XEngine_Config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
"nTryTime":5,
"nTryMode":1
},
"XLogin":{
"bMultiLogin":true,
"bHTTPAuth":false,
"bPassAuth":false,
"nHTTPAuthTime":10,
"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"
}
},
"XCrypto":{
"bEnable":false,
"nPass":123123
Expand All @@ -34,6 +45,7 @@
"LogLeave":32
},
"XVer":[
"V3.2.0.1001 Build20220923",
"V3.1.0.1001 Build20220826",
"V3.0.0.1001 Build20220816",
"V2.8.0.1001 Build20220809",
Expand All @@ -47,6 +59,20 @@
"V2.4.0.1001 Build20211105",
"V2.3.0.1001 Build20211022",
"V2.2.0.1001 Build20210806",
"V1.0.0.1001 Build20210501"
"V2.1.0.1001 Build20210801",
"V2.0.0.1001 Build20210723",
"V1.11.0.1001 Build20210618",
"V1.10.0.1001 Build20210524",
"V1.9.0.1001 Build20210503",
"V1.9.0.1001 Build20210423",
"V1.8.0.1001 Build20210209",
"V1.7.0.1001 Build20210116",
"V1.6.0.1001 Build20190601",
"V1.5.0.1001 Build20190522",
"V1.4.0.1001 Build20190308",
"V1.3.0.1001 Build20141030",
"V1.2.0.1001 Build20140907",
"V1.1.0.1001 Build20110320",
"V1.0.0.1001 Build20110306"
]
}
Empty file.
13 changes: 13 additions & 0 deletions XEngine_Source/AuthorizeModule_Configure/Config_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ typedef struct
int nTryTime; //验证时间
int nTryMode; //验证模式
}st_XVerification;
struct
{
BOOL bMultiLogin; //是否允许多端登录
BOOL bHTTPAuth; //是否开启HTTP授权登录,支持HTTP授权验证
BOOL bPassAuth; //是否启用三方认证
int nHTTPAuthTime; //HTTP验证超时时间,单位秒
struct
{
TCHAR tszPassLogin[MAX_PATH]; //三方认证登录验证
TCHAR tszPassLogout[MAX_PATH]; //三方认证登出通知
TCHAR tszPassTimeout[MAX_PATH]; //三方认证超时通知
}st_PassUrl;
}st_XLogin;
struct
{
BOOL bEnable; //是否启用加密传输
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ BOOL CModuleConfigure_Json::ModuleConfigure_Json_File(LPCTSTR lpszConfigFile, XE
pSt_ServerConfig->st_XVerification.nVerMode = st_JsonXVerification["nVerMode"].asInt();
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()))
{
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();

Json::Value st_JsonXLoginUrl = st_JsonXLogin["st_PassUrl"];
_tcscpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassLogin, st_JsonXLoginUrl["tszPassLogin"].asCString());
_tcscpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassLogout, st_JsonXLoginUrl["tszPassLogout"].asCString());
_tcscpy(pSt_ServerConfig->st_XLogin.st_PassUrl.tszPassTimeout, st_JsonXLoginUrl["tszPassTimeout"].asCString());
//加密配置
if (st_JsonRoot["XCrypto"].empty() || (2 != st_JsonRoot["XCrypto"].size()))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ BOOL CDatabase_SQLite::Database_SQLite_UserRegister(AUTHREG_USERTABLE* pSt_UserI
SQLPacket_dwErrorCode = ERROR_AUTHORIZE_MODULE_DATABASE_EXIST;
return FALSE;
}
_stprintf_s(tszSQLStatement, _T("INSERT INTO AuthReg_User(UserName, Password, LeftTime, EmailAddr, HardCode, CardSerialType, PhoneNumber, IDCard, nUserLevel, CreateTime) values('%s','%s','%s','%s','%s','%d',%lld,%lld,5,datetime('now', 'localtime'))"), pSt_UserInfo->st_UserInfo.tszUserName, pSt_UserInfo->st_UserInfo.tszUserPass, pSt_UserInfo->tszLeftTime, pSt_UserInfo->st_UserInfo.tszEMailAddr, pSt_UserInfo->tszHardCode, pSt_UserInfo->enSerialType, pSt_UserInfo->st_UserInfo.nPhoneNumber, pSt_UserInfo->st_UserInfo.nIDNumber);
_stprintf_s(tszSQLStatement, _T("INSERT INTO AuthReg_User(UserName, Password, LeftTime, EmailAddr, HardCode, CardSerialType, PhoneNumber, IDCard, nUserLevel, CreateTime) values('%s','%s','%s','%s','%s','%d',%lld,%lld,%d,datetime('now', 'localtime'))"), pSt_UserInfo->st_UserInfo.tszUserName, pSt_UserInfo->st_UserInfo.tszUserPass, pSt_UserInfo->tszLeftTime, pSt_UserInfo->st_UserInfo.tszEMailAddr, pSt_UserInfo->tszHardCode, pSt_UserInfo->enSerialType, pSt_UserInfo->st_UserInfo.nPhoneNumber, pSt_UserInfo->st_UserInfo.nIDNumber, pSt_UserInfo->st_UserInfo.nUserLevel);
if (!DataBase_SQLite_Exec(xhData, tszSQLStatement))
{
SQLPacket_IsErrorOccur = TRUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ EXPORTS
Protocol_Parse_HttpParseTable
Protocol_Parse_HttpParseSerial
Protocol_Parse_HttpParseSerial2
Protocol_Parse_HttpParseOnline
Protocol_Parse_HttpParseOnline
Protocol_Parse_HttpParseTime
26 changes: 25 additions & 1 deletion XEngine_Source/AuthorizeModule_Protocol/Protocol_Define.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,4 +506,28 @@ extern "C" BOOL Protocol_Parse_HttpParseSerial2(LPCTSTR lpszMsgBuffer, int nMsgL
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL Protocol_Parse_HttpParseOnline(LPCTSTR lpszMsgBuffer, int nMsgLen, BOOL* pbOnline);
extern "C" BOOL Protocol_Parse_HttpParseOnline(LPCTSTR lpszMsgBuffer, int nMsgLen, BOOL* pbOnline);
/********************************************************************
函数名称:Protocol_Parse_HttpParseTime
函数功能:解析时间信息结构
参数.一:lpszMsgBuffer
In/Out:In
类型:常量字符指针
可空:N
意思:输入要解析的缓冲区
参数.二:nMsgLen
In/Out:In
类型:整数型
可空:N
意思:输入要解析的大小
参数.三:pSt_ProtocolTime
In/Out:Out
类型:数据结构指针
可空:N
意思:导出解析的数据
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" BOOL Protocol_Parse_HttpParseTime(LPCTSTR lpszMsgBuffer, int nMsgLen, AUTHREG_PROTOCOL_TIME* pSt_ProtocolTime);
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ BOOL CProtocol_Packet::Protocol_Packet_HttpUserTime(TCHAR* ptszMsgBuffer, int* p
st_JsonObject["nTimeONLine"] = (Json::Value::Int64)pSt_ProtocolTime->nTimeONLine;
st_JsonObject["enDeviceType"] = pSt_ProtocolTime->enDeviceType;
st_JsonObject["enSerialType"] = pSt_ProtocolTime->enSerialType;
st_JsonObject["nNetType"] = pSt_ProtocolTime->nNetType;

st_JsonRoot["st_UserTime"] = st_JsonObject;

Expand Down
Loading

0 comments on commit 991f6ec

Please sign in to comment.