后端代码

main
周文涛 2 years ago
commit f6b0036c05

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
<fileset name="all" enabled="true" check-config-name="checkstyle-rules" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>

1
.gitattributes vendored

@ -0,0 +1 @@
*.html linguist-language=java

4
.gitmodules vendored

@ -0,0 +1,4 @@
[submodule "summer-ospp/2023/shenyu"]
url = https://gitee.com/dromara/MaxKey
path = summer-ospp/2023/shenyu

@ -0,0 +1,4 @@
第三方许可证/Third party licenses
see
https://maxkey.top/zh/about/dependency.html

@ -0,0 +1,228 @@
# 贡献代码
欢迎您对MaxKey项目的贡献。
我们诚挚的感谢你的贡献,这个文档描述了我们的工作方式和工作流程,开发者也可以同时参考官方的相关文档。
## Workflow
MaxKey开发中使用到的几种模型在这个链接下载 [点我](https://github.com/MaxKeyTop/MaxKey/archive/master.zip).
之后是贡献代码的主要流程。
### Fork
* MaxKey采用Pull Request的方式提交代码禁止直接push所有的代码都需要人工review。首先要fork一份MaxKey的代码 ["Fork" button](https://help.github.com/articles/fork-a-repo/).
* 跳转到[MaxKey](https://github.com/MaxKeyTop/MaxKey) GitHub首页然后单击 `Fork` 按钮,生成自己目录下的仓库,比如 <https://github.com/你的用户名/MaxKey>
### Clone(克隆)
将远程仓库 clone 到本地:
```bash
➜ git clone https://github.com/你的用户名/MaxKey
➜ cd MaxKey
```
### 创建本地分支
MaxKey 目前使用[Git流分支模型](http://nvie.com/posts/a-successful-git-branching-model/)进行开发,测试,发行和维护
所有的 feature 和 bug fix 的开发工作都应该在一个新的分支上完成,一般从 `develop` 分支上创建新分支。
使用 `git checkout -b` 创建并切换到新分支。
```bash
➜ git checkout -b my-cool-stuff
```
值得注意的是,在 checkout 之前,需要保持当前分支目录 clean否则会把 untracked 的文件也带到新分支上,这可以通过 `git status` 查看。
### 使用 `pre-commit` 钩子
MaxKey 开发人员使用 [pre-commit](http://pre-commit.com/) 工具来管理 Git 预提交钩子。 在提交commit前自动检查一些基本事宜如每个文件只有一个 EOLGit 中不要添加大文件等)。
`pre-commit`测试是单元测试的一部分,不满足钩子的 PR 不能被提交到 MaxKey首先安装并在当前目录运行它
```bash
pip install pre-commit
pre-commit -v -a
```
## 开始开发
在本例中,我删除了 README.md 中的一行,并创建了一个新文件。
通过 `git status` 查看当前状态,这会提示当前目录的一些变化,同时也可以通过 `git diff` 查看文件具体被修改的内容。
```bash
➜ git status
On branch test
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
test
no changes added to commit (use "git add" and/or "git commit -a")
```
## 构建
配置环境变量
gradleSetEnv.bat
set JAVA_HOME=D:\JavaIDE\jdk1.8.0_91
set GRADLE_HOME=D:\JavaIDE\gradle-5.4.1
启动构建
gradleBuildRelease.bat
构建结果
构建包路径
MaxKey/build/maxkey-jars
依赖包路径
MaxKey/build/maxkey-depjars
具体开发配置参见 https://maxkey.top/zh/development.html
## 提交commit
接下来我们取消对 README.md 文件的改变,然后提交新添加的 test 文件。
```bash
➜ git checkout -- README.md
➜ git status
On branch test
Untracked files:
(use "git add <file>..." to include in what will be committed)
test
nothing added to commit but untracked files present (use "git add" to track)
➜ git add test
```
Git 每次提交代码,都需要写提交说明,这可以让其他人知道这次提交做了哪些改变,这可以通过`git commit` 完成。
```bash
▶ pre-commit run -a -v
[remove-crlf] CRLF end-lines remover........................................Passed
[remove-tabs] Tabs remover..................................................Passed
[check-added-large-files] Check for added large files.......................Passed
[check-merge-conflict] Check for merge conflicts............................Passed
[check-symlinks] Check for broken symlinks..................................Passed
[detect-private-key] Detect Private Key.....................................Passed
[end-of-file-fixer] Fix End of Files........................................Passed
[trailing-whitespace] Trim Trailing Whitespace..............................Passed
[copyright] copyright.......................................................Passed
[clang-format] clang-format.................................................Passed
```
## 保持本地仓库最新
在准备发起 Pull Request 之前,需要同步原仓库(<https://github.com/MaxKeyTop/MaxKey>)最新的代码。
首先通过 `git remote` 查看当前远程仓库的名字。
```bash
➜ git remote
origin
➜ git remote -v
origin https://github.com/USERNAME/MaxKey (fetch)
origin https://github.com/USERNAME/MaxKey (push)
```
这里 origin 是我们 clone 的远程仓库的名字,也就是自己用户名下的 MaxKey接下来我们创建一个原始 MaxKey 仓库的远程主机,命名为 upstream。
```bash
➜ git remote add upstream https://github.com/MaxKeyTop/MaxKey
➜ git remote
origin
upstream
```
获取 upstream 的最新代码并更新当前分支。
```bash
➜ git fetch upstream
➜ git pull upstream develop
```
## Push 到远程仓库
将本地的修改推送到 GitHub 上,也就是 https://github.com/USERNAME/MaxKey。
```bash
# 推送到远程仓库 origin 的 my-cool-stuff 分支上
➜ git push origin my-cool-stuff
```
## 建立 Issue 并完成 Pull Request
建立一个 Issue 描述问题,并记录它的编号。
切换到所建分支,然后点击 `New pull request`
在 PR 的描述说明中,填写 `resolve #Issue编号` 可以在这个 PR 被 merge 后,自动关闭对应的 Issue
> 具体请见 <https://help.github.com/articles/closing-issues-via-commit-messages/>
## review
## 删除远程分支
在 PR 被 merge 进主仓库后,我们可以在 PR 的页面删除远程仓库的分支。
也可以使用 `git push origin :分支名` 删除远程分支,如:
```bash
➜ git push origin :my-cool-stuff
```
## 删除本地分支
最后,删除本地分支。
```bash
# 切换到 develop 分支
➜ git checkout develop
# 删除 my-cool-stuff 分支
➜ git branch -D my-cool-stuff
```
至此,我们就完成了一次代码贡献的过程。
## 提交代码的一些约定
为了使评审人在评审代码时更好地专注于代码本身,请您每次提交代码时,遵守以下约定:
1. 请保证单元测试能顺利通过。如果没过,说明提交的代码存在问题,评审人一般不做评审。
2. 提交Pull Request前
- 请注意commit的数量
- 原因如果仅仅修改一个文件但提交了十几个commit每个commit只做了少量的修改这会给评审人带来很大困扰。评审人需要逐一查看每个commit才能知道做了哪些修改且不排除commit之间的修改存在相互覆盖的情况。
- 建议每次提交时保持尽量少的commit可以通过`git commit --amend`补充上次的commit。对已经Push到远程仓库的多个commit可以参考[squash commits after push](http://stackoverflow.com/questions/5667884/how-to-squash-commits-in-git-after-they-have-been-pushed)。
- 请注意每个commit的名称应能反映当前commit的内容不能太随意。
3. 如果解决了某个Issue的问题请在该Pull Request的**第一个**评论框中加上:`fix #issue_number`这样当该Pull Request被合并后会自动关闭对应的Issue。关键词包括close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved请选择合适的词汇。详细可参考[Closing issues via commit messages](https://help.github.com/articles/closing-issues-via-commit-messages)。
此外,在回复评审人意见时,请您遵守以下约定:
1. 评审人的每个意见都必须回复(这是开源社区的基本礼貌,别人帮了忙,应该说谢谢):
- 对评审意见同意且按其修改完的,给个简单的`Done`即可;
- 对评审意见不同意的,请给出您自己的反驳理由。
2. 如果评审意见比较多:
- 请给出总体的修改情况。
- 请采用[start a review](https://help.github.com/articles/reviewing-proposed-changes-in-a-pull-request/)进行回复,而非直接回复的方式。原因是每个回复都会发送一封邮件,会造成邮件灾难。

@ -0,0 +1,297 @@
<p align="center" >
<img src="images/logo_maxkey.png?raw=true" width="200px" alt=""/>
</p>
<p align="center">
<strong>Leading-Edge IAM/IDaas Identity and Access Management Product</strong>
</p>
<p align="center" >
<a href="README_en.md" target="_blank"><b>English</b></a> | <a href="README_zh.md" target="_blank"><b>中文</b></a>
</p>
<p align="center">
<a target="_blank" href="http://www.maxkey.top/zh/about/download.html">
<img src="https://img.shields.io/github/v/release/dromara/MaxKey" />
</a>
<a target="_blank" href="https://www.oracle.com/java/technologies/downloads/">
<img src="https://img.shields.io/badge/JDK-v17%2B-brightgreen" />
</a>
<a target="_blank" href="https://www.mysql.com/">
<img src="https://img.shields.io/badge/MySQL-8.0.12%2B-brightgreen" />
</a>
<a target="_blank" href="http://www.maxkey.top/zh/about/licenses.html">
<img src="https://img.shields.io/github/license/dromara/MaxKey" />
</a>
</p>
# Overview
<b>Maxkey </b> Single Sign On System, which means the Maximum key, <b>Leading-Edge IAM/IDaas Identity and Access Management product </b>, Support OAuth 2.x/OpenID Connect, SAML 2.0, JWT, CAS, SCIM and other standard protocols, and provide <b> Secure, Standard and Open </b> Identity management (IDM), Access management (AM), Single Sign On (SSO), RBAC permission management and Resource management.
MaxKey focuses on performance, security, and ease of use in enterprise scenarios, is widely used in industries such as healthcare, finance, government, and manufacturing.
Official Website <a href="http://www.maxkey.top/" target="_blank"><b>http://www.maxkey.top/</b></a>
WeChat:
<img src="images/wechat.jpg?raw=true" width="200px" alt="官方微信"/>
QQ : <b> 1054466084 </b>
email: <b> support@maxsso.net </b>
Code Hosting <a href="https://github.com/dromara/MaxKey" target="_blank"><b>GitHub</b></a> | <a href="https://gitee.com/dromara/MaxKey" target="_blank"><b>Gitee</b></a>
><b> Single Sign On </b>(<b> SSO </b >),Users only need to login to the authentication center once , access all the trusted application systems without logging in again.
>
>**Key Functions**
>1) All application systems share one Identity authentication system
>2) All application systems can Identify and extract Ticket
# Features
1. Standard Protocols
| No. | Protocols | Support |
| --------| :----- | :---- |
| 1.1 | OAuth 2.x/OpenID Connect | HIGH |
| 1.2 | SAML 2.0 | HIGH |
| 1.3 | JWT | HIGH |
| 1.4 | CAS | HIGH |
| 1.5 | SCIM 2.0 | HIGH |
| 1.6 | FormBased | MIDDLE|
| 1.7 | TokenBased(Post/Cookie) | MIDDLE|
| 1.8 | ExtendApi | LOW |
| 1.9 | EXT | LOW |
2. Authentication
| No. | SignIn Support | Support |
| --------| :----- | :---- |
| 2.1 | Captcha | letter / number / arithmetic |
| 2.2 | Two Factor Authentication | SMS / TOPT/ Mail |
| 2.3 | SMS | Tencent SMS / Alibaba SMS / NetEaseYunXin |
| 2.4 | TOTP | Google/Microsoft Authenticator/FreeOTP/Support TOTP or HOTP |
| 2.5 | Domain | Kerberos/SPNEGO/AD domain|
| 2.6 | LDAP | OpenLDAP/ActiveDirectory/Standard LDAP Server |
| 2.7 | Social Account | WeChat/QQ/ Weibo/DingTalk/Google/Facebook/other |
| 2.8 | Scan QR Code | WorkWeiXin/DingTalk/FeiShu Scan QR Code |
3. Standard Authentication Protocols for applications to integrate sso, secure mobile access, secure API, third-party authentication and Internet authentication.
4. Identity Lifecycle management, support SCIM 2 , and The out of the box connector realizes identity supply synchronization.
5. Simplify Microsoft Active Directory , standard LDAP server organization and account management, and reset password through password self-service.
6. The IDaas Multi-Tenancy authentication platform , supports the independent management of multiple enterprises under the group company or the data isolation of different departments under the enterprise, so as to reduce the operation and maintenance cost.
7. The platform independence and diversity of environment. It supports web, mobile phone, mobile devices, such as apple IOS, Android, etc., and covers the certification ability from B/S to mobile applications.
8. Configured password and access policies; Supports precise IP positioning in Ip2region or GeoLite2 geographic databases, powerful security auditing, full lifecycle audit of users, traceability audit of access behavior records, security compliance audit, and security risk warning.
9. Based on Java EE platform , microservice architecture, Use Spring, MySQL, Tomcat, Redis , MQ and other open source technologies, and has strong scalability.
10. Open Source, Secure, Independent and Controllable .
# Interface
**MaxKey**
Login UI
<img src="images/maxkey_login.png?raw=true"/>
App List UI
<img src="images/maxkey_index.png?raw=true"/>
**MaxKey Management**
Report UI
<img src="images/maxkey_mgt_rpt.png?raw=true"/>
User Management UI
<img src="images/maxkey_mgt_users.png?raw=true"/>
App Management UI
<img src="images/maxkey_mgt_apps.png?raw=true"/>
# Download
Download the current version from Baidu Pan,<a href="http://www.maxkey.top/zh/about/download.html" target="_blank"> history version</a>
| Version | Date | Pan URL (Code) | Docker |
| -------- | :----- | :---- | :---- |
| v 4.0.2 | 2023/10/11 | <a href="https://pan.baidu.com/s/1XFavsQ19fFw-KXe2K1rAEA" target="_blank">Download</a> ( **mxk9** ) | <a href="https://hub.docker.com/u/maxkeytop" target="_blank">Home</a> |
# Install
| OS | Manual |
| -------- | :----- |
| Windows | <a href="http://maxkey.top/zh/conf/tutorial.html?#windows" target="_blank">Document</a> |
| Linux | <a href="http://maxkey.top/zh/conf/tutorial.html?#linux" target="_blank">Document</a> |
| Docker | <a href="http://maxkey.top/zh/conf/deploy_docker.html" target="_blank">Document</a> |
# License
<a href="https://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"> Apache License, Version 2.0 </a>& <a href="http://www.maxkey.top/zh/about/licenses.html" target="_blank">MaxKey copyright NOTICE</a>
# 中国信通院零信任实验室
<a href="https://mp.weixin.qq.com/s/2T9TCo3EP0o9bD8ArAjUkw" target="_blank">中国信通院零信任实验室</a>
# 零信任标准工作组
<a href="https://gitee.com/zero-trust/ZeroTrust" target="_blank">国内最权威的零信任产业组织</a>
# Gitee最有价值开源项目GVP
<a href="http://maxkey.top/zh/about/welcome.html" target="_blank">Gitee-最有价值开源项目GVP</a>
# Dromara社区
<a href="https://dromara.org/zh/" target="_blank">**Dromara**</a>致力于微服务云原生解决方案的组织。
- **开放** 技术栈全面开源共建、 保持社区中立、兼容社区 兼容开源生态
- **愿景** 让每一位开源爱好者,体会到开源的快乐
- **口号** 为往圣继绝学,一个人或许能走的更快,但一群人会走的更远
# 知识星球
<img src="images/zsxq.png?raw=true"/>
# User Registration
<a href="https://github.com/dromara/MaxKey/issues/40" target="_blank"> Click to register </a> as MaxKey user and contribute to MaxKey!
以下为部分接入或测试中的用户
| 单位 |
| :----- |
| 中国人民警察大学 |
| 兰州现代职业学院 |
| 长春职业技术学院 |
| 云南师范大学 |
| 云南农业职业技术学院 |
| 惠州卫生职业技术学院 |
| 宜昌市三峡中等专业学校 |
| 重庆市北碚图书馆 |
| 天津市劳动保障技师学院 |
| 南京财经高等职业技术学校 |
| 泸州市教育和体育局 |
| 余姚市教育局 |
| 中国金融认证中心 |
| 国家高端智能化家用电器创新中心 |
| 国元证券 |
| 华夏金融租赁有限公司 |
| 国宝人寿保险股份有限公司 |
| 瀚华金控股份有限公司 |
| 紫金财产保险股份有限公司 |
| 路特斯中国 |
| 奇瑞汽车股份有限公司 |
| 宇通客车股份有限公司 |
| 国家能源局 |
| 国务院港澳事务办公室 |
| 百度智能云身份管理服务 |
| 360公司 |
| 三一华兴 |
| 西藏阜康医院 |
| 海阳市人民医院 |
| 上海逸广信息科技有限公司 |
| 联鹏应用软件(上海)有限公司 |
| 上海万序健康科技有限公司 |
| 上海中商网络股份有限公司 |
| 上海半天妖餐饮管理有限公司 |
| 上海契胜科技有限公司 |
| GAP盖璞上海商业有限公司 |
| 汤臣倍健股份有限公司 |
| 跳羚科技(厦门)有限公司 |
| 飞天诚信科技股份有限公司 |
| 浪潮工业互联网股份有限公司 |
| 唐颐控股有限公司 |
| 中创智维科技有限公司 |
| 中航金网(北京)电子商务有限公司 |
| 中国航空制造技术研究院 |
| 中建国际投资集团有限公司 |
| 同方节能工程技术有限公司 |
| 云南航天工程物探检测股份有限公司 |
| 山东港口陆海国际物流集团有限公司 |
| 山东埃德森石油工程技术有限公司 |
| 山东第一医科大学第一附属医院 |
| 广州无线电集团 |
| 广州携旅信息科技有限公司 |
| 广州蓝深科技有限公司 |
| 广州广汽商贸物流有限公司 |
| 广州思迈特软件有限公司 |
| 广东鸿正软件技术有限公司 |
| 广东汇天航空航天科技有限公司 |
| 佛山众陶联供应链服务有限公司 |
| 河南新辰环保科技有限公司 |
| 黄河科技集团有限公司 |
| 豫信电子科技集团有限公司 |
| 双汇物流投资有限公司 |
| 广东漫云物联科技有限公司 |
| 深圳市金溢科技股份有限公司 |
| 深圳市中悦科技有限公司 |
| 深圳能源集团股份有限公司 |
| 深圳市东阳光实业发展有限公司 |
| 深圳云天励飞技术股份有限公司 |
| 深圳市维玛科技有限公司 |
| 深圳市观塘银河电讯科技有限公司 |
| 北京博亚思科技有限公司 |
| 北京银泰置业有限公司 |
| 北京和融通支付科技有限公司 |
| 北京微通新成网络科技有限公司 |
| 北京柏橡科技有限公司 |
| 浙江领湾网络有限公司 |
| 浙江申跃信息科技有限公司 |
| 浙江一舟电子科技股份有限公司 |
| 杭州润为数据科技有限公司 |
| 杭州马上自动化科技有限公司 |
| 景德镇黑猫集团有限责任公司 |
| 之江实验室 |
| 丽水市中医医院 |
| 宁波金融资产交易中心 |
| 德清智慧教育平台 |
| 江苏创致信息科技有限公司 |
| 无锡市陶都巨龙软件有限责任公司 |
| TCL华星光电技术有限公司 |
| 万宝盛华集团 |
| 妙盈科技 |
| 尚企云链 |
| 华奕四库 |
| 海力控股集团 |
| 中国融通教育集团 |
| 新疆天衡信息系统咨询管理有限公司 |
| 新开普电子股份有限公司 |
| 广西数字浪潮数据服务有限公司 |
| 百安居中国 |
| 重庆两江协同创新区 |
| 万宝盛华大中华有限公司 |
| 哈尔滨途图科技有限公司 |
| 哈尔滨逐浪文化传媒有限公司 |
| 大连电瓷集团股份有限公司 |
| 锦州港股份有限公司 |
| 湖南数通信息技术服务有限公司 |
| 湖南湘邮科技股份有限公司 |
| 湖南省公共资源交易平台市场主体注册系统 |
| 湘潭智慧教育云统一认证平台 |
| 南京市智慧医疗投资运营服务有限公司 |
| 南凌科技股份有限公司 |
| 福建引迈信息技术有限公司 |
| 漳州信息产业集团有限公司 |
| 厦门茂商科技有限公司 |
| 惠州中京电子科技股份有限公司 |
| 武汉英特沃科技有限公司 |
| 武汉博特睿达智能科技有限公司 |
| 江西云车科技有限公司 |
| 天津汉通教育科技有限公司 |
| 天津市达恩华天智能科技有限公司 |
| 企思(天津)科技有限公司 |
| 凯盛工业互联网平台 |
| 吕梁市医改监测平台 |
| 遂宁市经济大数据平台 |
| 临沂市城市大脑物联网统一认证平台 |

@ -0,0 +1,296 @@
<p align="center" >
<img src="images/logo_maxkey.png?raw=true" width="200px" alt=""/>
</p>
<p align="center">
<strong>Leading-Edge IAM/IDaas Identity and Access Management Product</strong>
</p>
<p align="center" >
<a href="README_en.md" target="_blank"><b>English</b></a> | <a href="README_zh.md" target="_blank"><b>中文</b></a>
</p>
<p align="center">
<a target="_blank" href="http://www.maxkey.top/zh/about/download.html">
<img src="https://img.shields.io/github/v/release/dromara/MaxKey" />
</a>
<a target="_blank" href="https://www.oracle.com/java/technologies/downloads/">
<img src="https://img.shields.io/badge/JDK-v17%2B-brightgreen" />
</a>
<a target="_blank" href="https://www.mysql.com/">
<img src="https://img.shields.io/badge/MySQL-8.0.12%2B-brightgreen" />
</a>
<a target="_blank" href="http://www.maxkey.top/zh/about/licenses.html">
<img src="https://img.shields.io/github/license/dromara/MaxKey" />
</a>
</p>
# Overview
<b>Maxkey </b> Single Sign On System, which means the Maximum key, <b>Leading-Edge IAM/IDaas Identity and Access Management Product </b>, Support OAuth 2.x/OpenID Connect, SAML 2.0, JWT, CAS, SCIM and other standard protocols, and provide <b> Secure , Standard and Open </b> Identity management (IDM), Access management (AM), Single Sign On (SSO), RBAC permission management and Resource management.
MaxKey focuses on performance, security, and ease of use in enterprise scenarios, is widely used in industries such as healthcare, finance, government, and manufacturing.
Official Website <a href="http://www.maxkey.top/" target="_blank"><b>http://www.maxkey.top/</b></a>
WeChat:
<img src="images/wechat.jpg?raw=true" width="200px" alt="官方微信"/>
QQ: <b> 1054466084 </b>
email: <b> support@maxsso.net </b>
Code Hosting <a href="https://github.com/dromara/MaxKey" target="_blank"><b>GitHub</b></a> | <a href="https://gitee.com/dromara/MaxKey" target="_blank"><b>Gitee</b></a>
><b> Single Sign On </b>(<b> SSO </b >),Users only need to login to the authentication center once , access all the trusted application systems without logging in again.
>
>**Key Functions**
>1) All application systems share one Identity authentication system
>2) All application systems can Identify and extract Ticket
# Features
1. Standard Protocols
| No. | Protocols | Support |
| --------| :----- | :---- |
| 1.1 | OAuth 2.x/OpenID Connect | HIGH |
| 1.2 | SAML 2.0 | HIGH |
| 1.3 | JWT | HIGH |
| 1.4 | CAS | HIGH |
| 1.5 | SCIM 2.0 | HIGH |
| 1.6 | FormBased | MIDDLE|
| 1.7 | TokenBased(Post/Cookie) | MIDDLE|
| 1.8 | ExtendApi | LOW |
| 1.9 | EXT | LOW |
2. Authentication
| No. | SignIn Support | Support |
| --------| :----- | :---- |
| 2.1 | Captcha | letter / number / arithmetic |
| 2.2 | Two Factor Authentication | SMS / TOPT/ Mail |
| 2.3 | SMS | Tencent SMS / Alibaba SMS / NetEaseYunXin |
| 2.4 | TOTP | Google/Microsoft Authenticator/FreeOTP/Support TOTP or HOTP |
| 2.5 | Domain | Kerberos/SPNEGO/AD domain|
| 2.6 | LDAP | OpenLDAP/ActiveDirectory/Standard LDAP Server |
| 2.7 | Social Account | WeChat/QQ/ Weibo/DingTalk/Google/Facebook/other |
| 2.8 | Scan QR Code | WorkWeiXin/DingTalk/FeiShu Scan QR Code |
3. Standard Authentication Protocols for applications to integrate sso, secure mobile access, secure API, third-party authentication and Internet authentication.
4. Identity Lifecycle management, support SCIM 2 , and The out of the box connector realizes identity supply synchronization.
5. Simplify Microsoft Active Directory , standard LDAP server organization and account management, and reset password through password self-service.
6. The IDaas Multi-Tenancy authentication platform , supports the independent management of multiple enterprises under the group company or the data isolation of different departments under the enterprise, so as to reduce the operation and maintenance cost.
7. The platform independence and diversity of environment. It supports web, mobile phone, mobile devices, such as apple IOS, Android, etc., and covers the certification ability from B/S to mobile applications.
8. Configured password and access policies; Supports precise IP positioning in Ip2region or GeoLite2 geographic databases, powerful security auditing, full lifecycle audit of users, traceability audit of access behavior records, security compliance audit, and security risk warning.
9. Based on Java EE platform , microservice architecture, Use Spring, MySQL, Tomcat, Redis , MQ and other open source technologies, and has strong scalability.
10. Open Source, Secure, Independent and Controllable .
# Interface
**MaxKey**
Login UI
<img src="images/maxkey_login.png?raw=true"/>
App List UI
<img src="images/maxkey_index.png?raw=true"/>
**MaxKey Management**
Report UI
<img src="images/maxkey_mgt_rpt.png?raw=true"/>
User Management UI
<img src="images/maxkey_mgt_users.png?raw=true"/>
App Management UI
<img src="images/maxkey_mgt_apps.png?raw=true"/>
# Download
Download the current version from Baidu Pan,<a href="http://www.maxkey.top/zh/about/download.html" target="_blank"> history version</a>
| Version | Date | Pan URL (Code) | Docker |
| -------- | :----- | :---- | :---- |
| v 4.0.2 | 2023/10/11 | <a href="https://pan.baidu.com/s/1XFavsQ19fFw-KXe2K1rAEA" target="_blank">Download</a> ( **mxk9** ) | <a href="https://hub.docker.com/u/maxkeytop" target="_blank">Home</a> |
# Install
| OS | Manual |
| -------- | :----- |
| Windows | <a href="http://maxkey.top/zh/conf/tutorial.html?#windows" target="_blank">Document</a> |
| Linux | <a href="http://maxkey.top/zh/conf/tutorial.html?#linux" target="_blank">Document</a> |
| Docker | <a href="http://maxkey.top/zh/conf/deploy_docker.html" target="_blank">Document</a> |
# License
<a href="https://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"> Apache License, Version 2.0 </a>& <a href="http://www.maxkey.top/zh/about/licenses.html" target="_blank">MaxKey copyright NOTICE</a>
# 中国信通院零信任实验室
<a href="https://mp.weixin.qq.com/s/2T9TCo3EP0o9bD8ArAjUkw" target="_blank">中国信通院零信任实验室</a>
# 零信任标准工作组
<a href="https://gitee.com/zero-trust/ZeroTrust" target="_blank">国内最权威的零信任产业组织</a>
# Gitee最有价值开源项目GVP
<a href="http://maxkey.top/zh/about/welcome.html" target="_blank">Gitee-最有价值开源项目GVP</a>
# Dromara社区
<a href="https://dromara.org/zh/" target="_blank">**Dromara**</a>致力于微服务云原生解决方案的组织。
- **开放** 技术栈全面开源共建、 保持社区中立、兼容社区 兼容开源生态
- **愿景** 让每一位开源爱好者,体会到开源的快乐
- **口号** 为往圣继绝学,一个人或许能走的更快,但一群人会走的更远
# 知识星球
<img src="images/zsxq.png?raw=true"/>
# User Registration
<a href="https://github.com/dromara/MaxKey/issues/40" target="_blank"> Click to register </a> as MaxKey user and contribute to MaxKey!
以下为部分接入或测试中的用户
| 单位 |
| :----- |
| 中国人民警察大学 |
| 兰州现代职业学院 |
| 长春职业技术学院 |
| 云南师范大学 |
| 云南农业职业技术学院 |
| 惠州卫生职业技术学院 |
| 宜昌市三峡中等专业学校 |
| 重庆市北碚图书馆 |
| 天津市劳动保障技师学院 |
| 南京财经高等职业技术学校 |
| 泸州市教育和体育局 |
| 余姚市教育局 |
| 中国金融认证中心 |
| 国家高端智能化家用电器创新中心 |
| 国元证券 |
| 华夏金融租赁有限公司 |
| 国宝人寿保险股份有限公司 |
| 瀚华金控股份有限公司 |
| 紫金财产保险股份有限公司 |
| 路特斯中国 |
| 奇瑞汽车股份有限公司 |
| 宇通客车股份有限公司 |
| 国家能源局 |
| 国务院港澳事务办公室 |
| 百度智能云身份管理服务 |
| 360公司 |
| 三一华兴 |
| 西藏阜康医院 |
| 海阳市人民医院 |
| 上海逸广信息科技有限公司 |
| 联鹏应用软件(上海)有限公司 |
| 上海万序健康科技有限公司 |
| 上海中商网络股份有限公司 |
| 上海半天妖餐饮管理有限公司 |
| 上海契胜科技有限公司 |
| GAP盖璞上海商业有限公司 |
| 汤臣倍健股份有限公司 |
| 跳羚科技(厦门)有限公司 |
| 飞天诚信科技股份有限公司 |
| 浪潮工业互联网股份有限公司 |
| 唐颐控股有限公司 |
| 中创智维科技有限公司 |
| 中航金网(北京)电子商务有限公司 |
| 中国航空制造技术研究院 |
| 中建国际投资集团有限公司 |
| 同方节能工程技术有限公司 |
| 云南航天工程物探检测股份有限公司 |
| 山东港口陆海国际物流集团有限公司 |
| 山东埃德森石油工程技术有限公司 |
| 山东第一医科大学第一附属医院 |
| 广州无线电集团 |
| 广州携旅信息科技有限公司 |
| 广州蓝深科技有限公司 |
| 广州广汽商贸物流有限公司 |
| 广州思迈特软件有限公司 |
| 广东鸿正软件技术有限公司 |
| 广东汇天航空航天科技有限公司 |
| 佛山众陶联供应链服务有限公司 |
| 河南新辰环保科技有限公司 |
| 黄河科技集团有限公司 |
| 豫信电子科技集团有限公司 |
| 双汇物流投资有限公司 |
| 广东漫云物联科技有限公司 |
| 深圳市金溢科技股份有限公司 |
| 深圳市中悦科技有限公司 |
| 深圳能源集团股份有限公司 |
| 深圳市东阳光实业发展有限公司 |
| 深圳云天励飞技术股份有限公司 |
| 深圳市维玛科技有限公司 |
| 深圳市观塘银河电讯科技有限公司 |
| 北京博亚思科技有限公司 |
| 北京银泰置业有限公司 |
| 北京和融通支付科技有限公司 |
| 北京微通新成网络科技有限公司 |
| 北京柏橡科技有限公司 |
| 浙江领湾网络有限公司 |
| 浙江申跃信息科技有限公司 |
| 浙江一舟电子科技股份有限公司 |
| 杭州润为数据科技有限公司 |
| 杭州马上自动化科技有限公司 |
| 景德镇黑猫集团有限责任公司 |
| 之江实验室 |
| 丽水市中医医院 |
| 宁波金融资产交易中心 |
| 德清智慧教育平台 |
| 江苏创致信息科技有限公司 |
| 无锡市陶都巨龙软件有限责任公司 |
| TCL华星光电技术有限公司 |
| 万宝盛华集团 |
| 妙盈科技 |
| 尚企云链 |
| 华奕四库 |
| 海力控股集团 |
| 中国融通教育集团 |
| 新疆天衡信息系统咨询管理有限公司 |
| 新开普电子股份有限公司 |
| 广西数字浪潮数据服务有限公司 |
| 百安居中国 |
| 重庆两江协同创新区 |
| 万宝盛华大中华有限公司 |
| 哈尔滨途图科技有限公司 |
| 哈尔滨逐浪文化传媒有限公司 |
| 大连电瓷集团股份有限公司 |
| 锦州港股份有限公司 |
| 湖南数通信息技术服务有限公司 |
| 湖南湘邮科技股份有限公司 |
| 湖南省公共资源交易平台市场主体注册系统 |
| 湘潭智慧教育云统一认证平台 |
| 南京市智慧医疗投资运营服务有限公司 |
| 南凌科技股份有限公司 |
| 福建引迈信息技术有限公司 |
| 漳州信息产业集团有限公司 |
| 厦门茂商科技有限公司 |
| 惠州中京电子科技股份有限公司 |
| 武汉英特沃科技有限公司 |
| 武汉博特睿达智能科技有限公司 |
| 江西云车科技有限公司 |
| 天津汉通教育科技有限公司 |
| 天津市达恩华天智能科技有限公司 |
| 企思(天津)科技有限公司 |
| 凯盛工业互联网平台 |
| 吕梁市医改监测平台 |
| 遂宁市经济大数据平台 |
| 临沂市城市大脑物联网统一认证平台 |

@ -0,0 +1,300 @@
<p align="center" >
<img src="images/logo_maxkey.png?raw=true" width="200px" alt=""/>
</p>
<p align="center">
<strong>业界领先的IAM-IDaas身份管理和认证产品</strong>
</p>
<p align="center" >
<a href="README_en.md" target="_blank"><b>English</b></a> | <a href="README_zh.md" target="_blank"><b>中文</b></a>
</p>
<p align="center">
<a target="_blank" href="http://www.maxkey.top/zh/about/download.html">
<img src="https://img.shields.io/github/v/release/dromara/MaxKey" />
</a>
<a target="_blank" href="https://www.oracle.com/java/technologies/downloads/">
<img src="https://img.shields.io/badge/JDK-v17%2B-brightgreen" />
</a>
<a target="_blank" href="https://www.mysql.com/">
<img src="https://img.shields.io/badge/MySQL-8.0.12%2B-brightgreen" />
</a>
<a target="_blank" href="http://www.maxkey.top/zh/about/licenses.html">
<img src="https://img.shields.io/github/license/dromara/MaxKey" />
</a>
</p>
# 概述
<b>MaxKey</b>单点登录认证系统,谐音马克思的钥匙寓意是最大钥匙,是<b>业界领先的IAM-IDaas身份管理和认证产品</b>,支持OAuth 2.x/OpenID Connect、SAML 2.0、JWT、CAS、SCIM等标准协议提供<b>安全、标准和开放</b>的用户身份管理(IDM)、身份认证(AM)、单点登录(SSO)、RBAC权限管理和资源管理等。
MaxKey注重企业级场景下的性能、安全和易用性广泛应用于医疗、金融、政府和制造等行业。
官方网站 <a href="http://www.maxkey.top/" target="_blank"><b>http://www.maxkey.top/</b></a>
官方微信:
<img src="images/wechat.jpg?raw=true" width="200px" alt="官方微信"/>
官方QQ<b>1054466084</b>
邮箱email: <b>support@maxsso.net</b>
代码托管 <a href="https://gitee.com/dromara/MaxKey" target="_blank"><b>Gitee</b></a> | <a href="https://github.com/dromara/MaxKey" target="_blank"><b>GitHub</b></a>
><b>单点登录(Single Sign On</b>简称为<b>SSO</b>,用户只需要登录认证中心一次就可以访问所有相互信任的应用系统,无需再次登录。
>
>**主要功能:**
>1) 所有应用系统共享一个身份认证系统
>2) 所有应用系统能够识别和提取ticket信息
# 产品特性
1. 标准协议
| 序号 | 协议 | 支持 |
| --------| :----- | :---- |
| 1.1 | OAuth 2.x/OpenID Connect | 高 |
| 1.2 | SAML 2.0 | 高 |
| 1.3 | JWT | 高 |
| 1.4 | CAS | 高 |
| 1.5 | SCIM 2.0 | 高 |
| 1.6 | FormBased | 中 |
| 1.7 | TokenBased(Post/Cookie) | 中 |
| 1.8 | ExtendApi | 低 |
| 1.9 | EXT | 低 |
2. 登录支持
| 序号 | 登录方式 | 支持 |
| --------| :----- | :---- |
| 2.1 | 动态验证码 | 字母/数字/算术 |
| 2.2 | 双因素认证 | 短信/时间令牌/邮件 |
| 2.3 | 短信认证 | 腾讯云短信/阿里云短信/网易云信 |
| 2.4 | 时间令牌 | Google/Microsoft Authenticator/FreeOTP/支持TOTP或者HOTP |
| 2.5 | 域认证 | Kerberos/SPNEGO/AD域 |
| 2.6 | LDAP | OpenLDAP/ActiveDirectory/标准LDAP服务器 |
| 2.7 | 社交账号 | 微信/QQ/微博/钉钉/Google/Facebook/其他 |
| 2.8 | 扫码登录 | 企业微信/钉钉/飞书扫码登录 |
3. 提供标准的认证接口以便于其他应用集成SSO安全的移动接入安全的API、第三方认证和互联网认证的整合。
4. 提供用户生命周期管理支持SCIM 2协议开箱即用的连接器(Connector)实现身份供给同步。
5. 简化微软Active Directory域控、标准LDAP服务器机构和账号管理密码自助服务重置密码。
6. IDaas多租户功能支持集团下多企业独立管理或企业下不同部门数据隔离的降低运维成本。
7. 认证中心具有平台无关性、环境多样性支持Web、手机、移动设备等, 如Apple iOSAndriod等将认证能力从B/S到移动应用全面覆盖。
8. 配置化的密码策略、访问策略支持Ip2region或GeoLite2地理库精准IP定位 ,强大安全审计,对用户全生命周期审计、访问行为记录追溯审计、安全合规审计、安全风险预警。
9. 基于Java EE平台微服务架构采用Spring、MySQL、Tomcat、Redis、MQ等开源技术扩展性强。
10. 开源、安全、自主可控。
# 界面
**MaxKey认证**
登录界面
<img src="images/maxkey_login.png?raw=true"/>
主界面
<img src="images/maxkey_index.png?raw=true"/>
**MaxKey管理**
访问报表
<img src="images/maxkey_mgt_rpt.png?raw=true"/>
用户管理
<img src="images/maxkey_mgt_users.png?raw=true"/>
应用管理
<img src="images/maxkey_mgt_apps.png?raw=true"/>
# 下载
当前版本百度网盘下载,<a href="http://www.//maxkey.top/zh/about/download.html" target="_blank"> 历史版本</a>
| 版本 | 日期 | 网盘(提取码) | Docker |
| -------- | :----- | :---- | :---- |
| v 4.0.2 | 2023/10/11 | <a href="https://pan.baidu.com/s/1XFavsQ19fFw-KXe2K1rAEA" target="_blank">下载</a>( **mxk9** ) |<a href="https://hub.docker.com/u/maxkeytop" target="_blank">链接</a> |
# 安装部署
| 操作系统 | 安装手册 |
| -------- | :----- |
| Windows | <a href="http://maxkey.top/zh/conf/tutorial.html?#windows" target="_blank">链接</a> |
| Linux | <a href="http://maxkey.top/zh/conf/tutorial.html?#linux" target="_blank">链接</a> |
| Docker | <a href="http://maxkey.top/zh/conf/deploy_docker.html" target="_blank">链接</a> |
# License
<a href="https://www.apache.org/licenses/LICENSE-2.0.html" target="_blank"> Apache License, Version 2.0 </a>& <a href="http://www.maxkey.top/zh/about/licenses.html" target="_blank">MaxKey版权声明</a>
# 中国信通院零信任实验室
<a href="https://mp.weixin.qq.com/s/2T9TCo3EP0o9bD8ArAjUkw" target="_blank">中国信通院零信任实验室</a>
# 零信任标准工作组
<a href="https://gitee.com/zero-trust/ZeroTrust" target="_blank">国内最权威的零信任产业组织</a>
# Gitee最有价值开源项目GVP
<a href="http://maxkey.top/zh/about/welcome.html" target="_blank">Gitee-最有价值开源项目GVP</a>
# Dromara社区
<a href="https://dromara.org/zh/" target="_blank">**Dromara**</a>致力于微服务云原生解决方案的组织。
- **开放** 技术栈全面开源共建、 保持社区中立、兼容社区 兼容开源生态
- **愿景** 让每一位开源爱好者,体会到开源的快乐
- **口号** 为往圣继绝学,一个人或许能走的更快,但一群人会走的更远
# 知识星球
<img src="images/zsxq.png?raw=true"/>
# 接入登记
<a href="https://gitee.com/dromara/MaxKey/issues/I2BNRZ" target="_blank"> 点击进行接入登记</a>,为 MaxKey的发展贡献自己的力量
以下为部分接入或测试中的用户
| 单位 |
| :----- |
| 中国人民警察大学 |
| 兰州现代职业学院 |
| 长春职业技术学院 |
| 云南师范大学 |
| 云南农业职业技术学院 |
| 惠州卫生职业技术学院 |
| 宜昌市三峡中等专业学校 |
| 重庆市北碚图书馆 |
| 天津市劳动保障技师学院 |
| 南京财经高等职业技术学校 |
| 泸州市教育和体育局 |
| 余姚市教育局 |
| 中国金融认证中心 |
| 国家高端智能化家用电器创新中心 |
| 国元证券 |
| 华夏金融租赁有限公司 |
| 国宝人寿保险股份有限公司 |
| 瀚华金控股份有限公司 |
| 紫金财产保险股份有限公司 |
| 路特斯中国 |
| 奇瑞汽车股份有限公司 |
| 宇通客车股份有限公司 |
| 国家能源局 |
| 国务院港澳事务办公室 |
| 百度智能云身份管理服务 |
| 360公司 |
| 三一华兴 |
| 西藏阜康医院 |
| 海阳市人民医院 |
| 上海逸广信息科技有限公司 |
| 联鹏应用软件(上海)有限公司 |
| 上海万序健康科技有限公司 |
| 上海中商网络股份有限公司 |
| 上海半天妖餐饮管理有限公司 |
| 上海契胜科技有限公司 |
| GAP盖璞上海商业有限公司 |
| 汤臣倍健股份有限公司 |
| 跳羚科技(厦门)有限公司 |
| 飞天诚信科技股份有限公司 |
| 浪潮工业互联网股份有限公司 |
| 唐颐控股有限公司 |
| 中创智维科技有限公司 |
| 中航金网(北京)电子商务有限公司 |
| 中国航空制造技术研究院 |
| 中建国际投资集团有限公司 |
| 同方节能工程技术有限公司 |
| 云南航天工程物探检测股份有限公司 |
| 山东港口陆海国际物流集团有限公司 |
| 山东埃德森石油工程技术有限公司 |
| 山东第一医科大学第一附属医院 |
| 广州无线电集团 |
| 广州携旅信息科技有限公司 |
| 广州蓝深科技有限公司 |
| 广州广汽商贸物流有限公司 |
| 广州思迈特软件有限公司 |
| 广东鸿正软件技术有限公司 |
| 广东汇天航空航天科技有限公司 |
| 佛山众陶联供应链服务有限公司 |
| 河南新辰环保科技有限公司 |
| 黄河科技集团有限公司 |
| 豫信电子科技集团有限公司 |
| 双汇物流投资有限公司 |
| 广东漫云物联科技有限公司 |
| 深圳市金溢科技股份有限公司 |
| 深圳市中悦科技有限公司 |
| 深圳能源集团股份有限公司 |
| 深圳市东阳光实业发展有限公司 |
| 深圳云天励飞技术股份有限公司 |
| 深圳市维玛科技有限公司 |
| 深圳市观塘银河电讯科技有限公司 |
| 北京博亚思科技有限公司 |
| 北京银泰置业有限公司 |
| 北京和融通支付科技有限公司 |
| 北京微通新成网络科技有限公司 |
| 北京柏橡科技有限公司 |
| 浙江领湾网络有限公司 |
| 浙江申跃信息科技有限公司 |
| 浙江一舟电子科技股份有限公司 |
| 杭州润为数据科技有限公司 |
| 杭州马上自动化科技有限公司 |
| 景德镇黑猫集团有限责任公司 |
| 之江实验室 |
| 丽水市中医医院 |
| 宁波金融资产交易中心 |
| 德清智慧教育平台 |
| 江苏创致信息科技有限公司 |
| 无锡市陶都巨龙软件有限责任公司 |
| TCL华星光电技术有限公司 |
| 万宝盛华集团 |
| 妙盈科技 |
| 尚企云链 |
| 华奕四库 |
| 海力控股集团 |
| 中国融通教育集团 |
| 新疆天衡信息系统咨询管理有限公司 |
| 新开普电子股份有限公司 |
| 广西数字浪潮数据服务有限公司 |
| 百安居中国 |
| 重庆两江协同创新区 |
| 万宝盛华大中华有限公司 |
| 哈尔滨途图科技有限公司 |
| 哈尔滨逐浪文化传媒有限公司 |
| 大连电瓷集团股份有限公司 |
| 锦州港股份有限公司 |
| 湖南数通信息技术服务有限公司 |
| 湖南湘邮科技股份有限公司 |
| 湖南省公共资源交易平台市场主体注册系统 |
| 湘潭智慧教育云统一认证平台 |
| 南京市智慧医疗投资运营服务有限公司 |
| 南凌科技股份有限公司 |
| 福建引迈信息技术有限公司 |
| 漳州信息产业集团有限公司 |
| 厦门茂商科技有限公司 |
| 惠州中京电子科技股份有限公司 |
| 武汉英特沃科技有限公司 |
| 武汉博特睿达智能科技有限公司 |
| 江西云车科技有限公司 |
| 天津汉通教育科技有限公司 |
| 天津市达恩华天智能科技有限公司 |
| 企思(天津)科技有限公司 |
| 凯盛工业互联网平台 |
| 吕梁市医改监测平台 |
| 遂宁市经济大数据平台 |
| 临沂市城市大脑物联网统一认证平台 |

File diff suppressed because it is too large Load Diff

@ -0,0 +1,538 @@
/*
* Copyright [2023] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MaxKey build file was auto generated by running the Gradle release.bat
*/
defaultTasks "clean", "build"
//Version define
ext {
}
def libjarsmapper=[
'maxkey-authentication-captcha' :'lib',
'maxkey-authentication-core' :'lib',
'maxkey-authentication-ip2location' :'lib',
'maxkey-authentication-otp' :'lib',
'maxkey-authentication-provider' :'lib',
'maxkey-authentication-sms' :'lib',
'maxkey-common' :'lib',
'maxkey-core' :'lib',
'maxkey-persistence' :'lib',
'maxkey-protocol-authorize' :'lib',
'maxkey-protocol-cas' :'lib',
'maxkey-protocol-desktop' :'lib',
'maxkey-protocol-extendapi' :'lib',
'maxkey-protocol-formbased' :'lib',
'maxkey-protocol-jwt' :'lib',
'maxkey-protocol-oauth-2.0' :'lib',
'maxkey-protocol-saml-2.0' :'lib',
'maxkey-protocol-tokenbased' :'lib',
'maxkey-web-resources' :'lib',
'maxkey-authentication-social' :'maxkey',
'maxkey-web-maxkey' :'maxkey',
'maxkey-web-mgt' :'maxkey_mgt',
'maxkey-synchronizer' :'maxkey_mgt',
'maxkey-synchronizer-activedirectory' :'maxkey_mgt',
'maxkey-synchronizer-common' :'maxkey_mgt',
'maxkey-synchronizer-jdbc' :'maxkey_mgt',
'maxkey-synchronizer-ldap' :'maxkey_mgt',
'maxkey-synchronizer-dingtalk' :'maxkey_mgt',
'maxkey-synchronizer-workweixin' :'maxkey_mgt',
'maxkey-synchronizer-reorgdept' :'maxkey_mgt',
'maxkey-web-openapi' :'maxkey_openapi',
'maxkey-web-api-rest' :'maxkey_openapi',
'maxkey-web-api-scim' :'maxkey_openapi',
]
configurations.all {
transitive = false//
}
//add support for Java
//apply plugin: 'java'
allprojects {
apply plugin: "java"
apply plugin: "eclipse"
//apply plugin: "pmd"
//apply plugin: "findbugs"
//apply plugin: "jdepend"
configurations.all {
transitive = false//
}
//java Version
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.encoding = 'UTF-8'
eclipse {
/*设置工程字符集*/
jdt {
File prefs = file('.settings/org.eclipse.core.resources.prefs')
if (prefs.exists()) {
prefs.write('eclipse.preferences.version=1\n')
prefs.append('encoding/<project>=UTF-8') //use UTF-8
}
}
}
}
buildscript {
repositories {
mavenCentral()
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
}
subprojects {
processResources {
from ('src/main/resources') {
include 'src/main/resources/*.*'
}
}
sourceSets {
main {
java {
srcDir 'src/main/java' //
}
}
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/central"}
maven { url "https://maven.aliyun.com/repository/public"}
maven { url "https://repo.spring.io/plugins-release/" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo1.maven.org/maven2/" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases/" }
maven { url "https://mvnrepository.com/repos/central/" }
maven { url "https://jcenter.bintray.com" }
maven { url "https://mvn.gt.igexin.com/nexus/content/repositories/releases"}
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
maven { url "https://maven.repository.redhat.com/ga/" }
maven { url "https://repository.apache.org/content/repositories/releases/" }
mavenCentral()
}
//all dependencies
dependencies {
//for Test and Compile
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
compileOnly group: 'junit', name: 'junit', version: "${junitVersion}"
testImplementation group: 'org.mockito', name: 'mockito-all', version: "${mockitoallVersion}"
testImplementation group: 'xmlunit', name: 'xmlunit', version: "${xmlunitVersion}"
//apache
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: "${commonsbeanutilsVersion}"
implementation group: 'commons-codec', name: 'commons-codec', version: "${commonscodecVersion}"
implementation group: 'commons-collections', name: 'commons-collections', version: "${commonscollectionsVersion}"
implementation group: 'org.apache.commons', name: 'commons-collections4', version: "${commonscollections4Version}"
//implementation group: 'org.apache.commons', name: 'commons-csv', version: "${commonscsvVersion}"
implementation group: 'org.apache.commons', name: 'commons-text', version: "${commonstextVersion}"
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: "${commonsdbcp2Version}"
//implementation group: 'commons-dbutils', name: 'commons-dbutils', version: "${commonsdbutilsVersion}"
//implementation group: 'org.apache.commons', name: 'commons-digester3', version: "${commonsdigester3Version}"
//implementation group: 'commons-digester', name: 'commons-digester', version: "${commonsdigesterVersion}"
implementation group: 'commons-io', name: 'commons-io', version: "${commonsioVersion}"
implementation group: 'commons-lang', name: 'commons-lang', version: "${commonslangVersion}"
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commonslang3Version}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"
implementation group: 'org.apache.commons', name: 'commons-pool2', version: "${commonspool2Version}"
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: "${commonshttpclientVersion}"
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: "${commonsfileuploadVersion}"
implementation group: 'commons-validator', name: 'commons-validator', version: "${commonsvalidatorVersion}"
//httpcomponents v4
implementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: "${httpasyncclientVersion}"
implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient-cache', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: "${httpcoreVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: "${httpcoreVersion}"
//httpcomponents v5
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5-h2', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5-fluent', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.velocity', name: 'velocity', version: "${velocityVersion}"
implementation group: 'velocity', name: 'velocity-dep', version: "${velocitydepVersion}"
implementation group: 'org.freemarker', name: 'freemarker', version: "${freemarkerVersion}"
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: "${xmlbeansVersion}"
implementation group: 'org.apache.commons', name: 'commons-compress', version: "${commonscompressVersion}"
implementation group: 'org.apache.poi', name: 'poi', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-excelant', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml-full', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
//implementation group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: "${notyetcommonssslVersion}"
//tomcat embed Core Tomcat implementation
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-el', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: "${tomcatVersion}"
//apache log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jul', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4jVersion}"
//slf4j
implementation group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
//jboss-logging
implementation group: 'org.jboss.logging', name: 'jboss-logging', version: "${jbossloggingVersion}"
//spring
implementation group: 'org.springframework', name: 'spring-aop', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-aspects', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-beans', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-core', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-indexer', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-support', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-expression', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-instrument', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jcl', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jdbc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-jms', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-messaging', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-orm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-oxm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-tx', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-web', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webflux', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webmvc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-websocket', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
implementation group: 'org.springframework.retry', name: 'spring-retry', version: "${springretryVersion}"
testImplementation group: 'org.springframework', name: 'spring-test', version: "${springVersion}"
//spring-security
implementation group: 'org.springframework.security', name: 'spring-security-core', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-web', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: "${springSecurityVersion}"
//srpingboot
implementation group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-reactor-netty', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis-reactive', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: "${springBootVersion}"
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
//spring-boot-admin
implementation group: 'de.codecentric', name: 'spring-boot-admin-client', version: "${springbootadminVersion}"
implementation group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: "${springbootadminVersion}"
//spring-data
implementation group: 'org.springframework.data', name: 'spring-data-commons', version: "${springDataVersion}"
implementation group: 'org.springframework.data', name: 'spring-data-keyvalue', version: "${springDataVersion}"
//implementation group: 'org.springframework.data', name: 'spring-data-redis', version: "${springDataVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-core', version: "${springplugincoreVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-metadata', version: "${springpluginmetadataVersion}"
//spring cloud
implementation group: 'org.springframework.cloud', name: 'spring-cloud-commons', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-context', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: "${springcloudVersion}"
//spring-cloud-alibaba
implementation group: 'com.alibaba.spring', name: 'spring-context-support', version: "${springcloudalibabaspringVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-alibaba-commons', version: "${springcloudalibabaVersion}"
//alibaba nacos
implementation group: 'com.alibaba.nacos', name: 'nacos-client', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-auth-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-encryption-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-discovery', version: "${springcloudalibabaVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
//Message Queue
//kafka support
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
//rocketmq
implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}"
implementation group: 'io.github.aliyunmq', name: 'rocketmq-slf4j-api', version: '1.0.1'
implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}"
// https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}"
//saml see maxkey-lib
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
//implementation group: 'org.opensaml', name: 'xmltooling', version: "${xmltoolingVersion}"
implementation group: 'net.shibboleth.utilities', name: 'java-support', version: "${javasupportVersion}"
//jose-jwt
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusjosejwtVersion}"
implementation group: 'com.github.stephenc.jcip', name: 'jcip-annotations', version: "${jcipannotationsVersion}"
implementation group: 'net.minidev', name: 'json-smart', version: "${minidevjsonsmartVersion}"
implementation group: 'net.minidev', name: 'asm', version: "${minidevasmVersion}"
//oauth third party JustAuth
implementation group: 'com.xkcoding.http', name: 'simple-http', version: "${simplehttpVersion}"
implementation group: 'me.zhyd.oauth', name: 'JustAuth', version: "${JustAuthVersion}"
//common
implementation group: 'org.javassist', name: 'javassist', version: "${javassistVersion}"
implementation group: 'org.owasp.esapi', name: 'esapi', version: "${esapiVersion}"
//jakarta
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: "${jakartaactivationVersion}"
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: "${jakartaannotationVersion}"
implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: "${jakartamailapiVersion}"
implementation group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: "${jakartapersistenceapiVersion}"
implementation group: 'jakarta.transaction', name: 'jakarta.transaction-api', version: "${jakartatransactionapiVersion}"
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: "${jakartavalidationapiVersion}"
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: "${jakartaxmlbindapiVersion}"
//mail
implementation group: 'org.eclipse.angus', name: 'jakarta.mail', version: "${angusjakartamailVersion}"
implementation group: 'org.eclipse.angus', name: 'angus-activation', version: "${angusactivationVersion}"
//sun.xml.bind
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: "${xmlbindjaxbcoreVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: "${xmlbindjaxbimplVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: "${xmlbindjaxbxjcVersion}"
//crypto
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: "${bouncycastleVersion}"
implementation group: 'org.bouncycastle', name: 'bcprov-ext-jdk18on', version: "${bouncycastleVersion}"
//google
implementation group: 'com.google.crypto.tink', name: 'tink', version: "${tinkVersion}"
//kaptcha
implementation group: 'com.jhlabs', name: 'filters', version: "${jhlabsfiltersVersion}"
implementation group: 'com.github.penggle', name: 'kaptcha', version: "${kaptchaVersion}"
//json-gson
implementation group: 'com.google.code.gson', name: 'gson', version: "${gsonVersion}"
//json-jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jaxb-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jakarta-xmlbind-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml', name: 'classmate', version: "${classmateVersion}"
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: "${woodstoxVersion}"
//json-fastjson
implementation group: 'com.alibaba', name: 'fastjson', version: "${fastjsonVersion}"
//reactive
implementation group: 'org.reactivestreams', name: 'reactive-streams', version: "${reactivestreamsVersion}"
implementation group: 'io.projectreactor', name: 'reactor-core', version: "${reactorcoreVersion}"
implementation group: 'eu.tekul', name: 'szxcvbn_2.9.2', version: "${szxcvbnVersion}"
//database
implementation group: 'com.mysql', name: 'mysql-connector-j', version: "${mysqlconnectorjavaVersion}"
//implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}"
//implementation group: 'com.dameng', name: 'DmJdbcDriver18', version: "${dm8JdbcDriverVersion}"
//implementation group: 'com.highgo', name: 'HgdbJdbc', version: '6.2.3'
//implementation group: 'org.liquibase', name: 'liquibase-core', version: '4.3.5'
implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}"
implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}"
implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}"
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: "${caffeineVersion}"
//mybatis
implementation group: 'org.mybatis', name: 'mybatis', version: "${mybatisVersion}"
implementation group: 'org.mybatis', name: 'mybatis-spring', version: "${mybatisspringVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra', version: "${mybatisjpaextraVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra-spring-boot-starter', version: "${mybatisjpaextraVersion}"
//hibernate
implementation group: 'org.hibernate.validator', name: 'hibernate-validator', version: "${hibernateVersion}"
implementation group: 'org.hibernate', name: 'hibernate-validator-cdi', version: "${hibernateVersion}"
implementation group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: "${hibernateVersion}"
//usefull
implementation group: 'io.netty', name: 'netty-all', version: "${nettyVersion}"
implementation group: 'com.belerweb', name: 'pinyin4j', version: "${pinyin4jVersion}"
implementation group: 'org.jsoup', name: 'jsoup', version: "${jsoupVersion}"
implementation group: 'joda-time', name: 'joda-time', version: "${jodatimeVersion}"
implementation group: 'org.yaml', name: 'snakeyaml', version: "${snakeyamlVersion}"
implementation group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: "${nekohtmlVersion}"
implementation group: 'org.dom4j', name: 'dom4j', version: "${dom4jVersion}"
implementation group: 'org.jdom', name: 'jdom2', version: "${jdom2Version}"
implementation group: 'com.google.zxing', name: 'core', version: "${zxingcoreVersion}"
implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
implementation group: 'ognl', name: 'ognl', version: "${ognlVersion}"
implementation group: 'cglib', name: 'cglib', version: "${cglibVersion}"
implementation group: 'org.ow2.asm', name: 'asm', version: "${asmVersion}"
implementation group: 'aopalliance', name: 'aopalliance', version: "${aopallianceVersion}"
implementation group: 'org.aspectj', name: 'aspectjtools', version: "${aspectjtoolsVersion}"
implementation group: 'xalan', name: 'serializer', version: "${serializerVersion}"
implementation group: 'xml-resolver', name: 'xml-resolver', version: "${xmlresolverVersion}"
implementation group: 'org.apache.santuario', name: 'xmlsec', version: "${xmlsecVersion}"
//implementation group: 'org.ogce', name: 'xpp3', version: "${xpp3Version}"
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: "${xstreamVersion}"
implementation group: 'org.passay', name: 'passay', version: "${passayVersion}"
implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}"
//ip offline
implementation group: 'org.lionsoul', name: 'ip2region', version: "${ip2regionVersion}"
implementation group: 'com.maxmind.db', name: 'maxmind-db', version: "${maxminddbVersion}"
implementation group: 'com.maxmind.geoip2', name: 'geoip2', version: "${maxmindgeoip2Version}"
//micrometer
implementation group: 'io.micrometer', name: 'micrometer-commons', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-core', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-observation', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: "${micrometercoreVersion}"
implementation group: 'org.latencyutils', name: 'LatencyUtils', version: "${LatencyUtilsVersion}"
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: "${stax2apiVersion}"
implementation group: 'org.reflections', name: 'reflections', version: "${reflectionsVersion}"
//prometheus
implementation group: 'io.prometheus', name: 'simpleclient', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_common', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel_agent', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_common', version: "${prometheusVersion}"
//
implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: "${aliyunjavasdkcoreVersion}"
implementation group: 'io.opentracing', name: 'opentracing-api', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-noop', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-util', version: "${opentracingVersion}"
//aliyun-java-sdk-corejakarta.xml.bind
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
//
implementation group: 'com.tencentcloudapi', name: 'tencentcloud-sdk-java', version: "${tencentcloudsdkjavaVersion}"
//docs
implementation group: 'org.mapstruct', name: 'mapstruct', version: "${mapstructVersion}"
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-core-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-models-jakarta', version: "${swaggerV3Version}"
//springdoc
implementation group: 'io.github.classgraph', name: 'classgraph', version: "${classgraphVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-common', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-api', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: "${springdocVersion}"
//webjars
implementation group: 'org.webjars', name: 'webjars-locator-core', version: "${webjarslocatorcoreVersion}"
implementation group: 'org.webjars', name: 'webjars-locator', version: "${webjarslocatorVersion}"
implementation group: 'org.webjars', name: 'swagger-ui', version: "${swaggeruiVersion}"
//knife4j
implementation group: 'com.github.xiaoymin', name: 'knife4j-core', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-ui', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-jakarta-spring-boot-starter', version: "${knife4jVersion}"
//local jars
implementation fileTree(dir: "${rootDir}/maxkey-lib/", include: '*.jar')
}
jar {
def currentTime = java.time.ZonedDateTime.now()
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Vendor": project.vendor,
"Created-By": project.author,
"Implementation-Date": currentTime,
"Implementation-Version": project.version
)
}
}
tasks.register("buildRelease",Copy) {
dependsOn assemble
// group version
println "subproject " + project.name + ", group " + project.group +" , version " + project.version
//copy
into "$rootDir/build/maxkey-jars/"
from "$buildDir/libs/"
include '*.jar'
}
tasks.register("copyLibJars",Copy) {
if (libjarsmapper["${project.name}"] != null){
into "$rootDir/build/MaxKey-v${project.version}GA/"+libjarsmapper["${project.name}"]
from "$buildDir/libs/"
include '*.jar'
}
}
assemble.configure { finalizedBy buildRelease,copyLibJars }
}
//copy Dep Jars to /build/maxkey-depjars,only maxkey-common deps
project('maxkey-common') {
task createReleaseDir(type: Copy){
def paths = ["$rootDir/build/MaxKey-v${project.version}GA",
"$rootDir/build/MaxKey-v${project.version}GA/maxkey",
"$rootDir/build/MaxKey-v${project.version}GA/maxkey_mgt",
"$rootDir/build/MaxKey-v${project.version}GA/lib"];
//createDir
paths.forEach(){path->
File dir=new File(path);
if (!dir.exists()){
print("create "+path+"\n")
dir.mkdirs();
}
};
}
task copyDepJars (type: Copy){
dependsOn assemble
println "copy Dep Jars to $rootDir/build/MaxKey-v${project.version}GA/lib"
//copy runtime
from configurations.runtimeClasspath
into "$rootDir/build/MaxKey-v${project.version}GA/lib";
}
build.configure { finalizedBy copyDepJars }
}
tasks.register("buildRelease") {
dependsOn 'copyShellScript','copyWindowsShellScript'
// group version
println "Root project " + project.name + ", group " + project.group +" , version " + project.version
// to build
println "Root project projectDir " + project.projectDir +" to " + project.buildDir
}
tasks.register("copyShellScript",Copy) {
println "project copyMaxKeyShellScript .";
from "$rootDir/shellscript/"
into "$rootDir/build/MaxKey-v${project.version}GA/shellscript/";
}
tasks.register("copyWindowsShellScript",Copy) {
println "project copyMaxKeyWindowsShellScript .";
from "$rootDir/shellscript/windows"
into "$rootDir/build/MaxKey-v${project.version}GA/";
}
build.configure {
finalizedBy buildRelease
println ""
println "Gradle version is ${GradleVersion.current().version}"
}

@ -0,0 +1,126 @@
/*
* Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MaxKey build file was auto generated by running the Gradle release.bat
*/
defaultTasks "clearBuild"
//Version define
ext {
}
task clearBuild(){
println 'Clear Build MaxKey ... '
delete "$rootDir/build.gradle"
delete "$rootDir/maxkey-webs/maxkey-web-mgt/build.gradle"
delete "$rootDir/maxkey-webs/maxkey-web-maxkey/build.gradle"
delete "$rootDir/maxkey-webs/maxkey-web-openapi/build.gradle"
}
task configStd(dependsOn:['clearBuild']) {
doLast {
copy {
from "$rootDir/maxkey-webs/maxkey-web-openapi/config/build_standard.gradle"
into "$rootDir/maxkey-webs/maxkey-web-openapi/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-mgt/config/build_standard.gradle"
into "$rootDir/maxkey-webs/maxkey-web-mgt/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-maxkey/config/build_standard.gradle"
into "$rootDir/maxkey-webs/maxkey-web-maxkey/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/config/build_standard.gradle"
into "$rootDir/"
rename { String fileName -> 'build.gradle' }
}
println 'Standard Build MaxKey .'
}
}
task configDocker(dependsOn:['clearBuild']) {
doLast {
copy {
from "$rootDir/maxkey-webs/maxkey-web-openapi/config/build_docker.gradle"
into "$rootDir/maxkey-webs/maxkey-web-openapi/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-mgt/config/build_docker.gradle"
into "$rootDir/maxkey-webs/maxkey-web-mgt/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-maxkey/config/build_docker.gradle"
into "$rootDir/maxkey-webs/maxkey-web-maxkey/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/config/build_docker.gradle"
into "$rootDir/"
rename { String fileName -> 'build.gradle' }
}
println 'Docker Build MaxKey .'
}
}
task configJar(dependsOn:['clearBuild']) {
doLast {
copy {
from "$rootDir/maxkey-webs/maxkey-web-openapi/config/build_jar.gradle"
into "$rootDir/maxkey-webs/maxkey-web-openapi/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-mgt/config/build_jar.gradle"
into "$rootDir/maxkey-webs/maxkey-web-mgt/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/maxkey-webs/maxkey-web-maxkey/config/build_jar.gradle"
into "$rootDir/maxkey-webs/maxkey-web-maxkey/"
rename { String fileName -> 'build.gradle' }
}
copy {
from "$rootDir/config/build_jar.gradle"
into "$rootDir/"
rename { String fileName -> 'build.gradle' }
}
println 'Java Jar Build MaxKey .'
}
}
// In this section you declare the dependencies for your production and test code
dependencies {
}

@ -0,0 +1,324 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.org (or in your downloaded distribution).
To completely disable a check, just comment it out or delete it from the file.
To suppress certain violations please review suppression filters.
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->
<module name = "Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
<property name="fileExtensions" value="java, properties, xml"/>
<!-- Excludes all 'module-info.java' files -->
<!-- See https://checkstyle.org/config_filefilters.html -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
<module name="SuppressionFilter">
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
default="checkstyle-suppressions.xml" />
<property name="optional" value="true"/>
</module>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.org/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="LineLength">
<property name="fileExtensions" value="java"/>
<property name="max" value="100"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format"
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message"
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap">
<property name="tokens" value="PACKAGE_DEF, IMPORT, STATIC_IMPORT"/>
</module>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces">
<property name="tokens"
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"/>
</module>
<module name="LeftCurly">
<property name="tokens"
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
INTERFACE_DEF, LAMBDA, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT,
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
OBJBLOCK, STATIC_INIT"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlySame"/>
<property name="tokens"
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
LITERAL_DO"/>
</module>
<module name="RightCurly">
<property name="id" value="RightCurlyAlone"/>
<property name="option" value="alone"/>
<property name="tokens"
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF"/>
</module>
<module name="SuppressionXpathSingleFilter">
<!-- suppresion is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
<property name="id" value="RightCurlyAlone"/>
<property name="query" value="//RCURLY[parent::SLIST[count(./*)=1]
or preceding-sibling::*[last()][self::LCURLY]]"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="UpperEll"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="tokens"
value="PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapDot"/>
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapComma"/>
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
<property name="id" value="SeparatorWrapEllipsis"/>
<property name="tokens" value="ELLIPSIS"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
<property name="id" value="SeparatorWrapArrayDeclarator"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
<property name="option" value="EOL"/>
</module>
<module name="SeparatorWrap">
<property name="id" value="SeparatorWrapMethodRef"/>
<property name="tokens" value="METHOD_REF"/>
<property name="option" value="nl"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF"/>
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LambdaParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CatchParameterName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="braceAdjustment" value="0"/>
<property name="caseIndent" value="4"/>
<property name="throwsIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="1"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, ANNOTATION_DEF, ANNOTATION_FIELD_DEF,
PARAMETER_DEF, VARIABLE_DEF, METHOD_DEF"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
<property name="customImportOrderRules" value="STATIC###THIRD_PARTY_PACKAGE"/>
<property name="tokens" value="IMPORT, STATIC_IMPORT, PACKAGE_DEF"/>
</module>
<module name="MethodParamPad">
<property name="tokens"
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF"/>
</module>
<module name="NoWhitespaceBefore">
<property name="tokens"
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<module name="ParenPad">
<property name="tokens"
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA"/>
</module>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens"
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="id" value="AnnotationLocationVariables"/>
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="public"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation">
<property name="tokens" value="SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN"/>
</module>
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
<module name="SuppressionXpathFilter">
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
default="checkstyle-xpath-suppressions.xml" />
<property name="optional" value="true"/>
</module>
</module>
</module>

@ -0,0 +1,457 @@
/*
* Copyright [2023] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MaxKey build file was auto generated by running the Gradle release.bat
*/
defaultTasks "clean", "build"
//Version define
ext {
}
configurations.all {
transitive = false//
}
//add support for Java
//apply plugin: 'java'
allprojects {
apply plugin: "java"
apply plugin: "eclipse"
//apply plugin: "pmd"
//apply plugin: "findbugs"
//apply plugin: "jdepend"
configurations.all {
transitive = false//
}
//java Version
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.encoding = 'UTF-8'
eclipse {
/*设置工程字符集*/
jdt {
File prefs = file('.settings/org.eclipse.core.resources.prefs')
if (prefs.exists()) {
prefs.write('eclipse.preferences.version=1\n')
prefs.append('encoding/<project>=UTF-8') //use UTF-8
}
}
}
}
buildscript {
repositories {
mavenCentral()
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
subprojects {
/*
eclipse {
eclipse
jdt {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('encoding/<project>=UTF-8') //use UTF-8
}
}
*/
processResources {
from ('src/main/resources') {
include 'src/main/resources/*.*'
}
}
sourceSets {
main {
java {
srcDir 'src/main/java' //
}
}
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/central"}
maven { url "https://maven.aliyun.com/repository/public"}
maven { url "https://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo1.maven.org/maven2" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "https://mvnrepository.com/repos/central" }
maven { url "https://jcenter.bintray.com" }
maven { url "https://mvn.gt.igexin.com/nexus/content/repositories/releases"}
maven { url "https://plugins.gradle.org/m2" }
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "https://maven.repository.redhat.com/ga" }
maven { url "https://repository.apache.org/content/repositories/releases" }
mavenCentral()
}
//all dependencies
dependencies {
//for Test and Compile
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
compileOnly group: 'junit', name: 'junit', version: "${junitVersion}"
testImplementation group: 'org.mockito', name: 'mockito-all', version: "${mockitoallVersion}"
testImplementation group: 'xmlunit', name: 'xmlunit', version: "${xmlunitVersion}"
//apache
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: "${commonsbeanutilsVersion}"
implementation group: 'commons-codec', name: 'commons-codec', version: "${commonscodecVersion}"
implementation group: 'commons-collections', name: 'commons-collections', version: "${commonscollectionsVersion}"
implementation group: 'org.apache.commons', name: 'commons-collections4', version: "${commonscollections4Version}"
//implementation group: 'org.apache.commons', name: 'commons-csv', version: "${commonscsvVersion}"
implementation group: 'org.apache.commons', name: 'commons-text', version: "${commonstextVersion}"
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: "${commonsdbcp2Version}"
//implementation group: 'commons-dbutils', name: 'commons-dbutils', version: "${commonsdbutilsVersion}"
//implementation group: 'org.apache.commons', name: 'commons-digester3', version: "${commonsdigester3Version}"
//implementation group: 'commons-digester', name: 'commons-digester', version: "${commonsdigesterVersion}"
implementation group: 'commons-io', name: 'commons-io', version: "${commonsioVersion}"
implementation group: 'commons-lang', name: 'commons-lang', version: "${commonslangVersion}"
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commonslang3Version}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"
implementation group: 'org.apache.commons', name: 'commons-pool2', version: "${commonspool2Version}"
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: "${commonshttpclientVersion}"
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: "${commonsfileuploadVersion}"
implementation group: 'commons-validator', name: 'commons-validator', version: "${commonsvalidatorVersion}"
//httpcomponents v4
implementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: "${httpasyncclientVersion}"
implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient-cache', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: "${httpcoreVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: "${httpcoreVersion}"
//httpcomponents v5
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5-h2', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5-fluent', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.velocity', name: 'velocity', version: "${velocityVersion}"
implementation group: 'velocity', name: 'velocity-dep', version: "${velocitydepVersion}"
implementation group: 'org.freemarker', name: 'freemarker', version: "${freemarkerVersion}"
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: "${xmlbeansVersion}"
implementation group: 'org.apache.commons', name: 'commons-compress', version: "${commonscompressVersion}"
implementation group: 'org.apache.poi', name: 'poi', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-excelant', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml-full', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
//implementation group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: "${notyetcommonssslVersion}"
//tomcat embed Core Tomcat implementation
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-el', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: "${tomcatVersion}"
//apache log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jul', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4jVersion}"
//slf4j
implementation group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
//jboss-logging
implementation group: 'org.jboss.logging', name: 'jboss-logging', version: "${jbossloggingVersion}"
//spring
implementation group: 'org.springframework', name: 'spring-aop', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-aspects', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-beans', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-core', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-indexer', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-support', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-expression', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-instrument', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jcl', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jdbc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-jms', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-messaging', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-orm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-oxm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-tx', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-web', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webflux', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webmvc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-websocket', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
implementation group: 'org.springframework.retry', name: 'spring-retry', version: "${springretryVersion}"
testImplementation group: 'org.springframework', name: 'spring-test', version: "${springVersion}"
//spring-security
implementation group: 'org.springframework.security', name: 'spring-security-core', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-web', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: "${springSecurityVersion}"
//srpingboot
implementation group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-reactor-netty', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis-reactive', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: "${springBootVersion}"
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
//spring-boot-admin
implementation group: 'de.codecentric', name: 'spring-boot-admin-client', version: "${springbootadminVersion}"
implementation group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: "${springbootadminVersion}"
//spring-data
implementation group: 'org.springframework.data', name: 'spring-data-commons', version: "${springDataVersion}"
implementation group: 'org.springframework.data', name: 'spring-data-keyvalue', version: "${springDataVersion}"
//implementation group: 'org.springframework.data', name: 'spring-data-redis', version: "${springDataVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-core', version: "${springplugincoreVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-metadata', version: "${springpluginmetadataVersion}"
//spring cloud
implementation group: 'org.springframework.cloud', name: 'spring-cloud-commons', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-context', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: "${springcloudVersion}"
//spring-cloud-alibaba
implementation group: 'com.alibaba.spring', name: 'spring-context-support', version: "${springcloudalibabaspringVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-alibaba-commons', version: "${springcloudalibabaVersion}"
//alibaba nacos
implementation group: 'com.alibaba.nacos', name: 'nacos-client', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-auth-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-encryption-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-discovery', version: "${springcloudalibabaVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
//Message Queue
//kafka support
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
//rocketmq
implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}"
implementation group: 'io.github.aliyunmq', name: 'rocketmq-slf4j-api', version: '1.0.1'
implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}"
// https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}"
//saml see maxkey-lib
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
//implementation group: 'org.opensaml', name: 'xmltooling', version: "${xmltoolingVersion}"
implementation group: 'net.shibboleth.utilities', name: 'java-support', version: "${javasupportVersion}"
//jose-jwt
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusjosejwtVersion}"
implementation group: 'com.github.stephenc.jcip', name: 'jcip-annotations', version: "${jcipannotationsVersion}"
implementation group: 'net.minidev', name: 'json-smart', version: "${minidevjsonsmartVersion}"
implementation group: 'net.minidev', name: 'asm', version: "${minidevasmVersion}"
//oauth third party JustAuth
implementation group: 'com.xkcoding.http', name: 'simple-http', version: "${simplehttpVersion}"
implementation group: 'me.zhyd.oauth', name: 'JustAuth', version: "${JustAuthVersion}"
//common
implementation group: 'org.javassist', name: 'javassist', version: "${javassistVersion}"
implementation group: 'org.owasp.esapi', name: 'esapi', version: "${esapiVersion}"
//jakarta
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: "${jakartaactivationVersion}"
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: "${jakartaannotationVersion}"
implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: "${jakartamailapiVersion}"
implementation group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: "${jakartapersistenceapiVersion}"
implementation group: 'jakarta.transaction', name: 'jakarta.transaction-api', version: "${jakartatransactionapiVersion}"
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: "${jakartavalidationapiVersion}"
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: "${jakartaxmlbindapiVersion}"
//mail
implementation group: 'org.eclipse.angus', name: 'jakarta.mail', version: "${angusjakartamailVersion}"
implementation group: 'org.eclipse.angus', name: 'angus-activation', version: "${angusactivationVersion}"
//sun.xml.bind
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: "${xmlbindjaxbcoreVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: "${xmlbindjaxbimplVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: "${xmlbindjaxbxjcVersion}"
//crypto
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: "${bouncycastleVersion}"
implementation group: 'org.bouncycastle', name: 'bcprov-ext-jdk18on', version: "${bouncycastleVersion}"
//google
implementation group: 'com.google.crypto.tink', name: 'tink', version: "${tinkVersion}"
//kaptcha
implementation group: 'com.jhlabs', name: 'filters', version: "${jhlabsfiltersVersion}"
implementation group: 'com.github.penggle', name: 'kaptcha', version: "${kaptchaVersion}"
//json-gson
implementation group: 'com.google.code.gson', name: 'gson', version: "${gsonVersion}"
//json-jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jaxb-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jakarta-xmlbind-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml', name: 'classmate', version: "${classmateVersion}"
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: "${woodstoxVersion}"
//json-fastjson
implementation group: 'com.alibaba', name: 'fastjson', version: "${fastjsonVersion}"
//reactive
implementation group: 'org.reactivestreams', name: 'reactive-streams', version: "${reactivestreamsVersion}"
implementation group: 'io.projectreactor', name: 'reactor-core', version: "${reactorcoreVersion}"
implementation group: 'eu.tekul', name: 'szxcvbn_2.9.2', version: "${szxcvbnVersion}"
//database
implementation group: 'com.mysql', name: 'mysql-connector-j', version: "${mysqlconnectorjavaVersion}"
//implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}"
//implementation group: 'com.dameng', name: 'DmJdbcDriver18', version: "${dm8JdbcDriverVersion}"
//implementation group: 'com.highgo', name: 'HgdbJdbc', version: '6.2.3'
//implementation group: 'org.liquibase', name: 'liquibase-core', version: '4.3.5'
implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}"
implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}"
implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}"
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: "${caffeineVersion}"
//mybatis
implementation group: 'org.mybatis', name: 'mybatis', version: "${mybatisVersion}"
implementation group: 'org.mybatis', name: 'mybatis-spring', version: "${mybatisspringVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra', version: "${mybatisjpaextraVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra-spring-boot-starter', version: "${mybatisjpaextraVersion}"
//hibernate
implementation group: 'org.hibernate.validator', name: 'hibernate-validator', version: "${hibernateVersion}"
implementation group: 'org.hibernate', name: 'hibernate-validator-cdi', version: "${hibernateVersion}"
implementation group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: "${hibernateVersion}"
//usefull
implementation group: 'io.netty', name: 'netty-all', version: "${nettyVersion}"
implementation group: 'com.belerweb', name: 'pinyin4j', version: "${pinyin4jVersion}"
implementation group: 'org.jsoup', name: 'jsoup', version: "${jsoupVersion}"
implementation group: 'joda-time', name: 'joda-time', version: "${jodatimeVersion}"
implementation group: 'org.yaml', name: 'snakeyaml', version: "${snakeyamlVersion}"
implementation group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: "${nekohtmlVersion}"
implementation group: 'org.dom4j', name: 'dom4j', version: "${dom4jVersion}"
implementation group: 'org.jdom', name: 'jdom2', version: "${jdom2Version}"
implementation group: 'com.google.zxing', name: 'core', version: "${zxingcoreVersion}"
implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
implementation group: 'ognl', name: 'ognl', version: "${ognlVersion}"
implementation group: 'cglib', name: 'cglib', version: "${cglibVersion}"
implementation group: 'org.ow2.asm', name: 'asm', version: "${asmVersion}"
implementation group: 'aopalliance', name: 'aopalliance', version: "${aopallianceVersion}"
implementation group: 'org.aspectj', name: 'aspectjtools', version: "${aspectjtoolsVersion}"
implementation group: 'xalan', name: 'serializer', version: "${serializerVersion}"
implementation group: 'xml-resolver', name: 'xml-resolver', version: "${xmlresolverVersion}"
implementation group: 'org.apache.santuario', name: 'xmlsec', version: "${xmlsecVersion}"
//implementation group: 'org.ogce', name: 'xpp3', version: "${xpp3Version}"
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: "${xstreamVersion}"
implementation group: 'org.passay', name: 'passay', version: "${passayVersion}"
implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}"
//ip offline
implementation group: 'org.lionsoul', name: 'ip2region', version: "${ip2regionVersion}"
implementation group: 'com.maxmind.db', name: 'maxmind-db', version: "${maxminddbVersion}"
implementation group: 'com.maxmind.geoip2', name: 'geoip2', version: "${maxmindgeoip2Version}"
//micrometer
implementation group: 'io.micrometer', name: 'micrometer-commons', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-core', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-observation', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: "${micrometercoreVersion}"
implementation group: 'org.latencyutils', name: 'LatencyUtils', version: "${LatencyUtilsVersion}"
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: "${stax2apiVersion}"
implementation group: 'org.reflections', name: 'reflections', version: "${reflectionsVersion}"
//prometheus
implementation group: 'io.prometheus', name: 'simpleclient', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_common', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel_agent', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_common', version: "${prometheusVersion}"
//
implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: "${aliyunjavasdkcoreVersion}"
implementation group: 'io.opentracing', name: 'opentracing-api', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-noop', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-util', version: "${opentracingVersion}"
//aliyun-java-sdk-corejakarta.xml.bind
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
//
implementation group: 'com.tencentcloudapi', name: 'tencentcloud-sdk-java', version: "${tencentcloudsdkjavaVersion}"
//docs
implementation group: 'org.mapstruct', name: 'mapstruct', version: "${mapstructVersion}"
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-core-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-models-jakarta', version: "${swaggerV3Version}"
//springdoc
implementation group: 'io.github.classgraph', name: 'classgraph', version: "${classgraphVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-common', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-api', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: "${springdocVersion}"
//webjars
implementation group: 'org.webjars', name: 'webjars-locator-core', version: "${webjarslocatorcoreVersion}"
implementation group: 'org.webjars', name: 'webjars-locator', version: "${webjarslocatorVersion}"
implementation group: 'org.webjars', name: 'swagger-ui', version: "${swaggeruiVersion}"
//knife4j
implementation group: 'com.github.xiaoymin', name: 'knife4j-core', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-ui', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-jakarta-spring-boot-starter', version: "${knife4jVersion}"
//local jars
implementation fileTree(dir: "${rootDir}/maxkey-lib/", include: '*.jar')
}
jar {
def currentTime = java.time.ZonedDateTime.now()
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Vendor": project.vendor,
"Created-By": project.author,
"Implementation-Date": currentTime,
"Implementation-Version": project.version
)
}
}
task buildRelease() {
dependsOn assemble
//
println "subproject " + project.name + ", group " + project.group +" , version " + project.version
}
assemble.configure { finalizedBy buildRelease }
}
tasks.register("buildRelease") {
// group version
println "Root project " + project.name + ", group " + project.group +" , version " + project.version
// to build
println "Root project projectDir " + project.projectDir +" to " + project.buildDir
}
build.configure { finalizedBy buildRelease }
// In this section you declare the dependencies for your production and test code
dependencies {
}

@ -0,0 +1,457 @@
/*
* Copyright [2023] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MaxKey build file was auto generated by running the Gradle release.bat
*/
defaultTasks "clean", "build"
//Version define
ext {
}
configurations.all {
transitive = false//
}
//add support for Java
//apply plugin: 'java'
allprojects {
apply plugin: "java"
apply plugin: "eclipse"
//apply plugin: "pmd"
//apply plugin: "findbugs"
//apply plugin: "jdepend"
configurations.all {
transitive = false//
}
//java Version
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.encoding = 'UTF-8'
eclipse {
/*设置工程字符集*/
jdt {
File prefs = file('.settings/org.eclipse.core.resources.prefs')
if (prefs.exists()) {
prefs.write('eclipse.preferences.version=1\n')
prefs.append('encoding/<project>=UTF-8') //use UTF-8
}
}
}
}
buildscript {
repositories {
mavenCentral()
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
jcenter()
}
subprojects {
/*
eclipse {
eclipse
jdt {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('encoding/<project>=UTF-8') //use UTF-8
}
}
*/
processResources {
from ('src/main/resources') {
include 'src/main/resources/*.*'
}
}
sourceSets {
main {
java {
srcDir 'src/main/java' //
}
}
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/central"}
maven { url "https://maven.aliyun.com/repository/public"}
maven { url "https://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo1.maven.org/maven2" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "https://mvnrepository.com/repos/central" }
maven { url "https://jcenter.bintray.com" }
maven { url "https://mvn.gt.igexin.com/nexus/content/repositories/releases"}
maven { url "https://plugins.gradle.org/m2" }
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "https://maven.repository.redhat.com/ga" }
maven { url "https://repository.apache.org/content/repositories/releases" }
mavenCentral()
}
//all dependencies
dependencies {
//for Test and Compile
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
compileOnly group: 'junit', name: 'junit', version: "${junitVersion}"
testImplementation group: 'org.mockito', name: 'mockito-all', version: "${mockitoallVersion}"
testImplementation group: 'xmlunit', name: 'xmlunit', version: "${xmlunitVersion}"
//apache
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: "${commonsbeanutilsVersion}"
implementation group: 'commons-codec', name: 'commons-codec', version: "${commonscodecVersion}"
implementation group: 'commons-collections', name: 'commons-collections', version: "${commonscollectionsVersion}"
implementation group: 'org.apache.commons', name: 'commons-collections4', version: "${commonscollections4Version}"
//implementation group: 'org.apache.commons', name: 'commons-csv', version: "${commonscsvVersion}"
implementation group: 'org.apache.commons', name: 'commons-text', version: "${commonstextVersion}"
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: "${commonsdbcp2Version}"
//implementation group: 'commons-dbutils', name: 'commons-dbutils', version: "${commonsdbutilsVersion}"
//implementation group: 'org.apache.commons', name: 'commons-digester3', version: "${commonsdigester3Version}"
//implementation group: 'commons-digester', name: 'commons-digester', version: "${commonsdigesterVersion}"
implementation group: 'commons-io', name: 'commons-io', version: "${commonsioVersion}"
implementation group: 'commons-lang', name: 'commons-lang', version: "${commonslangVersion}"
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commonslang3Version}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"
implementation group: 'org.apache.commons', name: 'commons-pool2', version: "${commonspool2Version}"
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: "${commonshttpclientVersion}"
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: "${commonsfileuploadVersion}"
implementation group: 'commons-validator', name: 'commons-validator', version: "${commonsvalidatorVersion}"
//httpcomponents v4
implementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: "${httpasyncclientVersion}"
implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient-cache', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: "${httpcoreVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: "${httpcoreVersion}"
//httpcomponents v5
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5-h2', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5-fluent', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.velocity', name: 'velocity', version: "${velocityVersion}"
implementation group: 'velocity', name: 'velocity-dep', version: "${velocitydepVersion}"
implementation group: 'org.freemarker', name: 'freemarker', version: "${freemarkerVersion}"
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: "${xmlbeansVersion}"
implementation group: 'org.apache.commons', name: 'commons-compress', version: "${commonscompressVersion}"
implementation group: 'org.apache.poi', name: 'poi', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-excelant', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml-full', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
//implementation group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: "${notyetcommonssslVersion}"
//tomcat embed Core Tomcat implementation
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-el', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: "${tomcatVersion}"
//apache log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jul', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4jVersion}"
//slf4j
implementation group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
//jboss-logging
implementation group: 'org.jboss.logging', name: 'jboss-logging', version: "${jbossloggingVersion}"
//spring
implementation group: 'org.springframework', name: 'spring-aop', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-aspects', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-beans', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-core', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-indexer', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-support', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-expression', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-instrument', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jcl', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jdbc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-jms', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-messaging', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-orm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-oxm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-tx', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-web', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webflux', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webmvc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-websocket', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
implementation group: 'org.springframework.retry', name: 'spring-retry', version: "${springretryVersion}"
testImplementation group: 'org.springframework', name: 'spring-test', version: "${springVersion}"
//spring-security
implementation group: 'org.springframework.security', name: 'spring-security-core', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-web', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: "${springSecurityVersion}"
//srpingboot
implementation group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-reactor-netty', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis-reactive', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: "${springBootVersion}"
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
//spring-boot-admin
implementation group: 'de.codecentric', name: 'spring-boot-admin-client', version: "${springbootadminVersion}"
implementation group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: "${springbootadminVersion}"
//spring-data
implementation group: 'org.springframework.data', name: 'spring-data-commons', version: "${springDataVersion}"
implementation group: 'org.springframework.data', name: 'spring-data-keyvalue', version: "${springDataVersion}"
//implementation group: 'org.springframework.data', name: 'spring-data-redis', version: "${springDataVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-core', version: "${springplugincoreVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-metadata', version: "${springpluginmetadataVersion}"
//spring cloud
implementation group: 'org.springframework.cloud', name: 'spring-cloud-commons', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-context', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: "${springcloudVersion}"
//spring-cloud-alibaba
implementation group: 'com.alibaba.spring', name: 'spring-context-support', version: "${springcloudalibabaspringVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-alibaba-commons', version: "${springcloudalibabaVersion}"
//alibaba nacos
implementation group: 'com.alibaba.nacos', name: 'nacos-client', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-auth-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-encryption-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-discovery', version: "${springcloudalibabaVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
//Message Queue
//kafka support
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
//rocketmq
implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}"
implementation group: 'io.github.aliyunmq', name: 'rocketmq-slf4j-api', version: '1.0.1'
implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}"
// https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}"
//saml see maxkey-lib
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
//implementation group: 'org.opensaml', name: 'xmltooling', version: "${xmltoolingVersion}"
implementation group: 'net.shibboleth.utilities', name: 'java-support', version: "${javasupportVersion}"
//jose-jwt
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusjosejwtVersion}"
implementation group: 'com.github.stephenc.jcip', name: 'jcip-annotations', version: "${jcipannotationsVersion}"
implementation group: 'net.minidev', name: 'json-smart', version: "${minidevjsonsmartVersion}"
implementation group: 'net.minidev', name: 'asm', version: "${minidevasmVersion}"
//oauth third party JustAuth
implementation group: 'com.xkcoding.http', name: 'simple-http', version: "${simplehttpVersion}"
implementation group: 'me.zhyd.oauth', name: 'JustAuth', version: "${JustAuthVersion}"
//common
implementation group: 'org.javassist', name: 'javassist', version: "${javassistVersion}"
implementation group: 'org.owasp.esapi', name: 'esapi', version: "${esapiVersion}"
//jakarta
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: "${jakartaactivationVersion}"
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: "${jakartaannotationVersion}"
implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: "${jakartamailapiVersion}"
implementation group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: "${jakartapersistenceapiVersion}"
implementation group: 'jakarta.transaction', name: 'jakarta.transaction-api', version: "${jakartatransactionapiVersion}"
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: "${jakartavalidationapiVersion}"
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: "${jakartaxmlbindapiVersion}"
//mail
implementation group: 'org.eclipse.angus', name: 'jakarta.mail', version: "${angusjakartamailVersion}"
implementation group: 'org.eclipse.angus', name: 'angus-activation', version: "${angusactivationVersion}"
//sun.xml.bind
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: "${xmlbindjaxbcoreVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: "${xmlbindjaxbimplVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: "${xmlbindjaxbxjcVersion}"
//crypto
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: "${bouncycastleVersion}"
implementation group: 'org.bouncycastle', name: 'bcprov-ext-jdk18on', version: "${bouncycastleVersion}"
//google
implementation group: 'com.google.crypto.tink', name: 'tink', version: "${tinkVersion}"
//kaptcha
implementation group: 'com.jhlabs', name: 'filters', version: "${jhlabsfiltersVersion}"
implementation group: 'com.github.penggle', name: 'kaptcha', version: "${kaptchaVersion}"
//json-gson
implementation group: 'com.google.code.gson', name: 'gson', version: "${gsonVersion}"
//json-jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jaxb-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jakarta-xmlbind-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml', name: 'classmate', version: "${classmateVersion}"
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: "${woodstoxVersion}"
//json-fastjson
implementation group: 'com.alibaba', name: 'fastjson', version: "${fastjsonVersion}"
//reactive
implementation group: 'org.reactivestreams', name: 'reactive-streams', version: "${reactivestreamsVersion}"
implementation group: 'io.projectreactor', name: 'reactor-core', version: "${reactorcoreVersion}"
implementation group: 'eu.tekul', name: 'szxcvbn_2.9.2', version: "${szxcvbnVersion}"
//database
implementation group: 'com.mysql', name: 'mysql-connector-j', version: "${mysqlconnectorjavaVersion}"
//implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}"
//implementation group: 'com.dameng', name: 'DmJdbcDriver18', version: "${dm8JdbcDriverVersion}"
//implementation group: 'com.highgo', name: 'HgdbJdbc', version: '6.2.3'
//implementation group: 'org.liquibase', name: 'liquibase-core', version: '4.3.5'
implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}"
implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}"
implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}"
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: "${caffeineVersion}"
//mybatis
implementation group: 'org.mybatis', name: 'mybatis', version: "${mybatisVersion}"
implementation group: 'org.mybatis', name: 'mybatis-spring', version: "${mybatisspringVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra', version: "${mybatisjpaextraVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra-spring-boot-starter', version: "${mybatisjpaextraVersion}"
//hibernate
implementation group: 'org.hibernate.validator', name: 'hibernate-validator', version: "${hibernateVersion}"
implementation group: 'org.hibernate', name: 'hibernate-validator-cdi', version: "${hibernateVersion}"
implementation group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: "${hibernateVersion}"
//usefull
implementation group: 'io.netty', name: 'netty-all', version: "${nettyVersion}"
implementation group: 'com.belerweb', name: 'pinyin4j', version: "${pinyin4jVersion}"
implementation group: 'org.jsoup', name: 'jsoup', version: "${jsoupVersion}"
implementation group: 'joda-time', name: 'joda-time', version: "${jodatimeVersion}"
implementation group: 'org.yaml', name: 'snakeyaml', version: "${snakeyamlVersion}"
implementation group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: "${nekohtmlVersion}"
implementation group: 'org.dom4j', name: 'dom4j', version: "${dom4jVersion}"
implementation group: 'org.jdom', name: 'jdom2', version: "${jdom2Version}"
implementation group: 'com.google.zxing', name: 'core', version: "${zxingcoreVersion}"
implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
implementation group: 'ognl', name: 'ognl', version: "${ognlVersion}"
implementation group: 'cglib', name: 'cglib', version: "${cglibVersion}"
implementation group: 'org.ow2.asm', name: 'asm', version: "${asmVersion}"
implementation group: 'aopalliance', name: 'aopalliance', version: "${aopallianceVersion}"
implementation group: 'org.aspectj', name: 'aspectjtools', version: "${aspectjtoolsVersion}"
implementation group: 'xalan', name: 'serializer', version: "${serializerVersion}"
implementation group: 'xml-resolver', name: 'xml-resolver', version: "${xmlresolverVersion}"
implementation group: 'org.apache.santuario', name: 'xmlsec', version: "${xmlsecVersion}"
//implementation group: 'org.ogce', name: 'xpp3', version: "${xpp3Version}"
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: "${xstreamVersion}"
implementation group: 'org.passay', name: 'passay', version: "${passayVersion}"
implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}"
//ip offline
implementation group: 'org.lionsoul', name: 'ip2region', version: "${ip2regionVersion}"
implementation group: 'com.maxmind.db', name: 'maxmind-db', version: "${maxminddbVersion}"
implementation group: 'com.maxmind.geoip2', name: 'geoip2', version: "${maxmindgeoip2Version}"
//micrometer
implementation group: 'io.micrometer', name: 'micrometer-commons', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-core', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-observation', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: "${micrometercoreVersion}"
implementation group: 'org.latencyutils', name: 'LatencyUtils', version: "${LatencyUtilsVersion}"
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: "${stax2apiVersion}"
implementation group: 'org.reflections', name: 'reflections', version: "${reflectionsVersion}"
//prometheus
implementation group: 'io.prometheus', name: 'simpleclient', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_common', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel_agent', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_common', version: "${prometheusVersion}"
//
implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: "${aliyunjavasdkcoreVersion}"
implementation group: 'io.opentracing', name: 'opentracing-api', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-noop', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-util', version: "${opentracingVersion}"
//aliyun-java-sdk-corejakarta.xml.bind
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
//
implementation group: 'com.tencentcloudapi', name: 'tencentcloud-sdk-java', version: "${tencentcloudsdkjavaVersion}"
//docs
implementation group: 'org.mapstruct', name: 'mapstruct', version: "${mapstructVersion}"
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-core-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-models-jakarta', version: "${swaggerV3Version}"
//springdoc
implementation group: 'io.github.classgraph', name: 'classgraph', version: "${classgraphVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-common', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-api', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: "${springdocVersion}"
//webjars
implementation group: 'org.webjars', name: 'webjars-locator-core', version: "${webjarslocatorcoreVersion}"
implementation group: 'org.webjars', name: 'webjars-locator', version: "${webjarslocatorVersion}"
implementation group: 'org.webjars', name: 'swagger-ui', version: "${swaggeruiVersion}"
//knife4j
implementation group: 'com.github.xiaoymin', name: 'knife4j-core', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-ui', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-jakarta-spring-boot-starter', version: "${knife4jVersion}"
//local jars
implementation fileTree(dir: "${rootDir}/maxkey-lib/", include: '*.jar')
}
jar {
def currentTime = java.time.ZonedDateTime.now()
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Vendor": project.vendor,
"Created-By": project.author,
"Implementation-Date": currentTime,
"Implementation-Version": project.version
)
}
}
task buildRelease() {
dependsOn assemble
//
println "subproject " + project.name + ", group " + project.group +" , version " + project.version
}
assemble.configure { finalizedBy buildRelease }
}
tasks.register("buildRelease") {
// group version
println "Root project " + project.name + ", group " + project.group +" , version " + project.version
// to build
println "Root project projectDir " + project.projectDir +" to " + project.buildDir
}
build.configure { finalizedBy buildRelease }
// In this section you declare the dependencies for your production and test code
dependencies {
}

@ -0,0 +1,538 @@
/*
* Copyright [2023] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MaxKey build file was auto generated by running the Gradle release.bat
*/
defaultTasks "clean", "build"
//Version define
ext {
}
def libjarsmapper=[
'maxkey-authentication-captcha' :'lib',
'maxkey-authentication-core' :'lib',
'maxkey-authentication-ip2region' :'lib',
'maxkey-authentication-otp' :'lib',
'maxkey-authentication-provider' :'lib',
'maxkey-authentication-sms' :'lib',
'maxkey-common' :'lib',
'maxkey-core' :'lib',
'maxkey-persistence' :'lib',
'maxkey-protocol-authorize' :'lib',
'maxkey-protocol-cas' :'lib',
'maxkey-protocol-desktop' :'lib',
'maxkey-protocol-extendapi' :'lib',
'maxkey-protocol-formbased' :'lib',
'maxkey-protocol-jwt' :'lib',
'maxkey-protocol-oauth-2.0' :'lib',
'maxkey-protocol-saml-2.0' :'lib',
'maxkey-protocol-tokenbased' :'lib',
'maxkey-web-resources' :'lib',
'maxkey-authentication-social' :'maxkey',
'maxkey-web-maxkey' :'maxkey',
'maxkey-web-mgt' :'maxkey_mgt',
'maxkey-synchronizer' :'maxkey_mgt',
'maxkey-synchronizer-activedirectory' :'maxkey_mgt',
'maxkey-synchronizer-common' :'maxkey_mgt',
'maxkey-synchronizer-jdbc' :'maxkey_mgt',
'maxkey-synchronizer-ldap' :'maxkey_mgt',
'maxkey-synchronizer-dingtalk' :'maxkey_mgt',
'maxkey-synchronizer-workweixin' :'maxkey_mgt',
'maxkey-synchronizer-reorgdept' :'maxkey_mgt',
'maxkey-web-openapi' :'maxkey_openapi',
'maxkey-web-api-rest' :'maxkey_openapi',
'maxkey-web-api-scim' :'maxkey_openapi',
]
configurations.all {
transitive = false//
}
//add support for Java
//apply plugin: 'java'
allprojects {
apply plugin: "java"
apply plugin: "eclipse"
//apply plugin: "pmd"
//apply plugin: "findbugs"
//apply plugin: "jdepend"
configurations.all {
transitive = false//
}
//java Version
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.encoding = 'UTF-8'
eclipse {
/*设置工程字符集*/
jdt {
File prefs = file('.settings/org.eclipse.core.resources.prefs')
if (prefs.exists()) {
prefs.write('eclipse.preferences.version=1\n')
prefs.append('encoding/<project>=UTF-8') //use UTF-8
}
}
}
}
buildscript {
repositories {
mavenCentral()
}
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
}
subprojects {
processResources {
from ('src/main/resources') {
include 'src/main/resources/*.*'
}
}
sourceSets {
main {
java {
srcDir 'src/main/java' //
}
}
}
repositories {
mavenLocal()
maven { url "https://maven.aliyun.com/repository/central"}
maven { url "https://maven.aliyun.com/repository/public"}
maven { url "https://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://repo1.maven.org/maven2" }
maven { url "https://build.shibboleth.net/nexus/content/repositories/releases" }
maven { url "https://mvnrepository.com/repos/central" }
maven { url "https://jcenter.bintray.com" }
maven { url "https://mvn.gt.igexin.com/nexus/content/repositories/releases"}
maven { url "https://plugins.gradle.org/m2" }
maven { url "https://oss.sonatype.org/content/repositories/releases" }
maven { url "https://maven.repository.redhat.com/ga" }
maven { url "https://repository.apache.org/content/repositories/releases" }
mavenCentral()
}
//all dependencies
dependencies {
//for Test and Compile
testImplementation group: 'junit', name: 'junit', version: "${junitVersion}"
compileOnly group: 'junit', name: 'junit', version: "${junitVersion}"
testImplementation group: 'org.mockito', name: 'mockito-all', version: "${mockitoallVersion}"
testImplementation group: 'xmlunit', name: 'xmlunit', version: "${xmlunitVersion}"
//apache
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: "${commonsbeanutilsVersion}"
implementation group: 'commons-codec', name: 'commons-codec', version: "${commonscodecVersion}"
implementation group: 'commons-collections', name: 'commons-collections', version: "${commonscollectionsVersion}"
implementation group: 'org.apache.commons', name: 'commons-collections4', version: "${commonscollections4Version}"
//implementation group: 'org.apache.commons', name: 'commons-csv', version: "${commonscsvVersion}"
implementation group: 'org.apache.commons', name: 'commons-text', version: "${commonstextVersion}"
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: "${commonsdbcp2Version}"
//implementation group: 'commons-dbutils', name: 'commons-dbutils', version: "${commonsdbutilsVersion}"
//implementation group: 'org.apache.commons', name: 'commons-digester3', version: "${commonsdigester3Version}"
//implementation group: 'commons-digester', name: 'commons-digester', version: "${commonsdigesterVersion}"
implementation group: 'commons-io', name: 'commons-io', version: "${commonsioVersion}"
implementation group: 'commons-lang', name: 'commons-lang', version: "${commonslangVersion}"
implementation group: 'org.apache.commons', name: 'commons-lang3', version: "${commonslang3Version}"
implementation group: 'commons-logging', name: 'commons-logging', version: "${commonsloggingVersion}"
implementation group: 'org.apache.commons', name: 'commons-pool2', version: "${commonspool2Version}"
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: "${commonshttpclientVersion}"
implementation group: 'commons-fileupload', name: 'commons-fileupload', version: "${commonsfileuploadVersion}"
implementation group: 'commons-validator', name: 'commons-validator', version: "${commonsvalidatorVersion}"
//httpcomponents v4
implementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: "${httpasyncclientVersion}"
implementation group: 'org.apache.httpcomponents', name: 'fluent-hc', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient-cache', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: "${httpcomponentsVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: "${httpcoreVersion}"
implementation group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: "${httpcoreVersion}"
//httpcomponents v5
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5-h2', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5-fluent', version: "${httpcomponentscore5Version}"
implementation group: 'org.apache.velocity', name: 'velocity', version: "${velocityVersion}"
implementation group: 'velocity', name: 'velocity-dep', version: "${velocitydepVersion}"
implementation group: 'org.freemarker', name: 'freemarker', version: "${freemarkerVersion}"
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: "${xmlbeansVersion}"
implementation group: 'org.apache.commons', name: 'commons-compress', version: "${commonscompressVersion}"
implementation group: 'org.apache.poi', name: 'poi', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-excelant', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-ooxml-full', version: "${poiVersion}"
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: "${poiVersion}"
//implementation group: 'org.apache.commons', name: 'not-yet-commons-ssl', version: "${notyetcommonssslVersion}"
//tomcat embed Core Tomcat implementation
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-el', version: "${tomcatVersion}"
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: "${tomcatVersion}"
//apache log4j
implementation group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-jul', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: "${log4jVersion}"
implementation group: 'org.apache.logging.log4j', name: 'log4j-web', version: "${log4jVersion}"
//slf4j
implementation group: 'org.slf4j', name: 'slf4j-api', version: "${slf4jVersion}"
//jboss-logging
implementation group: 'org.jboss.logging', name: 'jboss-logging', version: "${jbossloggingVersion}"
//spring
implementation group: 'org.springframework', name: 'spring-aop', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-aspects', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-beans', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-core', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-indexer', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-context-support', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-expression', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-instrument', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jcl', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-jdbc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-jms', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-messaging', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-orm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-oxm', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-tx', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-web', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webflux', version: "${springVersion}"
implementation group: 'org.springframework', name: 'spring-webmvc', version: "${springVersion}"
//implementation group: 'org.springframework', name: 'spring-websocket', version: "${springVersion}"
// https://mvnrepository.com/artifact/org.springframework.retry/spring-retry
implementation group: 'org.springframework.retry', name: 'spring-retry', version: "${springretryVersion}"
testImplementation group: 'org.springframework', name: 'spring-test', version: "${springVersion}"
//spring-security
implementation group: 'org.springframework.security', name: 'spring-security-core', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-web', version: "${springSecurityVersion}"
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: "${springSecurityVersion}"
//srpingboot
implementation group: 'org.springframework.boot', name: 'spring-boot', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-actuator-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-freemarker', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-reactor-netty', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: "${springBootVersion}"
//implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis-reactive', version: "${springBootVersion}"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: "${springBootVersion}"
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
//spring-boot-admin
implementation group: 'de.codecentric', name: 'spring-boot-admin-client', version: "${springbootadminVersion}"
implementation group: 'de.codecentric', name: 'spring-boot-admin-starter-client', version: "${springbootadminVersion}"
//spring-data
implementation group: 'org.springframework.data', name: 'spring-data-commons', version: "${springDataVersion}"
implementation group: 'org.springframework.data', name: 'spring-data-keyvalue', version: "${springDataVersion}"
//implementation group: 'org.springframework.data', name: 'spring-data-redis', version: "${springDataVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-core', version: "${springplugincoreVersion}"
//implementation group: 'org.springframework.plugin', name: 'spring-plugin-metadata', version: "${springpluginmetadataVersion}"
//spring cloud
implementation group: 'org.springframework.cloud', name: 'spring-cloud-commons', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-context', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springcloudVersion}"
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: "${springcloudVersion}"
//spring-cloud-alibaba
implementation group: 'com.alibaba.spring', name: 'spring-context-support', version: "${springcloudalibabaspringVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-alibaba-commons', version: "${springcloudalibabaVersion}"
//alibaba nacos
implementation group: 'com.alibaba.nacos', name: 'nacos-client', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-auth-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.nacos', name: 'nacos-encryption-plugin', version: "${alibabanacosclientVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-discovery', version: "${springcloudalibabaVersion}"
implementation group: 'com.alibaba.cloud', name: 'spring-cloud-starter-alibaba-nacos-config', version: "${springcloudalibabaVersion}"
//Message Queue
//kafka support
// https://mvnrepository.com/artifact/org.apache.kafka/kafka-clients
implementation group: 'org.apache.kafka', name: 'kafka-clients', version: "${kafkaclientsVersion}"
// https://mvnrepository.com/artifact/org.springframework.kafka/spring-kafka
implementation group: 'org.springframework.kafka', name: 'spring-kafka', version: "${springkafkaVersion}"
//rocketmq
implementation group: 'org.apache.rocketmq', name: 'rocketmq-common', version: "${rocketmqclientVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-remoting', version: "${rocketmqclientVersion}"
implementation group: 'io.github.aliyunmq', name: 'rocketmq-slf4j-api', version: '1.0.1'
implementation group: 'org.apache.rocketmq', name: 'rocketmq-client', version: "${rocketmqclientVersion}"
// https://mvnrepository.com/artifact/org.apache.rocketmq/rocketmq-spring-boot
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot', version: "${rocketmqspringbootVersion}"
implementation group: 'org.apache.rocketmq', name: 'rocketmq-spring-boot-starter', version: "${rocketmqspringbootVersion}"
//saml see maxkey-lib
//implementation group: 'org.opensaml', name: 'opensaml', version: "${opensamlVersion}"
//implementation group: 'org.opensaml', name: 'openws', version: "${openwsVersion}"
//implementation group: 'org.opensaml', name: 'xmltooling', version: "${xmltoolingVersion}"
implementation group: 'net.shibboleth.utilities', name: 'java-support', version: "${javasupportVersion}"
//jose-jwt
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusjosejwtVersion}"
implementation group: 'com.github.stephenc.jcip', name: 'jcip-annotations', version: "${jcipannotationsVersion}"
implementation group: 'net.minidev', name: 'json-smart', version: "${minidevjsonsmartVersion}"
implementation group: 'net.minidev', name: 'asm', version: "${minidevasmVersion}"
//oauth third party JustAuth
implementation group: 'com.xkcoding.http', name: 'simple-http', version: "${simplehttpVersion}"
implementation group: 'me.zhyd.oauth', name: 'JustAuth', version: "${JustAuthVersion}"
//common
implementation group: 'org.javassist', name: 'javassist', version: "${javassistVersion}"
implementation group: 'org.owasp.esapi', name: 'esapi', version: "${esapiVersion}"
//jakarta
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: "${jakartaactivationVersion}"
implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: "${jakartaannotationVersion}"
implementation group: 'jakarta.mail', name: 'jakarta.mail-api', version: "${jakartamailapiVersion}"
implementation group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: "${jakartapersistenceapiVersion}"
implementation group: 'jakarta.transaction', name: 'jakarta.transaction-api', version: "${jakartatransactionapiVersion}"
implementation group: 'jakarta.validation', name: 'jakarta.validation-api', version: "${jakartavalidationapiVersion}"
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: "${jakartaxmlbindapiVersion}"
//mail
implementation group: 'org.eclipse.angus', name: 'jakarta.mail', version: "${angusjakartamailVersion}"
implementation group: 'org.eclipse.angus', name: 'angus-activation', version: "${angusactivationVersion}"
//sun.xml.bind
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: "${xmlbindjaxbcoreVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: "${xmlbindjaxbimplVersion}"
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: "${xmlbindjaxbxjcVersion}"
//crypto
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: "${bouncycastleVersion}"
implementation group: 'org.bouncycastle', name: 'bcprov-ext-jdk18on', version: "${bouncycastleVersion}"
//google
implementation group: 'com.google.crypto.tink', name: 'tink', version: "${tinkVersion}"
//kaptcha
implementation group: 'com.jhlabs', name: 'filters', version: "${jhlabsfiltersVersion}"
implementation group: 'com.github.penggle', name: 'kaptcha', version: "${kaptchaVersion}"
//json-gson
implementation group: 'com.google.code.gson', name: 'gson', version: "${gsonVersion}"
//json-jackson
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jaxb-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-jakarta-xmlbind-annotations', version: "${jacksonVersion}"
implementation group: 'com.fasterxml', name: 'classmate', version: "${classmateVersion}"
implementation group: 'com.fasterxml.woodstox', name: 'woodstox-core', version: "${woodstoxVersion}"
//json-fastjson
implementation group: 'com.alibaba', name: 'fastjson', version: "${fastjsonVersion}"
//reactive
implementation group: 'org.reactivestreams', name: 'reactive-streams', version: "${reactivestreamsVersion}"
implementation group: 'io.projectreactor', name: 'reactor-core', version: "${reactorcoreVersion}"
implementation group: 'eu.tekul', name: 'szxcvbn_2.9.2', version: "${szxcvbnVersion}"
//database
implementation group: 'com.mysql', name: 'mysql-connector-j', version: "${mysqlconnectorjavaVersion}"
//implementation group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}"
//implementation group: 'com.dameng', name: 'DmJdbcDriver18', version: "${dm8JdbcDriverVersion}"
//implementation group: 'com.highgo', name: 'HgdbJdbc', version: '6.2.3'
//implementation group: 'org.liquibase', name: 'liquibase-core', version: '4.3.5'
implementation group: 'com.alibaba', name: 'druid', version: "${druidVersion}"
implementation group: 'com.alibaba', name: 'druid-spring-boot-starter', version: "${druidspringbootstarterVersion}"
implementation group: 'redis.clients', name: 'jedis', version: "${jedisVersion}"
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: "${caffeineVersion}"
//mybatis
implementation group: 'org.mybatis', name: 'mybatis', version: "${mybatisVersion}"
implementation group: 'org.mybatis', name: 'mybatis-spring', version: "${mybatisspringVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra', version: "${mybatisjpaextraVersion}"
//implementation group: 'org.dromara.mybatis-jpa-extra', name: 'mybatis-jpa-extra-spring-boot-starter', version: "${mybatisjpaextraVersion}"
//hibernate
implementation group: 'org.hibernate.validator', name: 'hibernate-validator', version: "${hibernateVersion}"
implementation group: 'org.hibernate', name: 'hibernate-validator-cdi', version: "${hibernateVersion}"
implementation group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: "${hibernateVersion}"
//usefull
implementation group: 'io.netty', name: 'netty-all', version: "${nettyVersion}"
implementation group: 'com.belerweb', name: 'pinyin4j', version: "${pinyin4jVersion}"
implementation group: 'org.jsoup', name: 'jsoup', version: "${jsoupVersion}"
implementation group: 'joda-time', name: 'joda-time', version: "${jodatimeVersion}"
implementation group: 'org.yaml', name: 'snakeyaml', version: "${snakeyamlVersion}"
implementation group: 'net.sourceforge.nekohtml', name: 'nekohtml', version: "${nekohtmlVersion}"
implementation group: 'org.dom4j', name: 'dom4j', version: "${dom4jVersion}"
implementation group: 'org.jdom', name: 'jdom2', version: "${jdom2Version}"
implementation group: 'com.google.zxing', name: 'core', version: "${zxingcoreVersion}"
implementation group: 'com.google.guava', name: 'guava', version: "${guavaVersion}"
implementation group: 'ognl', name: 'ognl', version: "${ognlVersion}"
implementation group: 'cglib', name: 'cglib', version: "${cglibVersion}"
implementation group: 'org.ow2.asm', name: 'asm', version: "${asmVersion}"
implementation group: 'aopalliance', name: 'aopalliance', version: "${aopallianceVersion}"
implementation group: 'org.aspectj', name: 'aspectjtools', version: "${aspectjtoolsVersion}"
implementation group: 'xalan', name: 'serializer', version: "${serializerVersion}"
implementation group: 'xml-resolver', name: 'xml-resolver', version: "${xmlresolverVersion}"
implementation group: 'org.apache.santuario', name: 'xmlsec', version: "${xmlsecVersion}"
//implementation group: 'org.ogce', name: 'xpp3', version: "${xpp3Version}"
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version: "${xstreamVersion}"
implementation group: 'org.passay', name: 'passay', version: "${passayVersion}"
implementation group: 'org.quartz-scheduler', name: 'quartz', version: "${quartzVersion}"
//ip offline
implementation group: 'org.lionsoul', name: 'ip2region', version: "${ip2regionVersion}"
implementation group: 'com.maxmind.db', name: 'maxmind-db', version: "${maxminddbVersion}"
implementation group: 'com.maxmind.geoip2', name: 'geoip2', version: "${maxmindgeoip2Version}"
//micrometer
implementation group: 'io.micrometer', name: 'micrometer-commons', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-core', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-observation', version: "${micrometercoreVersion}"
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: "${micrometercoreVersion}"
implementation group: 'org.latencyutils', name: 'LatencyUtils', version: "${LatencyUtilsVersion}"
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: "${stax2apiVersion}"
implementation group: 'org.reflections', name: 'reflections', version: "${reflectionsVersion}"
//prometheus
implementation group: 'io.prometheus', name: 'simpleclient', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_common', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_tracer_otel_agent', version: "${prometheusVersion}"
implementation group: 'io.prometheus', name: 'simpleclient_common', version: "${prometheusVersion}"
//
implementation group: 'com.aliyun', name: 'aliyun-java-sdk-core', version: "${aliyunjavasdkcoreVersion}"
implementation group: 'io.opentracing', name: 'opentracing-api', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-noop', version: "${opentracingVersion}"
implementation group: 'io.opentracing', name: 'opentracing-util', version: "${opentracingVersion}"
//aliyun-java-sdk-corejakarta.xml.bind
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
//
implementation group: 'com.tencentcloudapi', name: 'tencentcloud-sdk-java', version: "${tencentcloudsdkjavaVersion}"
//docs
implementation group: 'org.mapstruct', name: 'mapstruct', version: "${mapstructVersion}"
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-core-jakarta', version: "${swaggerV3Version}"
implementation group: 'io.swagger.core.v3', name: 'swagger-models-jakarta', version: "${swaggerV3Version}"
//springdoc
implementation group: 'io.github.classgraph', name: 'classgraph', version: "${classgraphVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-common', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-api', version: "${springdocVersion}"
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: "${springdocVersion}"
//webjars
implementation group: 'org.webjars', name: 'webjars-locator-core', version: "${webjarslocatorcoreVersion}"
implementation group: 'org.webjars', name: 'webjars-locator', version: "${webjarslocatorVersion}"
implementation group: 'org.webjars', name: 'swagger-ui', version: "${swaggeruiVersion}"
//knife4j
implementation group: 'com.github.xiaoymin', name: 'knife4j-core', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-ui', version: "${knife4jVersion}"
implementation group: 'com.github.xiaoymin', name: 'knife4j-openapi3-jakarta-spring-boot-starter', version: "${knife4jVersion}"
//local jars
implementation fileTree(dir: "${rootDir}/maxkey-lib/", include: '*.jar')
}
jar {
def currentTime = java.time.ZonedDateTime.now()
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Vendor": project.vendor,
"Created-By": project.author,
"Implementation-Date": currentTime,
"Implementation-Version": project.version
)
}
}
tasks.register("buildRelease",Copy) {
dependsOn assemble
// group version
println "subproject " + project.name + ", group " + project.group +" , version " + project.version
//copy
into "$rootDir/build/maxkey-jars/"
from "$buildDir/libs/"
include '*.jar'
}
tasks.register("copyLibJars",Copy) {
if (libjarsmapper["${project.name}"] != null){
into "$rootDir/build/MaxKey-v${project.version}GA/"+libjarsmapper["${project.name}"]
from "$buildDir/libs/"
include '*.jar'
}
}
assemble.configure { finalizedBy buildRelease,copyLibJars }
}
//copy Dep Jars to /build/maxkey-depjars,only maxkey-common deps
project('maxkey-common') {
task createReleaseDir(type: Copy){
def paths = ["$rootDir/build/MaxKey-v${project.version}GA",
"$rootDir/build/MaxKey-v${project.version}GA/maxkey",
"$rootDir/build/MaxKey-v${project.version}GA/maxkey_mgt",
"$rootDir/build/MaxKey-v${project.version}GA/lib"];
//createDir
paths.forEach(){path->
File dir=new File(path);
if (!dir.exists()){
print("create "+path+"\n")
dir.mkdirs();
}
};
}
task copyDepJars (type: Copy){
dependsOn assemble
println "copy Dep Jars to $rootDir/build/MaxKey-v${project.version}GA/lib"
//copy runtime
from configurations.runtimeClasspath
into "$rootDir/build/MaxKey-v${project.version}GA/lib";
}
build.configure { finalizedBy copyDepJars }
}
tasks.register("buildRelease") {
dependsOn 'copyShellScript','copyWindowsShellScript'
// group version
println "Root project " + project.name + ", group " + project.group +" , version " + project.version
// to build
println "Root project projectDir " + project.projectDir +" to " + project.buildDir
}
tasks.register("copyShellScript",Copy) {
println "project copyMaxKeyShellScript .";
from "$rootDir/shellscript/"
into "$rootDir/build/MaxKey-v${project.version}GA/shellscript/";
}
tasks.register("copyWindowsShellScript",Copy) {
println "project copyMaxKeyWindowsShellScript .";
from "$rootDir/shellscript/windows"
into "$rootDir/build/MaxKey-v${project.version}GA/";
}
build.configure {
finalizedBy buildRelease
println ""
println "Gradle version is ${GradleVersion.current().version}"
}

@ -0,0 +1,87 @@
version: '3'
networks:
maxkey.top:
driver: bridge
services:
mysql:
image: mysql:8.0.32
container_name: maxkey-mysql
hostname: maxkey-mysql
volumes:
- ./docker-mysql/data:/var/lib/mysql
- ./docker-mysql/logs:/var/log/mysql
- ./docker-mysql/conf.d:/etc/mysql/conf.d
- ./docker-mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
- MYSQL_ROOT_PASSWORD=maxkey
ports:
- "3306:3306"
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
- maxkey.top
maxkey-frontend:
image: maxkeytop/maxkey-frontend:latest
container_name: maxkey-frontend
hostname: maxkey-frontend
environment:
- TZ=Asia/Shanghai
ports:
- "8527:8527"
networks:
- maxkey.top
maxkey:
image: maxkeytop/maxkey:latest
container_name: maxkey
hostname: maxkey
environment:
- DATABASE_HOST=maxkey-mysql
- DATABASE_PORT=3306
- DATABASE_NAME=maxkey
- DATABASE_USER=root
- DATABASE_PWD=maxkey
ports:
- "9527:9527"
networks:
- maxkey.top
maxkey-mgt:
image: maxkeytop/maxkey-mgt:latest
container_name: maxkey-mgt
hostname: maxkey-mgt
environment:
- DATABASE_HOST=maxkey-mysql
- DATABASE_PORT=3306
- DATABASE_NAME=maxkey
- DATABASE_USER=root
- DATABASE_PWD=maxkey
ports:
- "9526:9526"
networks:
- maxkey.top
maxkey-mgt-frontend:
image: maxkeytop/maxkey-mgt-frontend:latest
container_name: maxkey-mgt-frontend
hostname: maxkey-mgt-frontend
environment:
- TZ=Asia/Shanghai
ports:
- "8526:8526"
networks:
- maxkey.top
maxkey-nginx:
image: nginx:latest
container_name: maxkey-nginx
hostname: maxkey-nginx
volumes:
- ./docker-nginx:/etc/nginx/conf.d
ports:
- "80:80"
networks:
- maxkey.top

@ -0,0 +1,5 @@
# 一份用于构建 mysql 镜像的 Dockerfile
- 编辑 my.cnf 来变更配置
- 上传 sql 脚本到 docker-entrypoint-initdb.d 目录下,可以在首次启动时初始化数据库
- docker-entrypoint-initdb.d下仅保留最近发行版其余版本在工程代码sql目录下均使用版本的命名方式

@ -0,0 +1,39 @@
# Percona Server template configuration
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server=utf8
lower_case_table_names=1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/lib/mysql/error.log
slow_query_log=on;
slow-query-log-file=/var/lib/mysql/mysql-slow.log
pid-file=/var/run/mysqld/mysqld.pid
sql_mode = STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8

@ -0,0 +1,7 @@
create database if not exists `maxkey` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */ ;
use maxkey ;
source /docker-entrypoint-initdb.d/latest/maxkey.sql ;
source /docker-entrypoint-initdb.d/latest/maxkey_data.sql ;

File diff suppressed because one or more lines are too long

@ -0,0 +1,9 @@
#MaxKey nginx Proxy Docker Build
FROM nginx
COPY ./default.conf /etc/nginx/conf.d/default.conf
#CMD ["nginx", "-g", "daemon off;"]

@ -0,0 +1,41 @@
#MaxKey nginx Proxy Server
server {
listen 80;
server_name localhost;
proxy_set_header host $host; # 转发请求时将请求的域名一起转发
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
#服务器集群路径
#认证后端
location /sign/ {
proxy_pass http://maxkey:9527/sign/;
}
#认证前端
location /maxkey/ {
proxy_pass http://maxkey-frontend:8527/maxkey/;
}
#管理后端
location /maxkey-mgt-api/ {
proxy_pass http://maxkey-mgt:9526/maxkey-mgt-api/;
}
#管理前端
location /maxkey-mgt/ {
proxy_pass http://maxkey-mgt-frontend:8526/maxkey-mgt/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

@ -0,0 +1,21 @@
echo "clear REPOSITORY IMAGE MaxKey ... "
#maxkey-nginx proxy
docker rmi maxkeytop/maxkey-nginx
#maxkey-frontend
docker rmi maxkeytop/maxkey-frontend
#maxkey-mgt-frontend
docker rmi maxkeytop/maxkey-mgt-frontend
#maxkey
docker rmi maxkeytop/maxkey
#maxkey-mgt
docker rmi maxkeytop/maxkey-mgt
#MySQL
docker rmi maxkeytop/mysql
echo "clear REPOSITORY IMAGE done."

@ -0,0 +1,29 @@
echo "network create "
docker network create maxkey.top
mysql_version=8.0.32
#MySQL
docker pull mysql:$mysql_version
docker image tag mysql:$mysql_version maxkeytop/mysql
#maxkey
docker pull maxkeytop/maxkey:latest
#maxkey-mgt
docker pull maxkeytop/maxkey-mgt:latest
#maxkey-frontend
docker pull maxkeytop/maxkey-frontend:latest
#maxkey-mgt-frontend
docker pull maxkeytop/maxkey-mgt-frontend:latest
#maxkey-nginx proxy
cd docker-nginx
docker build -f Dockerfile -t maxkeytop/maxkey-nginx .
cd ..
echo "installed done."

@ -0,0 +1,23 @@
echo "rm MaxKey ... "
./maxkey_docker_stop.sh
#maxkey-nginx proxy
docker rm maxkey-nginx
#maxkey-frontend
docker rm maxkey-frontend
#maxkey-mgt-frontend
docker rm maxkey-mgt-frontend
#maxkey
docker rm maxkey
#maxkey-mgt
docker rm maxkey-mgt
#MySQL
docker rm maxkey-mysql
echo "rm done."

@ -0,0 +1,61 @@
echo "start MaxKey ... "
#MySQL
docker run -p 3306:3306 \
-v ./docker-mysql/data:/var/lib/mysql \
-v ./docker-mysql/logs:/var/log/mysql \
-v ./docker-mysql/conf.d:/etc/mysql/conf.d \
-v ./docker-mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d \
--name maxkey-mysql \
--hostname maxkey-mysql \
--network maxkey.top \
-e MYSQL_ROOT_PASSWORD=maxkey \
-d maxkeytop/mysql:latest
#maxkey
docker run -p 9527:9527 \
-e DATABASE_HOST=maxkey-mysql \
-e DATABASE_PORT=3306 \
-e DATABASE_NAME=maxkey \
-e DATABASE_USER=root \
-e DATABASE_PWD=maxkey \
--name maxkey \
--hostname maxkey \
--network maxkey.top \
-d maxkeytop/maxkey:latest
#maxkey-mgt
docker run -p 9526:9526 \
-e DATABASE_HOST=maxkey-mysql \
-e DATABASE_PORT=3306 \
-e DATABASE_NAME=maxkey \
-e DATABASE_USER=root \
-e DATABASE_PWD=maxkey \
--name maxkey-mgt \
--hostname maxkey-mgt \
--network maxkey.top \
-d maxkeytop/maxkey-mgt:latest
#maxkey-frontend
docker run -p 8527:8527 \
--name maxkey-frontend \
--hostname maxkey-frontend \
--network maxkey.top \
-d maxkeytop/maxkey-frontend:latest
#maxkey-mgt-frontend
docker run -p 8526:8526 \
--name maxkey-mgt-frontend \
--hostname maxkey-mgt-frontend \
--network maxkey.top \
-d maxkeytop/maxkey-mgt-frontend:latest
#maxkey-nginx proxy
docker run -p 80:80 \
--name maxkey-nginx \
--hostname maxkey-nginx \
--network maxkey.top \
-d maxkeytop/maxkey-nginx
docker ps -a
echo "started done."

@ -0,0 +1,21 @@
echo "stop MaxKey ... "
#maxkey-nginx proxy
docker stop maxkey-nginx
#maxkey-frontend
docker stop maxkey-frontend
#maxkey-mgt-frontend
docker stop maxkey-mgt-frontend
#maxkey
docker stop maxkey
#maxkey-mgt
docker stop maxkey-mgt
#MySQL
docker stop maxkey-mysql
echo "stoped done."

@ -0,0 +1,207 @@
#/*
# * Copyright [2023] [MaxKey of copyright http://www.maxkey.top]
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# */
#maxkey properties
group =org.dromara.maxkey
version =4.0.2
vendor =https://www.maxkey.top
author =MaxKeyTop
#docker jib image
jibFromImage =eclipse-temurin:17-jre
jibToImage =maxkeytop
jibToAuthUsername =maxkeytop
jibToAuthPassword =docker registry credential
#maxkey used jars version
#spring
springVersion =6.0.17
springBootVersion =3.1.8
springSecurityVersion =6.1.6
springDataVersion =3.0.3
springkafkaVersion =3.0.13
springretryVersion =1.3.3
#spring plugin
springplugincoreVersion =3.0.0
springpluginmetadataVersion =3.0.0
#spring cloud
springcloudVersion =4.0.4
#spring cloud alibaba
springcloudalibabaVersion =2022.0.0.0
springcloudalibabaspringVersion =1.0.11
springcloudalibabacsplVersion =1.8.5
alibabanacosclientVersion =2.2.3
#Apache commons
commonsbeanutilsVersion =1.9.4
commonscodecVersion =1.15
commonscollectionsVersion =3.2.2
commonscollections4Version =4.4
commonscompressVersion =1.21
commonscsvVersion =1.7
commonstextVersion =1.9
commonsdbcp2Version =2.9.0
commonsdbutilsVersion =1.7
commonsdigester3Version =3.2
commonsdigesterVersion =2.1
commonsioVersion =2.8.0
commonslangVersion =2.6
commonslang3Version =3.12.0
commonsloggingVersion =1.2
commonspool2Version =2.11.1
commonshttpclientVersion =3.1
commonsfileuploadVersion =1.5
commonsvalidatorVersion =1.7
#Apache Http
#v4
httpcomponentsVersion =4.5.14
httpcoreVersion =4.4.6
httpasyncclientVersion =4.1.5
#v5
httpcomponentscore5Version =5.2.1
#Libs
velocityVersion =1.7
velocitydepVersion =1.4
freemarkerVersion =2.3.32
xmlbeansVersion =5.0.2
poiVersion =5.2.3
#tomcat
tomcatVersion =10.1.18
#logs
log4jVersion =2.22.1
slf4jVersion =2.0.11
jbossloggingVersion =3.5.0.Final
#Messaging Kafka & RocketMQ
kafkaclientsVersion =3.4.0
rocketmqclientVersion =5.1.0
rocketmqspringbootVersion =2.2.3
#google
jibGradlePluginVersion =3.3.2
jhlabsfiltersVersion =2.0.235-1
kaptchaVersion =2.3.2
guavaVersion =31.1-jre
tinkVersion =1.8.0
zxingcoreVersion =3.5.1
concurrentlinkedhashmaplruVersion =1.4.2
#json
gsonVersion =2.10.1
jacksonVersion =2.16.1
fastjsonVersion =1.2.83
minidevjsonsmartVersion =2.4.5
#database
mysqlconnectorjavaVersion =8.0.32
dm8JdbcDriverVersion =8.1.2.192
postgresqlVersion =42.4.1
druidVersion =1.2.16
druidspringbootstarterVersion =1.2.16
jedisVersion =4.3.2
caffeineVersion =3.1.5
hibernateVersion =7.0.5.Final
mybatisVersion =3.5.15
mybatisspringVersion =3.0.2
mybatisjpaextraVersion =3.2
#saml
opensamlVersion =2.6.6
openwsVersion =1.5.6
xmltoolingVersion =1.4.6
javasupportVersion =8.0.0
#jakarta
jakartaannotationVersion =2.1.1
jakartaactivationVersion =2.1.1
jakartamailapiVersion =2.1.1
jakartapersistenceapiVersion =3.0.0
jakartatransactionapiVersion =2.0.1
jakartavalidationapiVersion =3.0.2
jakartaxmlbindapiVersion =3.0.1
#mail
angusjakartamailVersion =2.0.1
angusactivationVersion =2.0.0
#xml
xmlbindjaxbcoreVersion =3.0.2
xmlbindjaxbimplVersion =3.0.2
xmlbindjaxbxjcVersion =3.0.2
#jwt
nimbusjosejwtVersion =9.31
jcipannotationsVersion =1.0-1
#others
thymeleafVersion =3.0.15.RELEASE
nettyVersion =4.1.65.Final
hazelcastVersion =4.2.2
attoparserVersion =2.0.5.RELEASE
unbescapeVersion =1.1.6.RELEASE
woodstoxVersion =6.2.8
bouncycastleVersion =1.71
junitVersion =4.11
xmlunitVersion =1.6
mockitoallVersion =1.10.19
minidevasmVersion =1.0.2
javassistVersion =3.29.0-GA
esapiVersion =2.2.0.0
jtaVersion =1.1
validationapiVersion =2.0.1.Final
jsr173Version =1.0
jaxbapiVersion =2.3.1
classmateVersion =1.5.1
reactivestreamsVersion =1.0.4
reactorcoreVersion =3.5.3
reactornettyVersion =1.1.4
reactorextraVersion =3.5.0
szxcvbnVersion =0.2
nekohtmlVersion =1.9.22
ognlVersion =3.3.3
cglibVersion =3.3.0
asmVersion =9.4
aopallianceVersion =1.0
aspectjtoolsVersion =1.9.9.1
evictorVersion =1.0.0
lettuceVersion =6.1.9.RELEASE
reflectionsVersion =0.10.2
#xml
jdom2Version =2.0.6.1
dom4jVersion =2.1.4
serializerVersion =2.7.2
xmlresolverVersion =1.2
xmlsecVersion =2.1.7
xpp3Version =1.1.6
xstreamVersion =1.4.19
passayVersion =1.6.2
LatencyUtilsVersion =2.0.3
stax2apiVersion =4.2.1
#tools
quartzVersion =2.3.2
springbootadminVersion =2.7.3
jodatimeVersion =2.12.2
snakeyamlVersion =2.0
ip2regionVersion =2.7.0
maxminddbVersion =3.0.0
maxmindgeoip2Version =4.0.1
pinyin4jVersion =2.5.1
jsoupVersion =1.15.4
micrometercoreVersion =1.10.5
prometheusVersion =0.16.0
mapstructVersion =1.5.3.Final
JustAuthVersion =1.16.5
simplehttpVersion =1.0.5
#doc
swaggerV3Version =2.2.8
classgraphVersion =4.8.149
webjarslocatorcoreVersion =0.52
webjarslocatorVersion =0.46
swaggeruiVersion =4.18.1
springdocVersion =2.0.2
knife4jVersion =4.0.0
#sdk
aliyunjavasdkcoreVersion =4.6.4
opentracingVersion =0.33.0
tencentcloudsdkjavaVersion =3.1.33

Binary file not shown.

@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

244
gradlew vendored

@ -0,0 +1,244 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ -0,0 +1,74 @@
# cas-springboot-demo使用
源代码地址 https://gitee.com/dromara/MaxKey/tree/main/integrations/cas-springboot-demo
感谢 xiazhenyou 提供Demo。
# cas-springboot-demo
基于spring boot配置cas客户端
demo分别写了三个请求:拦截请求 test1/index,test1/index1 以及不拦截请求test1/index2,
## 第一步引入cas 客户端所需包
<dependency>
<groupId>net.unicon.cas</groupId>
<artifactId>cas-client-autoconfig-support</artifactId>
<version>2.3.0-GA</version>
</dependency>
## 第二部配置spring boot 配置文件
```
server:
port: 8989
cas:
# cas服务端地址
server-url-prefix: http://sso.maxkey.top/sign/authz/cas/
# cas服务端登陆地址
server-login-url: http://sso.maxkey.top/sign/authz/cas/login
# 客户端访问地址
client-host-url: http://localhost:8989/
# 认证方式默认cas
validation-type: cas
# 客户端需要拦截的URL地址
authentication-url-patterns:
- /test1/index
- /test1/index1
```
扩展配置项
````
cas.authentication-url-patterns
cas.validation-url-patterns
cas.request-wrapper-url-patterns
cas.assertion-thread-local-url-patterns
cas.gateway
cas.use-session
cas.redirect-after-validation
cas.allowed-proxy-chains
cas.proxy-callback-url
cas.proxy-receptor-url
cas.accept-any-proxy
server.context-parameters.renew
````
## 第三部 在application启动类上加上 @EnableCasClient 注解
```java
@SpringBootApplication
@EnableCasClient
public class CasClientDemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
```
## 第四步 在代码中获取登录用户信息
``` java
@GetMapping("test1/index1")
public String index1(HttpServletRequest request){
String token =request.getParameter("token");
System.out.println("token : "+token);
Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
String username= assertion.getPrincipal().getName();
System.out.println(username);
return "test index cas拦截正常,登录账号:"+username;
}
```

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>net.maxsso</groupId>
<artifactId>cas-springboot-demo</artifactId>
<version>1.0</version>
<name>cas-springboot-demo</name>
<description>CAS Client Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>sso.maxkey</groupId>-->
<!-- <artifactId>maxkey-client-sdk</artifactId>-->
<!-- <version>2.0</version>-->
<!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/net.unicon.cas/cas-client-autoconfig-support -->
<dependency>
<groupId>net.unicon.cas</groupId>
<artifactId>cas-client-autoconfig-support</artifactId>
<version>2.3.0-GA</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,15 @@
package net.maxsso.cas.demo;
import net.unicon.cas.client.configuration.EnableCasClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableCasClient
public class CasClientDemoApplication {
public static void main(String[] args) {
SpringApplication.run(CasClientDemoApplication.class, args);
}
}

@ -0,0 +1,61 @@
package net.maxsso.cas.demo.contorller;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.validation.Assertion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* @ClassName TestController
* @Description
* @menu
* @Author xiazhenyou
* @Date 2020/7/22 9:45
* @Version 1.0
**/
@RestController
public class TestController {
@GetMapping("test1/index")
public String index(HttpServletRequest request){
String token =request.getParameter("token");
System.out.println("token : "+token);
Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
String username= assertion.getPrincipal().getName();
System.out.println(username);
return "test1 index cas拦截正常,登录账号:"+username;
}
@GetMapping("test1/index1")
public String index1(HttpServletRequest request){
String token =request.getParameter("token");
System.out.println("token : "+token);
Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
String username= assertion.getPrincipal().getName();
System.out.println(username);
return "test index cas拦截正常,登录账号:"+username;
}
/**
* cas
* @param request
* @return
*/
@GetMapping("test1/index2")
public String index2(HttpServletRequest request){
// String token =request.getParameter("token");
// System.out.println("token : "+token);
// Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
//
// String username= assertion.getPrincipal().getName();
// System.out.println(username);
return "cas 未拦截";
}
}

@ -0,0 +1,11 @@
server:
port: 8989
cas:
server-url-prefix: http://sso.maxkey.top/sign/authz/cas/
server-login-url: http://sso.maxkey.top/sign/authz/cas/login
client-host-url: http://127.0.0.1:8989/
validation-type: cas
# 拦截的URL地址
authentication-url-patterns:
- /test1/index
- /test1/index1

@ -0,0 +1,13 @@
# JustAuth 源码地址
https://github.com/justauth/JustAuth
# 文档地址
https://justauth.wiki/guide/quickstart/how-to-use
# 视频演示
https://b23.tv/8eZQCJD
【jeesite+ruoyi+ruoyi-vue plus+maxkey+JustAuth+oauthor2统一认证统一门户演示-哔哩哔哩】

File diff suppressed because it is too large Load Diff

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-parent</artifactId>
<version>5.2.1-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<artifactId>jeesite-module-maxkey</artifactId>
<packaging>jar</packaging>
<name>JeeSite Module maxkey</name>
<url>http://jeesite.com</url>
<inceptionYear>2013-Now</inceptionYear>
<dependencies>
<dependency>
<groupId>com.jeesite</groupId>
<artifactId>jeesite-module-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.16.5</version>
</dependency>
</dependencies>
<developers>
<developer>
<id>thinkgem</id>
<name>WangZhen</name>
<email>thinkgem at 163.com</email>
<roles><role>Project lead</role></roles>
<timezone>+8</timezone>
</developer>
</developers>
<organization>
<name>JeeSite</name>
<url>http://jeesite.com</url>
</organization>
</project>

@ -0,0 +1,60 @@
package com.jeesite.modules.maxkey.base;
import com.jeesite.modules.maxkey.oauth.realm.request.AuthMaxKeyJeeGitRequest;
import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.request.AuthDefaultRequest;
/**
* Oauth2
*
* @author 20230223
*
*/
public enum AuthCustomSource implements AuthSource {
/**
* gitlab
*/
MAXKEY {
/**
* api
*
* @return url
*/
@Override
public String authorize() {
return AuthMaxKeyJeeGitRequest.BASE_HOST + "/sign/authz/oauth/v20/authorize";
}
/**
* accessTokenapi
*
* @return url
*/
@Override
public String accessToken() {
return AuthMaxKeyJeeGitRequest.BASE_HOST + "/sign/authz/oauth/v20/token";
}
/**
* api
*
* @return url
*/
@Override
public String userInfo() {
return AuthMaxKeyJeeGitRequest.BASE_HOST + "/sign/api/oauth/v20/me";
}
/**
* AuthRequest {@link AuthDefaultRequest}
*
* @return class
*/
@Override
public Class<? extends AuthDefaultRequest> getTargetClass() {
return AuthMaxKeyJeeGitRequest.class;
}
}
}

@ -0,0 +1,64 @@
package com.jeesite.modules.maxkey.base;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import me.zhyd.oauth.model.AuthCallback;
/**
* QQJeeSite1766571055
* @author
* @version 2020-02-23
*/
public interface IBaseJustOauth2Controller {
/**
* Oauth2
* @param source
* @param request
* @return
*/
public String login(@PathVariable("source") String source, HttpServletRequest request);
/**
*
* @param source
* @param callback
* @param redirectAttributes
* @param model
* @param request
* @param response
* @return
*/
public String callback(@PathVariable("source") String source, AuthCallback callback, RedirectAttributes redirectAttributes, Model model, HttpServletRequest request, HttpServletResponse response);
/**
*
* @param id
* @param username
* @param password
* @param validCode
* @param request
* @param response
* @return
*/
public String binder(String id, String username, String password, String validCode, HttpServletRequest request, HttpServletResponse response);
/**
*
* @param id
* @param request
* @param response
* @return
*/
public String unbind(String id, HttpServletRequest request, HttpServletResponse response) ;
}

@ -0,0 +1,118 @@
package com.jeesite.modules.maxkey.base;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
*
* @author
* @version 2023-02-23
*/
public enum JustAuthPlatformInfo {
/**
*
*/
GITEE("Gitee", "", "", "v1.0.1", false),
BAIDU("百度", "", "", "v1.0.1", false),
CODING("coding", "", "", "v1.0.1", false),
CSDN("CSDN", "", "", "v1.0.1", false),
DINGTALK("钉钉扫码登录", "", "", "v1.0.1", false),
GITHUB("Github", "", "", "v1.0.1", false),
OSCHINA("开源中国", "", "", "v1.0.1", false),
ALIPAY("支付宝", "", "", "v1.0.1", false),
WEIBO("微博", "", "", "v1.0.1", false),
DOUYIN("抖音", "", "", "v1.4.0", false),
ELEME("饿了么", "", "", "v1.12.0", false),
FACEBOOK("Facebook", "", "", "v1.3.0", false),
GITLAB("Gitlab", "", "", "v1.11.0", false),
GOOGLE("Google", "", "", "v1.3.0", false),
HUAWEI("华为", "", "", "v1.10.0", false),
JD("京东", "", "", "v1.15.1", false),
KUJIALE("酷家乐", "", "", "v1.11.0", false),
LINKEDIN("领英", "", "", "v1.4.0", false),
MEITUAN("美团", "", "", "v1.12.0", false),
MICROSOFT("微软", "", "", "v1.5.0", false),
MI("小米", "", "", "v1.5.0", false),
PINTEREST("Pinterest", "", "", "v1.9.0", false),
QQ("QQ", "", "", "v1.1.0", false),
RENREN("人人", "", "", "v1.9.0", false),
STACK_OVERFLOW("Stack Overflow", "", "", "v1.9.0", false),
TAOBAO("淘宝", "", "", "v1.2.0", false),
TEAMBITION("Teambition", "", "", "v1.9.0", false),
WECHAT_ENTERPRISE("企业微信二维码登录", "", "", "v1.10.0", false),
WECHAT_MP("微信公众平台", "", "", "v1.14.0", false),
WECHAT_OPEN("微信开放平台", "", "", "v1.1.0", false),
TOUTIAO("今日头条", "", "", "v1.6.0-beta", false),
TWITTER("推特", "", "", "v1.13.0", false),
ALIYUN("阿里云", "", "", "v1.15.5", false),
MYGITLAB("自定义的Gitlab", "", "", "v1.13.0", false),
XMLY("喜马拉雅", "", "", "v1.15.9", false),
WECHAT_ENTERPRISE_WEB("企业微信网页登录", "", "", "v1.15.9", false),
FEISHU("飞书", "", "", "1.15.9", false),
AMAZON("Amazon", "", "", "1.16.0", true),
DINGTALK_ACCOUNT("钉钉账号登录", "", "", "v1.16.0", true),
SLACK("slack 登录", "", "", "v1.16.0", true),
LINE("line 登录", "", "", "v1.16.0", true),
okta("Okta 登录", "", "", "v1.16.0", true),
proginn("程序员客栈", "", "", "v1.16.2", true),
;
// 平台名
private final String name;
// 帮助文档
private final String readme;
// 官网api文档
private final String apiDoc;
// 集成该平台的 版本
private final String since;
private final boolean latest;
JustAuthPlatformInfo(String name, String readme, String apiDoc, String since, boolean latest) {
this.name = name;
this.readme = readme;
this.apiDoc = apiDoc;
this.since = since;
this.latest = latest;
}
public static List<Map<String, Object>> getPlatformInfos() {
List<Map<String, Object>> list = new LinkedList<>();
Map<String, Object> map = null;
JustAuthPlatformInfo[] justAuthPlatformInfos = JustAuthPlatformInfo.values();
for (JustAuthPlatformInfo justAuthPlatformInfo : justAuthPlatformInfos) {
map = new HashMap<>();
map.put("name", justAuthPlatformInfo.getName());
map.put("readme", justAuthPlatformInfo.getReadme());
map.put("apiDoc", justAuthPlatformInfo.getApiDoc());
map.put("since", justAuthPlatformInfo.getSince());
map.put("enname", justAuthPlatformInfo.name().toLowerCase());
map.put("isLatest", justAuthPlatformInfo.isLatest());
list.add(map);
}
return list;
}
public String getName() {
return name;
}
public String getReadme() {
return readme;
}
public String getApiDoc() {
return apiDoc;
}
public String getSince() {
return since;
}
public boolean isLatest() {
return latest;
}
}

@ -0,0 +1,55 @@
package com.jeesite.modules.maxkey.oauth.realm.request;
import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.config.Global;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.modules.maxkey.base.AuthCustomSource;
import com.jeesite.modules.maxkey.utils.AuthCustomExceptionUtils;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.request.AuthDefaultRequest;
public class AuthMaxKeyJeeGitRequest extends AuthDefaultRequest {
public static final String BASE_HOST = Global.getProperty("oauth2.maxkey.serverUrl");
/**
*
*
* @param config
*/
public AuthMaxKeyJeeGitRequest(AuthConfig config) {
super(config, AuthCustomSource.MAXKEY);
}
public AuthMaxKeyJeeGitRequest(AuthConfig config, AuthSource source) {
super(config, source);
}
public AuthMaxKeyJeeGitRequest(AuthConfig config, AuthStateCache authStateCache) {
super(config, AuthCustomSource.MAXKEY, authStateCache);
}
@Override
protected AuthToken getAccessToken(AuthCallback authCallback) {
String body = doPostAuthorizationCode(authCallback.getCode());
JSONObject object = JSONObject.parseObject(body);
System.out.println("getAccessToken:"+JsonMapper.toJson(object));
AuthCustomExceptionUtils.checkResponse(object);
return AuthToken.builder().accessToken(object.getString("access_token")).refreshToken(object.getString("refresh_token")).idToken(object.getString("id_token")).tokenType(object.getString("token_type")).scope(object.getString("scope")).build();
}
@Override
protected AuthUser getUserInfo(AuthToken authToken) {
String body = doGetUserInfo(authToken);
JSONObject object = JSONObject.parseObject(body);
AuthCustomExceptionUtils.checkResponse(object);
return AuthUser.builder().uuid(object.getString("id")).username(object.getString("username")).nickname(object.getString("name")).avatar(object.getString("avatar_url")).blog(object.getString("web_url")).company(object.getString("organization")).location(object.getString("location")).email(object.getString("email")).remark(object.getString("bio")).token(authToken).source(source.toString()).build();
}
}

@ -0,0 +1,19 @@
package com.jeesite.modules.maxkey.utils;
import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.exception.AuthException;
public class AuthCustomExceptionUtils {
public static void checkResponse(JSONObject object) {
// oauth/token 验证异常
if (object.containsKey("error")) {
throw new AuthException(object.getString("error_description"));
}
// user 验证异常
if (object.containsKey("message")) {
throw new AuthException(object.getString("message"));
}
}
}

@ -0,0 +1,404 @@
package com.jeesite.modules.maxkey.utils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.xkcoding.http.config.HttpConfig;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.enums.scope.*;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.request.*;
import me.zhyd.oauth.utils.AuthScopeUtils;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.util.Arrays;
import org.apache.shiro.authc.AuthenticationException;
import com.jeesite.common.config.Global;
import com.jeesite.common.shiro.authc.FormToken;
import com.jeesite.common.shiro.filter.FormFilter;
import com.jeesite.common.web.http.ServletUtils;
import com.jeesite.modules.maxkey.oauth.realm.request.AuthMaxKeyJeeGitRequest;
import com.jeesite.modules.sys.utils.UserUtils;
public class Oauth2UserLoginUtils{
private static final Boolean DEMO_MODE=true;
private static final String DEFAULT_USER_CODE="system";
public static String getAuthUserToSysUserCode(String oauthUserId) {
//自行实现第三方用户到jeesite用户之间逻辑转换关系
if(DEMO_MODE) {
return DEFAULT_USER_CODE;
}
return oauthUserId;
}
public static void loginByOauthUserId(String oauthUserId) {
HttpServletRequest request = ServletUtils.getRequest();
HttpServletResponse response = ServletUtils.getResponse();
try {
// FormToken 构造方法的三个参数:登录名、是否内部登录无条件、请求对象
UserUtils.getSubject().login(new FormToken(getAuthUserToSysUserCode(oauthUserId), true, request));
System.out.println("登录成功__sid=" + UserUtils.getSession().getId());
FormFilter.onLoginSuccess(request, response);
} catch (AuthenticationException e) {
FormFilter.onLoginFailure(e, request, response);
}
}
/**
*
*
* @param source
* @return
*/
@SuppressWarnings("deprecation")
public static AuthRequest getAuthRequest(String source) {
AuthRequest authRequest = null;
switch (source.toLowerCase()) {
case "maxkey":
// jeegit:
// clientId: 823874316692094976
// clientSecret: t74BMTcwMjIwMjMwODIzNTA4NDQFLu
// serverUrl: http://sso.maxkey.top
// redirectUri: http://localhost:8980/js/oauth2/callback/jeegit
// className: com.jeesite.modules.oauth2.request.AuthMaxKeyRequest
authRequest = new AuthMaxKeyJeeGitRequest(AuthConfig.builder()
.clientId(Global.getProperty("oauth2." + source + ".clientId"))
.clientSecret(Global.getProperty("oauth2." + source + ".clientSecret"))
.redirectUri(Global.getProperty("oauth2." + source + ".redirectUri"))
.build());
break;
case "dingtalk":
authRequest = new AuthDingTalkRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/dingtalk")
.build());
break;
case "baidu":
authRequest = new AuthBaiduRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/baidu")
.scopes(Arrays.asList(
AuthBaiduScope.BASIC.getScope(),
AuthBaiduScope.SUPER_MSG.getScope(),
AuthBaiduScope.NETDISK.getScope()
))
// .clientId("")
// .clientSecret("")
// .redirectUri("http://localhost:9001/oauth/baidu/callback")
.build());
break;
case "github":
authRequest = new AuthGithubRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/github")
.scopes(AuthScopeUtils.getScopes(AuthGithubScope.values()))
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
break;
case "gitee":
authRequest = new AuthGiteeRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://127.0.0.1:8443/oauth/callback/gitee")
.scopes(AuthScopeUtils.getScopes(AuthGiteeScope.values()))
.build());
break;
case "weibo":
authRequest = new AuthWeiboRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/weibo")
.scopes(Arrays.asList(
AuthWeiboScope.EMAIL.getScope(),
AuthWeiboScope.FRIENDSHIPS_GROUPS_READ.getScope(),
AuthWeiboScope.STATUSES_TO_ME_READ.getScope()
))
.build());
break;
case "coding":
authRequest = new AuthCodingRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/coding")
.domainPrefix("")
.scopes(Arrays.asList(
AuthCodingScope.USER.getScope(),
AuthCodingScope.USER_EMAIL.getScope(),
AuthCodingScope.USER_PHONE.getScope()
))
.build());
break;
case "oschina":
authRequest = new AuthOschinaRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/oschina")
.build());
break;
case "alipay":
// 支付宝在创建回调地址时不允许使用localhost或者127.0.0.1所以这儿的回调地址使用的局域网内的ip
authRequest = new AuthAlipayRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.alipayPublicKey("")
.redirectUri("https://www.zhyd.me/oauth/callback/alipay")
.build());
break;
case "qq":
authRequest = new AuthQqRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/qq")
.build());
break;
case "wechat_open":
authRequest = new AuthWeChatOpenRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://www.zhyd.me/oauth/callback/wechat")
.build());
break;
case "csdn":
authRequest = new AuthCsdnRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/csdn")
.build());
break;
case "taobao":
authRequest = new AuthTaobaoRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/taobao")
.build());
break;
case "google":
authRequest = new AuthGoogleRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/google")
.scopes(AuthScopeUtils.getScopes(AuthGoogleScope.USER_EMAIL, AuthGoogleScope.USER_PROFILE, AuthGoogleScope.USER_OPENID))
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
break;
case "facebook":
authRequest = new AuthFacebookRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("https://justauth.cn/oauth/callback/facebook")
.scopes(AuthScopeUtils.getScopes(AuthFacebookScope.values()))
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
break;
case "douyin":
authRequest = new AuthDouyinRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/douyin")
.build());
break;
case "linkedin":
authRequest = new AuthLinkedinRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/linkedin")
.scopes(null)
.build());
break;
case "microsoft":
authRequest = new AuthMicrosoftRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/microsoft")
.scopes(Arrays.asList(
AuthMicrosoftScope.USER_READ.getScope(),
AuthMicrosoftScope.USER_READWRITE.getScope(),
AuthMicrosoftScope.USER_READBASIC_ALL.getScope(),
AuthMicrosoftScope.USER_READ_ALL.getScope(),
AuthMicrosoftScope.USER_READWRITE_ALL.getScope(),
AuthMicrosoftScope.USER_INVITE_ALL.getScope(),
AuthMicrosoftScope.USER_EXPORT_ALL.getScope(),
AuthMicrosoftScope.USER_MANAGEIDENTITIES_ALL.getScope(),
AuthMicrosoftScope.FILES_READ.getScope()
))
.build());
break;
case "mi":
authRequest = new AuthMiRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/mi")
.build());
break;
case "toutiao":
authRequest = new AuthToutiaoRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/toutiao")
.build());
break;
case "teambition":
authRequest = new AuthTeambitionRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://127.0.0.1:8443/oauth/callback/teambition")
.build());
break;
case "pinterest":
authRequest = new AuthPinterestRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("https://eadmin.innodev.com.cn/oauth/callback/pinterest")
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
break;
case "renren":
authRequest = new AuthRenrenRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://127.0.0.1:8443/oauth/callback/teambition")
.build());
break;
case "stack_overflow":
authRequest = new AuthStackOverflowRequest(AuthConfig.builder()
.clientId("")
.clientSecret("((")
.redirectUri("http://localhost:8443/oauth/callback/stack_overflow")
.stackOverflowKey("")
.build());
break;
case "huawei":
authRequest = new AuthHuaweiRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://127.0.0.1:8443/oauth/callback/huawei")
.scopes(Arrays.asList(
AuthHuaweiScope.BASE_PROFILE.getScope(),
AuthHuaweiScope.MOBILE_NUMBER.getScope(),
AuthHuaweiScope.ACCOUNTLIST.getScope(),
AuthHuaweiScope.SCOPE_DRIVE_FILE.getScope(),
AuthHuaweiScope.SCOPE_DRIVE_APPDATA.getScope()
))
.build());
break;
case "wechat_enterprise":
authRequest = new AuthWeChatEnterpriseQrcodeRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://justauth.cn/oauth/callback/wechat_enterprise")
.agentId("1000003")
.build());
break;
case "kujiale":
authRequest = new AuthKujialeRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/kujiale")
.build());
break;
case "gitlab":
authRequest = new AuthGitlabRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/gitlab")
.scopes(AuthScopeUtils.getScopes(AuthGitlabScope.values()))
.build());
break;
case "meituan":
authRequest = new AuthMeituanRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/meituan")
.build());
break;
case "eleme":
authRequest = new AuthElemeRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://dblog-web.zhyd.me/oauth/callback/eleme")
.build());
break;
case "twitter":
authRequest = new AuthTwitterRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("https://threelogin.31huiyi.com/oauth/callback/twitter")
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
break;
case "wechat_mp":
authRequest = new AuthWeChatMpRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("")
.build());
break;
case "aliyun":
authRequest = new AuthAliyunRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/aliyun")
.build());
break;
case "xmly":
authRequest = new AuthXmlyRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/xmly")
.build());
break;
case "feishu":
authRequest = new AuthFeishuRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://localhost:8443/oauth/callback/feishu")
.build());
break;
default:
break;
}
if (null == authRequest) {
throw new AuthException("未获取到有效的Auth配置");
}
return authRequest;
}
}

@ -0,0 +1,82 @@
package com.jeesite.modules.maxkey.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.jeesite.common.config.Global;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.maxkey.base.IBaseJustOauth2Controller;
import com.jeesite.modules.maxkey.utils.Oauth2UserLoginUtils;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
/**
* https://github.com/justauth/JustAuth-demo/blob/master/src/main/java/me/zhyd/justauth/RestAuthController.java
* JustAuth
*
* @author
* @version 2023-02-23
*/
@Controller
@RequestMapping({ "/oauth2" })
public class JustOauth2Controller extends BaseController implements IBaseJustOauth2Controller {
@Override
@RequestMapping({"/login/{source}"})
public String login(String source, HttpServletRequest request) {
// TODO Auto-generated method stub
logger.debug(source);
return "redirect:" + Oauth2UserLoginUtils.getAuthRequest(source).authorize((request.getParameter("state") == null ? AuthStateUtils.createState() : request.getParameter("state")));
}
@Override
@RequestMapping({"/callback/{source}"})
public String callback(String source, AuthCallback callback, RedirectAttributes redirectAttributes, Model model, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
logger.debug(source);
AuthRequest authRequest = Oauth2UserLoginUtils.getAuthRequest(source);
AuthResponse<?> rauthResponse = authRequest.login(callback);
if(rauthResponse.getData() instanceof AuthUser) {
AuthUser authUser = (AuthUser) rauthResponse.getData();
//处理相关的绑定业务,该处仅做简单集成与演示专用。
logger.debug("authUser:"+JsonMapper.toJson(authUser));
Oauth2UserLoginUtils.loginByOauthUserId(authUser.getUsername());
return renderResult(Global.TRUE, text("回调信息获取成功!"));
} else {
return null;
}
}
@Override
@PostMapping({"/binder"})
@ResponseBody
public String binder(String id, String username, String password, String validCode, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
logger.debug(id, username);
return null;
}
@Override
@RequestMapping({"/unbind"})
@ResponseBody
public String unbind(String id, HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
logger.debug(id);
return null;
}
}

@ -0,0 +1,59 @@
# 温馨提示不建议直接修改此文件为了平台升级方便建议将需要修改的参数值复制到application.yml里进行覆盖该参数值。
#maxkey:
# enabled: true
oauth2:
# 码云
maxkey:
clientId: 821060415982141440
clientSecret: MrjGMDkwMjIwMjMxNTE0MzkxODAv5o
serverUrl: http://sso.maxkey.top
redirectUri: http://localhost:8981/js/oauth2/callback/maxkey
className: com.jeesite.modules.maxkey.oauth.realm.request.AuthMaxKeyJeeGitRequest
gitee:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/gitee
# 腾讯QQ
qq:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/qq
unionid: xxxxxx
# 微信开放平台
weixin:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/weixin
# 微信公众平台
weixin_mp:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/weixin_mp
# 企业微信
weixin_qy:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/weixin_qy
agentId: xxxxxx
# 钉钉
ding_talk:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/ding_talk
# Github
github:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/github
# 百度
baidu:
clientId: xxxxxx
clientSecret: xxxxxx
redirectUri: http://127.0.0.1:8980/js/oauth2/callback/baidu

@ -0,0 +1,13 @@
# 集成
第三方与MaxKey集成的插件、例子及文档
| 集成类型 | 描述 |
| --------| :----- |
| cas-springboot-demo | SpringBoot开发的CAS协议客户端集成的介绍 |
| jeesite/5.2.1 | jeesite集成插件及使用介绍 |
| Spring-Security-Oauth2-SSO | Spring-Security-Oauth2-SSO|
| *_* | *_* |

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.unicom.sso</groupId>
<artifactId>sso-springboot-sample</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>sso-bigdata-cas-starter-demo</artifactId>
<description>cas 单点登录demo</description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--单点登录依赖-->
<!-- <dependency>-->
<!-- <groupId>com.unicom.sso</groupId>-->
<!-- <artifactId>unicom-sso-bigdata-cas-springboot-starter</artifactId>-->
<!-- <version>0.0.1-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,17 @@
package com.unicom.sso.bigdata.cas.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* cas
* @author baihz10
* @date 2023/7/7 15:18
*/
//@EnableCasClient
@SpringBootApplication
public class CasApplication {
public static void main(String[] args) {
SpringApplication.run(CasApplication.class, args);
}
}

@ -0,0 +1,25 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.springframework.security.core.GrantedAuthority;
public class AuthorityInfo implements GrantedAuthority {
private static final long serialVersionUID = -175781100474818800L;
/**
* CODE
*/
private String authority;
public AuthorityInfo(String authority) {
this.authority = authority;
}
@Override
public String getAuthority() {
return authority;
}
public void setAuthority(String authority) {
this.authority = authority;
}
}

@ -0,0 +1,120 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.jasig.cas.client.session.SingleSignOutFilter;
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.jasig.cas.client.validation.Cas30ProxyTicketValidator;
import org.jasig.cas.client.validation.Cas30ServiceTicketValidator;
import org.jasig.cas.client.validation.TicketValidator;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.ProviderManager;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Configuration
public class CasConfig {
@Value("${cas.server.url}")
private String casServerUrl;
@Value("${base.url}")
private String baseUrl;
@Bean
public AuthenticationEntryPoint authenticationEntryPoint() {
CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint();
entryPoint.setLoginUrl(casServerUrl + "/login");
entryPoint.setServiceProperties(this.serviceProperties());
return entryPoint;
}
@Bean
protected AuthenticationManager authenticationManager() throws Exception {
return new ProviderManager(this.casAuthenticationProvider());
}
@Bean
public CasAuthenticationFilter casAuthenticationFilter() throws Exception {
CasAuthenticationFilter filter = new CasAuthenticationFilter();
filter.setAuthenticationManager(this.authenticationManager());
filter.setServiceProperties(this.serviceProperties());
filter.setAuthenticationFailureHandler(this.authenticationFailureHandler());
filter.setAuthenticationSuccessHandler(this.authenticationSuccessHandler());
return filter;
}
@Bean
public AuthenticationSuccessHandler authenticationSuccessHandler() {
AuthenticationSuccessHandler authenticationSuccessHandler = new SimpleUrlAuthenticationSuccessHandler();
return authenticationSuccessHandler;
}
@Bean
public AuthenticationFailureHandler authenticationFailureHandler() {
AuthenticationFailureHandler authenticationFailureHandler = new SimpleUrlAuthenticationFailureHandler();
return authenticationFailureHandler;
}
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService(baseUrl);
serviceProperties.setSendRenew(false);
return serviceProperties;
}
@Bean
public TicketValidator ticketValidator() {
return new Cas30ProxyTicketValidator(casServerUrl);
}
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider provider = new CasAuthenticationProvider();
provider.setServiceProperties(this.serviceProperties());
provider.setTicketValidator(this.ticketValidator());
provider.setAuthenticationUserDetailsService(new UserDetailsServiceImpl());
provider.setKey("CAS_PROVIDER_LOCALHOST");
return provider;
}
@Bean
public SecurityContextLogoutHandler securityContextLogoutHandler() {
return new SecurityContextLogoutHandler();
}
@Bean
public LogoutFilter logoutFilter() {
LogoutFilter logoutFilter = new LogoutFilter(casServerUrl + "/logout?service=" + baseUrl,
securityContextLogoutHandler());
logoutFilter.setFilterProcessesUrl("/logout/cas");
return logoutFilter;
}
@Bean
public SingleSignOutFilter singleSignOutFilter() {
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
singleSignOutFilter.setIgnoreInitConfiguration(true);
return singleSignOutFilter;
}
}

@ -0,0 +1,96 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* CAS
*/
@Component
public class CasProperties {
@Value("${cas.server.host.url}")
private String casServerUrl;
@Value("${cas.server.host.login_url}")
private String casServerLoginUrl;
@Value("${cas.server.host.logout_url}")
private String casServerLogoutUrl;
@Value("${app.casEnable}")
private boolean casEnable;
@Value("${app.server.host.url}")
private String appServerUrl;
@Value("${app.login_url}")
private String appLoginUrl;
@Value("${app.logout_url}")
private String appLogoutUrl;
@Value("${app.web_url}")
private String webUrl;
public String getWebUrl() {
return webUrl;
}
public String getCasServerUrl() {
return casServerUrl;
}
public void setCasServerUrl(String casServerUrl) {
this.casServerUrl = casServerUrl;
}
public String getCasServerLoginUrl() {
return casServerLoginUrl;
}
public void setCasServerLoginUrl(String casServerLoginUrl) {
this.casServerLoginUrl = casServerLoginUrl;
}
public String getCasServerLogoutUrl() {
return casServerLogoutUrl;
}
public void setCasServerLogoutUrl(String casServerLogoutUrl) {
this.casServerLogoutUrl = casServerLogoutUrl;
}
public boolean isCasEnable() {
return casEnable;
}
public void setCasEnable(boolean casEnable) {
this.casEnable = casEnable;
}
public String getAppServerUrl() {
return appServerUrl;
}
public void setAppServerUrl(String appServerUrl) {
this.appServerUrl = appServerUrl;
}
public String getAppLoginUrl() {
return appLoginUrl;
}
public void setAppLoginUrl(String appLoginUrl) {
this.appLoginUrl = appLoginUrl;
}
public String getAppLogoutUrl() {
return appLogoutUrl;
}
public void setAppLogoutUrl(String appLogoutUrl) {
this.appLogoutUrl = appLogoutUrl;
}
}

@ -0,0 +1,17 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public class CustomUserDetailsService implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
// 可自定义获取用户信息
return new User("admin", "admin", true, true, true, true,
AuthorityUtils.createAuthorityList("ROLE_ADMIN"));
}
}

@ -0,0 +1,37 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
{
@Autowired
private TokenService tokenService;
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException
{
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
{
tokenService.verifyToken(loginUser);
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities());
authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
SecurityContextHolder.getContext().setAuthentication(authenticationToken);
}
chain.doFilter(request, response);
}
}

@ -0,0 +1,233 @@
package com.unicom.sso.bigdata.cas.demo.config;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
public class LoginUser implements UserDetails
{
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long userId;
/**
* ID
*/
private Long deptId;
/**
*
*/
private String token;
/**
*
*/
private Long loginTime;
/**
*
*/
private Long expireTime;
/**
* IP
*/
private String ipaddr;
/**
*
*/
private String loginLocation;
/**
*
*/
private String browser;
/**
*
*/
private String os;
/**
*
*/
private Set<String> permissions;
public Long getUserId()
{
return userId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public String getToken()
{
return token;
}
public void setToken(String token)
{
this.token = token;
}
public LoginUser()
{
}
/**
* ,
*/
@JsonIgnore
@Override
public boolean isAccountNonExpired()
{
return true;
}
/**
* ,
*
* @return
*/
@JsonIgnore
@Override
public boolean isAccountNonLocked()
{
return true;
}
/**
* (),
*
* @return
*/
@JsonIgnore
@Override
public boolean isCredentialsNonExpired()
{
return true;
}
/**
* ,
*
* @return
*/
@JsonIgnore
@Override
public boolean isEnabled()
{
return true;
}
public Long getLoginTime()
{
return loginTime;
}
public void setLoginTime(Long loginTime)
{
this.loginTime = loginTime;
}
public String getIpaddr()
{
return ipaddr;
}
public void setIpaddr(String ipaddr)
{
this.ipaddr = ipaddr;
}
public String getLoginLocation()
{
return loginLocation;
}
public void setLoginLocation(String loginLocation)
{
this.loginLocation = loginLocation;
}
public String getBrowser()
{
return browser;
}
public void setBrowser(String browser)
{
this.browser = browser;
}
public String getOs()
{
return os;
}
public void setOs(String os)
{
this.os = os;
}
public Long getExpireTime()
{
return expireTime;
}
public void setExpireTime(Long expireTime)
{
this.expireTime = expireTime;
}
public Set<String> getPermissions()
{
return permissions;
}
public void setPermissions(Set<String> permissions)
{
this.permissions = permissions;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities()
{
return new HashSet();
}
@Override
public String getPassword() {
return null;
}
@Override
public String getUsername() {
return null;
}
}

@ -0,0 +1,251 @@
package com.unicom.sso.bigdata.cas.demo.config;
import org.jasig.cas.client.session.SingleSignOutFilter;
import org.jasig.cas.client.validation.Cas20ServiceTicketValidator;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.cas.ServiceProperties;
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.LogoutFilter;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.web.filter.CorsFilter;
import javax.annotation.Resource;
/**
* spring security
*
* @author ruoyi
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter
{
@Autowired
private CasProperties casProperties;
@Autowired
private CasUserDetailsService customUserDetailsService;
@Autowired
private CasAuthenticationSuccessHandler casAuthenticationSuccessHandler;
/**
*
*/
@Autowired
private UserDetailsService userDetailsService;
/**
*
*/
@Autowired
private AuthenticationEntryPointImpl unauthorizedHandler;
/**
* 退
*/
@Autowired
private LogoutSuccessHandlerImpl logoutSuccessHandler;
/**
* token
*/
@Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter;
/**
*
*/
@Autowired
private CorsFilter corsFilter;
/**
* AuthenticationManager
*
* @return
* @throws Exception
*/
@Bean
@Override
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
/**
* anyRequest |
* access | SpringEltrue访
* anonymous | 访
* denyAll | 访
* fullyAuthenticated | 访remember-me
* hasAnyAuthority | 访
* hasAnyRole | 访
* hasAuthority | 访
* hasIpAddress | IPIP访
* hasRole | 访
* permitAll | 访
* rememberMe | remember-me访
* authenticated | 访
*/
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
//开启cas
if (casProperties.isCasEnable()) {
httpSecurity
// CSRF禁用因为不使用session
.csrf().disable()
// 基于token所以不需要session
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
// 过滤请求
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
//.antMatchers("/login", "/captchaImage").anonymous()
.antMatchers(
HttpMethod.GET,
"/*.html",
"/**/*.html",
"/**/*.css",
"/**/*.js"
).permitAll()
.antMatchers("/profile/**").anonymous()
.antMatchers("/common/download**").anonymous()
.antMatchers("/common/download/resource**").anonymous()
.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous()
.antMatchers("/druid/**").anonymous()
.antMatchers("/websocket/**").anonymous()
.antMatchers("/magic/web/**").anonymous()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()
.headers().frameOptions().disable();
//单点登录登出
httpSecurity.logout().permitAll().logoutSuccessHandler(logoutSuccessHandler);
// Custom JWT based security filter
httpSecurity.addFilter(casAuthenticationFilter())
.addFilterBefore(authenticationTokenFilter, CasAuthenticationFilter.class)
//.addFilterBefore(casLogoutFilter(), LogoutFilter.class)
.addFilterBefore(singleSignOutFilter(), CasAuthenticationFilter.class).exceptionHandling()
//认证失败
.authenticationEntryPoint(casAuthenticationEntryPoint());
// 添加CORS filter
httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class);
httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
// disable page caching
httpSecurity.headers().cacheControl();
}
}
/**
*
*/
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
/**
*
*/
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// cas
if (casProperties.isCasEnable()) {
super.configure(auth);
auth.authenticationProvider(casAuthenticationProvider());
}
}
/**
*
*/
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setLoginUrl(casProperties.getCasServerLoginUrl());
casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
return casAuthenticationEntryPoint;
}
/**
* service
*/
@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
serviceProperties.setService(casProperties.getAppServerUrl() + casProperties.getAppLoginUrl());
serviceProperties.setAuthenticateAllArtifacts(true);
return serviceProperties;
}
/**
* CAS
*/
@Bean
public CasAuthenticationFilter casAuthenticationFilter() throws Exception {
CasAuthenticationFilter casAuthenticationFilter = new CasAuthenticationFilter();
casAuthenticationFilter.setAuthenticationManager(authenticationManager());
casAuthenticationFilter.setFilterProcessesUrl(casProperties.getAppLoginUrl());
casAuthenticationFilter.setAuthenticationSuccessHandler(casAuthenticationSuccessHandler);
return casAuthenticationFilter;
}
/**
* cas Provider
*/
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
casAuthenticationProvider.setAuthenticationUserDetailsService(customUserDetailsService);
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(cas20ServiceTicketValidator());
casAuthenticationProvider.setKey("casAuthenticationProviderKey");
return casAuthenticationProvider;
}
@Bean
public Cas20ServiceTicketValidator cas20ServiceTicketValidator() {
return new Cas20ServiceTicketValidator(casProperties.getCasServerUrl());
}
/**
*
*/
@Bean
public SingleSignOutFilter singleSignOutFilter() {
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
singleSignOutFilter.setCasServerUrlPrefix(casProperties.getCasServerUrl());
singleSignOutFilter.setIgnoreInitConfiguration(true);
return singleSignOutFilter;
}
/**
* 退
*/
@Bean
public LogoutFilter casLogoutFilter() {
LogoutFilter logoutFilter = new LogoutFilter(casProperties.getCasServerLogoutUrl(),
new SecurityContextLogoutHandler());
logoutFilter.setFilterProcessesUrl(casProperties.getAppLogoutUrl());
return logoutFilter;
}
}

@ -0,0 +1,4 @@
package com.unicom.sso.bigdata.cas.demo.config;
public class TokenService {
}

@ -0,0 +1,30 @@
package com.unicom.sso.bigdata.cas.demo.config;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Primary;
import org.springframework.security.cas.authentication.CasAssertionAuthenticationToken;
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import java.util.HashSet;
import java.util.Set;
public class UserDetailsServiceImpl implements AuthenticationUserDetailsService<CasAssertionAuthenticationToken> {
@Override
public UserDetails loadUserDetails(CasAssertionAuthenticationToken token) throws UsernameNotFoundException {
System.out.println("getCredentials:" + token.getCredentials());
String username = token.getName();
System.out.println(username);
UserInfo userInfo = new UserInfo();
userInfo.setUsername("admin");
userInfo.setName("admin");
Set<AuthorityInfo> authorities = new HashSet<AuthorityInfo>();
AuthorityInfo authorityInfo = new AuthorityInfo("TEST");
authorities.add(authorityInfo);
userInfo.setAuthorities(authorities);
return userInfo;
}
}

@ -0,0 +1,98 @@
package com.unicom.sso.bigdata.cas.demo.config;
import lombok.Getter;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.HashSet;
import java.util.Set;
public class UserInfo implements UserDetails {
private static final long serialVersionUID = -1041327031937199938L;
/**
* ID
*/
@Getter
private Long id;
/**
*
*/
@Getter
private String name;
/**
*
*/
@Getter
private String username;
/**
*
*/
@Getter
private String password;
private boolean isAccountNonExpired = true;
private boolean isAccountNonLocked = true;
private boolean isCredentialsNonExpired = true;
private boolean isEnabled = true;
@Getter
private Set<AuthorityInfo> authorities = new HashSet<AuthorityInfo>();
public void setId(Long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public boolean isAccountNonExpired() {
return isAccountNonExpired;
}
public void setAccountNonExpired(boolean accountNonExpired) {
isAccountNonExpired = accountNonExpired;
}
public boolean isAccountNonLocked() {
return isAccountNonLocked;
}
public void setAccountNonLocked(boolean accountNonLocked) {
isAccountNonLocked = accountNonLocked;
}
public boolean isCredentialsNonExpired() {
return isCredentialsNonExpired;
}
public void setCredentialsNonExpired(boolean credentialsNonExpired) {
isCredentialsNonExpired = credentialsNonExpired;
}
public boolean isEnabled() {
return isEnabled;
}
public void setEnabled(boolean enabled) {
isEnabled = enabled;
}
public void setAuthorities(Set<AuthorityInfo> authorities) {
this.authorities = authorities;
}
}

@ -0,0 +1,63 @@
package com.unicom.sso.bigdata.cas.demo.controller;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.validation.Assertion;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* cas
* @author baihz10
* @date 2023/7/7 15:44
*/
@Controller
public class HelloController {
@GetMapping("/hello")
public String home(Model model, HttpServletRequest request) {
// String token =request.getParameter("token");
// System.out.println("token : "+token);
// Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
//
// String username= assertion.getPrincipal().getName();
// System.out.println("cas user:"+username);
//
// username = Optional.ofNullable(username).orElse("anonymous");
// Map<String, Object> attributes = Optional.ofNullable(assertion.getPrincipal().getAttributes()).orElse(new HashMap<>());
//
// model.addAttribute("username", username);
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
System.out.println("当前用户信息:" + auth.getPrincipal());
return "home";
}
@GetMapping("/hello2")
public String home2(Model model, HttpServletRequest request) {
String token =request.getParameter("token");
System.out.println("token : "+token);
Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
String username= assertion.getPrincipal().getName();
System.out.println("cas user:"+username);
username = Optional.ofNullable(username).orElse("anonymous");
Map<String, Object> attributes = Optional.ofNullable(assertion.getPrincipal().getAttributes()).orElse(new HashMap<>());
model.addAttribute("username", username);
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
System.out.println("当前用户信息:" + auth.getPrincipal());
return "home";
}
}

@ -0,0 +1,29 @@
package com.unicom.sso.bigdata.cas.demo.controller;
import org.jasig.cas.client.util.AbstractCasFilter;
import org.jasig.cas.client.validation.Assertion;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletRequest;
import java.util.Optional;
/**
*
* @author baihz10
* @date 2023/7/7 15:44
*/
@Controller
public class SsoLoginController {
@GetMapping("/caslogin")
public String home(Model model,HttpServletRequest request) {
Assertion assertion = (Assertion) request.getSession().getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION);
String username= assertion.getPrincipal().getName();
username = Optional.ofNullable(username).orElse("anonymous");
model.addAttribute("username", username);
return "cas/login";
}
}

@ -0,0 +1,25 @@
server.port=10002
#spring.profiles.active=cas-test
base.url=http://cas.demo.maxkey.top:10002
cas.server.url=http://192.168.202.102:8080/sign/authz/cas
#CAS
cas.server.host.url=http://192.168.202.102:8080/sign/authz/cas
#CAS????
#CAS??????
cas.server.host.login_url=${cas.server.host.url}/login
#CAS??????
cas.server.host.logout_url=${cas.server.host.url}/logout?service=${app.server.host.url}
# ??????
app.casEnable=true
app.server.host.url=http://192.168.202.102:${server.port}
#??????
app.server.host.login_url=/
#??????
app.server.host.logout_url=/logout
#??????
app.server.host.web_url=http://192.168.202.102/index

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>sso cas demo</title>
</head>
<body>
<h2 >Login with CAS</h2>
login user : [[${username}]]
</body>
</html>

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>home</title>
</head>
<body>
hello cas
<br>
hello [[${username}]]
userInfo: [[${userInfo}]]
</body>
</html>

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

@ -0,0 +1,97 @@
# Spring Security OAuth SSO
### 项目源地址
https://gitee.com/hhw3KevinHou/spring-security-oauth2-sso.git
#### 介绍
部署一个OAuth 2.0服务器例如MaxKey。
建立2个协议为 OAuth_v2.1的应用对应spring-demo-client1spring-demo-client2许可确认设置为自动这样不需要用户手动授权。设置访问控制。
运行spring-demo-client1spring-demo-client2
访问http://localhost:8080/hello自动跳转登录页面登录成功。
访问http://localhost:8081/hello不需要登录。
任何一个logout全局退出。
## 单点登录过程
访问http://localhost:8081/hello发现spring-demo-client2本地应用没有登录
```
spring-demo-client2 发起登录请求:
redirect到http://sso.maxkey.top/sign/authz/oauth/v20/authorize?client_id=830517174152986624&redirect_uri=http://localhost:8081/login&response_type=code&state=8GAmwd'
显示makey登录界面
用户登录后
maxkey根据应用设置使用自动approve不需要用户点击授权。
redirect到http://localhost:8081/login?code=72107fc4-5305-4aa5-a8d0-14da30ed0ca1&state=8GAmwd
spring-demo-client2 的spring security自动处理获取access_token
调用http://sso.maxkey.top/sign/authz/oauth/v20/token
参数为:
{
grant_type=[authorization_code],
code=[72107fc4-5305-4aa5-a8d0-14da30ed0ca1],
redirect_uri=[http://localhost:8081/login],
client_id=[830517174152986624],
client_secret=[ElHEMDcwMzIwMjMxNjE5NTAyMTIx1K]
}
得到access_tokendbff79de-6efa-4148-aedb-333325dc30c0
spring-demo-client2的spring security使用得到access_token自动获取用户信息
http://sso.maxkey.top/sign/api/oauth/v20/me
spring-demo-client2得到用户信息后返回前端
http://localhost:8081/hello
```
访问http://localhost:8080/hello发现spring-demo-client1本地应用没有登录
```
spring-demo-client1 发起登录请求:
'http://sso.maxkey.top/sign/authz/oauth/v20/authorize?client_id=830447866781630464&redirect_uri=http://localhost:8080/login&response_type=code&state=ZZXxk5'
makey的拦截器发现授权中心已经登录cookie里有jwt token
自动approve不需要用户点击授权。
redirect到http://localhost:8080/login?code=51f2ae07-7a1c-42ec-a663-be09080ab1d9&state=ZZXxk5
spring-demo-client1 的spring security自动处理获取access_token
调用http://sso.maxkey.top/sign/authz/oauth/v20/token
参数为:
{
grant_type=[authorization_code],
code=[51f2ae07-7a1c-42ec-a663-be09080ab1d9],
redirect_uri=[http://localhost:8080/login],
client_id=[830447866781630464],
client_secret=[QnGYMDcwMzIwMjMxMTQ0MjYwNDcFli]
}
得到access_token95e277ae-06f2-4f43-af78-8046905b8cea
spring-demo-client1的spring security使用得到access_token自动获取用户信息
http://sso.maxkey.top/sign/api/oauth/v20/me
spring-demo-client1得到用户信息后返回前端
http://localhost:8080/hello
```

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.concretepage</groupId>
<artifactId>spring-demo-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>spring-demo</name>
<description>Spring Demo</description>
<modules>
<module>spring-demo-client1</module>
<module>spring-demo-client2</module>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath />
</parent>
<properties>
<context.path>spring-app</context.path>
<java.version>8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.5.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.concretepage</groupId>
<artifactId>spring-demo-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<name>spring-demo-client1</name>
<artifactId>spring-demo-client1</artifactId>
<description> </description>
</project>

@ -0,0 +1,25 @@
package com.concretepage.client1;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.Map;
@Controller
public class AppController {
@GetMapping("hello")
public ModelAndView welcome() {
ModelAndView mav = new ModelAndView();
mav.setViewName("welcome");
return mav;
}
@GetMapping("error")
public ModelAndView error() {
Map<String, String> model = new HashMap<>();
ModelAndView mav = new ModelAndView();
mav.setViewName("error");
return mav;
}
}

@ -0,0 +1,11 @@
package com.concretepage.client1;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MainClient1 {
public static void main(String[] args) {
SpringApplication.run(MainClient1.class, args);
}
}

@ -0,0 +1,21 @@
package com.concretepage.client1;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableOAuth2Sso
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/error**").permitAll()
.anyRequest().authenticated()
.and().logout().logoutUrl("/logout")
.logoutSuccessUrl("http://sso.maxkey.top/sign/force/logout");
}
}

@ -0,0 +1,22 @@
server:
port: 8080
security:
oauth2:
client:
clientId: 830447866781630464
clientSecret: QnGYMDcwMzIwMjMxMTQ0MjYwNDcFli
accessTokenUri: http://sso.maxkey.top/sign/authz/oauth/v20/token
userAuthorizationUri: http://sso.maxkey.top/sign/authz/oauth/v20/authorize
clientAuthenticationScheme: form
resource:
userInfoUri: http://sso.maxkey.top/sign/api/oauth/v20/me
sso:
login-path: /login
logging:
level:
root: debug
spring:
mvc:
favicon:
enabled: false

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Spring Security</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h3>Login with <a href="/hello">GitHub</a></h3>
</body>
</html>

@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<title>Spring Security</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h3>Error</h3>
<p th:if="${param.error}">
<div th:text="${param.error}"></div>
</p>
</body>
</html>

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<title>Welcome</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
Welcome <b th:inline="text" > [[${#httpServletRequest.remoteUser}]] </b> <br/><br/>
<form th:action="@{/logout}" method="POST">
<input type="submit" value="Logout"/>
</form>
</body>
</html>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.concretepage</groupId>
<artifactId>spring-demo-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<name>spring-demo-client2</name>
<artifactId>spring-demo-client2</artifactId>
<description> </description>
</project>

@ -0,0 +1,25 @@
package com.concretepage.client2;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.Map;
@Controller
public class AppController {
@GetMapping("hello")
public ModelAndView welcome() {
ModelAndView mav = new ModelAndView();
mav.setViewName("welcome");
return mav;
}
@GetMapping("error")
public ModelAndView error() {
Map<String, String> model = new HashMap<>();
ModelAndView mav = new ModelAndView();
mav.setViewName("error");
return mav;
}
}

@ -0,0 +1,11 @@
package com.concretepage.client2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MainClient2 {
public static void main(String[] args) {
SpringApplication.run(MainClient2.class, args);
}
}

@ -0,0 +1,21 @@
package com.concretepage.client2;
import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableOAuth2Sso
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/error**").permitAll()
.anyRequest().authenticated()
.and().logout().logoutUrl("/logout")
.logoutSuccessUrl("http://sso.maxkey.top/sign/force/logout");
}
}

@ -0,0 +1,22 @@
server:
port: 8081
security:
oauth2:
client:
clientId: 830517174152986624
clientSecret: ElHEMDcwMzIwMjMxNjE5NTAyMTIx1K
accessTokenUri: http://sso.maxkey.top/sign/authz/oauth/v20/token
userAuthorizationUri: http://sso.maxkey.top/sign/authz/oauth/v20/authorize
clientAuthenticationScheme: form
resource:
userInfoUri: http://sso.maxkey.top/sign/api/oauth/v20/me
sso:
login-path: /login
logging:
level:
root: debug
spring:
mvc:
favicon:
enabled: false

@ -0,0 +1,10 @@
<!doctype html>
<html>
<head>
<title>Spring Security</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h3>Login with <a href="/hello">GitHub</a></h3>
</body>
</html>

@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<title>Spring Security</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
<h3>Error</h3>
<p th:if="${param.error}">
<div th:text="${param.error}"></div>
</p>
</body>
</html>

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<title>Welcome</title>
<link rel="icon" href="data:;base64,=">
</head>
<body>
Welcome <b th:inline="text" > [[${#httpServletRequest.remoteUser}]] </b> <br/><br/>
<form th:action="@{/logout}" method="POST">
<input type="submit" value="Logout"/>
</form>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save