├── .gitignore
├── LICENSE
├── README.md
├── ace-auth
├── ace-auth-client
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── wxiaoqi
│ │ └── security
│ │ └── auth
│ │ └── client
│ │ ├── EnableAceAuthClient.java
│ │ ├── annotation
│ │ ├── IgnoreClientToken.java
│ │ └── IgnoreUserToken.java
│ │ ├── config
│ │ ├── FeignOkHttpConfig.java
│ │ ├── ServiceAuthConfig.java
│ │ └── UserAuthConfig.java
│ │ ├── configuration
│ │ └── AutoConfiguration.java
│ │ ├── exception
│ │ ├── JwtIllegalArgumentException.java
│ │ ├── JwtSignatureException.java
│ │ └── JwtTokenExpiredException.java
│ │ ├── feign
│ │ └── ServiceAuthFeign.java
│ │ ├── interceptor
│ │ ├── OkHttpTokenInterceptor.java
│ │ ├── ServiceAuthRestInterceptor.java
│ │ └── UserAuthRestInterceptor.java
│ │ ├── jwt
│ │ ├── ServiceAuthUtil.java
│ │ └── UserAuthUtil.java
│ │ └── runner
│ │ └── AuthClientRunner.java
├── ace-auth-common
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── wxiaoqi
│ │ └── security
│ │ └── auth
│ │ └── common
│ │ ├── constatns
│ │ └── CommonConstants.java
│ │ └── util
│ │ ├── StringHelper.java
│ │ └── jwt
│ │ ├── IJWTInfo.java
│ │ ├── JWTHelper.java
│ │ ├── JWTInfo.java
│ │ └── RsaKeyHelper.java
├── ace-auth-server
│ ├── pom.xml
│ └── src
│ │ ├── db
│ │ └── init.sql
│ │ └── main
│ │ ├── docker
│ │ └── Dockerfile
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── auth
│ │ │ ├── AuthBootstrap.java
│ │ │ ├── bean
│ │ │ └── ClientInfo.java
│ │ │ ├── biz
│ │ │ ├── ClientBiz.java
│ │ │ └── ClientServiceBiz.java
│ │ │ ├── configuration
│ │ │ ├── ClientConfiguration.java
│ │ │ ├── FeignConfiguration.java
│ │ │ ├── KeyConfiguration.java
│ │ │ ├── RedisConfiguration.java
│ │ │ ├── UserConfiguration.java
│ │ │ └── WebConfiguration.java
│ │ │ ├── controller
│ │ │ ├── AuthController.java
│ │ │ ├── ClientController.java
│ │ │ └── ServiceController.java
│ │ │ ├── entity
│ │ │ ├── Client.java
│ │ │ └── ClientService.java
│ │ │ ├── feign
│ │ │ └── IUserService.java
│ │ │ ├── interceptor
│ │ │ ├── ClientTokenInterceptor.java
│ │ │ ├── ServiceAuthRestInterceptor.java
│ │ │ └── UserAuthRestInterceptor.java
│ │ │ ├── mapper
│ │ │ ├── ClientMapper.java
│ │ │ └── ClientServiceMapper.java
│ │ │ ├── runner
│ │ │ └── AuthServerRunner.java
│ │ │ ├── service
│ │ │ ├── AuthClientService.java
│ │ │ ├── AuthService.java
│ │ │ └── impl
│ │ │ │ ├── AuthServiceImpl.java
│ │ │ │ └── DBAuthClientService.java
│ │ │ ├── util
│ │ │ ├── client
│ │ │ │ └── ClientTokenUtil.java
│ │ │ └── user
│ │ │ │ ├── JwtAuthenticationRequest.java
│ │ │ │ ├── JwtAuthenticationResponse.java
│ │ │ │ └── JwtTokenUtil.java
│ │ │ └── vo
│ │ │ └── FrontUser.java
│ │ └── resources
│ │ ├── application.yml
│ │ ├── bootstrap.yml
│ │ └── mapper
│ │ ├── ClientMapper.xml
│ │ └── ClientServiceMapper.xml
└── pom.xml
├── ace-common
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── github
│ └── wxiaoqi
│ └── security
│ └── common
│ ├── biz
│ └── BaseBiz.java
│ ├── constant
│ ├── CommonConstants.java
│ ├── RestCodeConstants.java
│ └── UserConstant.java
│ ├── context
│ └── BaseContextHandler.java
│ ├── exception
│ ├── BaseException.java
│ └── auth
│ │ ├── ClientForbiddenException.java
│ │ ├── ClientInvalidException.java
│ │ ├── ClientTokenException.java
│ │ ├── UserInvalidException.java
│ │ └── UserTokenException.java
│ ├── handler
│ └── GlobalExceptionHandler.java
│ ├── msg
│ ├── BaseResponse.java
│ ├── ListRestResponse.java
│ ├── ObjectRestResponse.java
│ ├── TableResultResponse.java
│ └── auth
│ │ ├── TokenErrorResponse.java
│ │ └── TokenForbiddenResponse.java
│ ├── rest
│ └── BaseController.java
│ ├── service
│ ├── BaseService.java
│ └── impl
│ │ └── BaseServiceImpl.java
│ ├── util
│ ├── ClientUtil.java
│ ├── EntityUtils.java
│ ├── Query.java
│ ├── ReflectionUtils.java
│ ├── StringHelper.java
│ ├── TreeUtil.java
│ └── UUIDUtils.java
│ ├── vo
│ └── TreeNode.java
│ └── web
│ └── ParameterRequestWrapper.java
├── ace-control
├── ace-monitor
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── docker
│ │ └── Dockerfile
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── monitor
│ │ │ └── MonitorBootstrap.java
│ │ └── resources
│ │ └── application.yml
├── ace-nacos
│ ├── db
│ │ └── init_nacos.sql
│ ├── nacos-server-0.8.0.zip
│ └── nacos
│ │ ├── LICENSE
│ │ ├── NOTICE
│ │ ├── bin
│ │ ├── shutdown.cmd
│ │ ├── shutdown.sh
│ │ ├── startup.cmd
│ │ └── startup.sh
│ │ ├── conf
│ │ ├── application.properties
│ │ ├── application.properties.example
│ │ ├── cluster.conf.example
│ │ ├── nacos-logback.xml
│ │ ├── nacos-mysql.sql
│ │ └── schema.sql
│ │ └── plugins
│ │ └── cmdb
│ │ └── nacos-cmdb-plugin-example.jar
├── ace-sentinel
│ └── sentinel-dashboard.jar
└── pom.xml
├── ace-gate
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── github
│ │ └── wxiaoqi
│ │ └── security
│ │ └── gate
│ │ ├── GatewayServerBootstrap.java
│ │ ├── config
│ │ └── GatewayConfig.java
│ │ ├── fallback
│ │ └── UserServiceFallback.java
│ │ ├── feign
│ │ ├── ILogService.java
│ │ └── IUserService.java
│ │ ├── filter
│ │ └── AccessGatewayFilter.java
│ │ ├── handler
│ │ └── RequestBodyRoutePredicateFactory.java
│ │ └── utils
│ │ └── DBLog.java
│ └── resources
│ ├── application.yml
│ └── bootstrap.yml
├── ace-modules
├── ace-admin
│ ├── db
│ │ └── init.sql
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── docker
│ │ ├── Dockerfile
│ │ └── wait-for-it.sh
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── admin
│ │ │ ├── AdminBootstrap.java
│ │ │ ├── biz
│ │ │ ├── ElementBiz.java
│ │ │ ├── GateLogBiz.java
│ │ │ ├── GroupBiz.java
│ │ │ ├── GroupTypeBiz.java
│ │ │ ├── MenuBiz.java
│ │ │ ├── ResourceAuthorityBiz.java
│ │ │ └── UserBiz.java
│ │ │ ├── config
│ │ │ └── WebConfiguration.java
│ │ │ ├── constant
│ │ │ └── AdminCommonConstant.java
│ │ │ ├── entity
│ │ │ ├── Element.java
│ │ │ ├── GateLog.java
│ │ │ ├── Group.java
│ │ │ ├── GroupType.java
│ │ │ ├── Menu.java
│ │ │ ├── ResourceAuthority.java
│ │ │ └── User.java
│ │ │ ├── mapper
│ │ │ ├── ElementMapper.java
│ │ │ ├── GateLogMapper.java
│ │ │ ├── GroupMapper.java
│ │ │ ├── GroupTypeMapper.java
│ │ │ ├── MenuMapper.java
│ │ │ ├── ResourceAuthorityMapper.java
│ │ │ └── UserMapper.java
│ │ │ ├── rest
│ │ │ ├── ElementController.java
│ │ │ ├── GateLogController.java
│ │ │ ├── GroupController.java
│ │ │ ├── GroupTypeController.java
│ │ │ ├── MenuController.java
│ │ │ └── UserController.java
│ │ │ ├── rpc
│ │ │ ├── LogRest.java
│ │ │ ├── UserRest.java
│ │ │ └── service
│ │ │ │ └── PermissionService.java
│ │ │ └── vo
│ │ │ ├── AuthorityMenuTree.java
│ │ │ ├── FrontUser.java
│ │ │ ├── GroupTree.java
│ │ │ ├── GroupUsers.java
│ │ │ └── MenuTree.java
│ │ └── resources
│ │ ├── application.yml
│ │ ├── bootstrap.yml
│ │ ├── builder
│ │ └── generatorConfig.xml
│ │ ├── logback.xml
│ │ └── mapper
│ │ ├── ElementMapper.xml
│ │ ├── GateLogMapper.xml
│ │ ├── GroupMapper.xml
│ │ ├── GroupTypeMapper.xml
│ │ ├── MenuMapper.xml
│ │ ├── ResourceAuthorityMapper.xml
│ │ └── UserMapper.xml
├── ace-generator
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── generator
│ │ │ ├── GeneratorBootstrap.java
│ │ │ ├── config
│ │ │ └── WebConfig.java
│ │ │ ├── controller
│ │ │ └── HomeController.java
│ │ │ ├── entity
│ │ │ ├── ColumnEntity.java
│ │ │ └── TableEntity.java
│ │ │ ├── mapper
│ │ │ └── GeneratorMapper.java
│ │ │ ├── rest
│ │ │ └── GeneratorRest.java
│ │ │ ├── service
│ │ │ └── GeneratorService.java
│ │ │ └── utils
│ │ │ ├── DateUtils.java
│ │ │ └── GeneratorUtils.java
│ │ └── resources
│ │ ├── application.yml
│ │ ├── generator.properties
│ │ ├── mapper
│ │ └── GeneratorMapper.xml
│ │ ├── static
│ │ ├── README.md
│ │ ├── ag
│ │ │ └── generator
│ │ │ │ └── generator.js
│ │ ├── bootstrap.min.js
│ │ ├── css
│ │ │ ├── ag.css
│ │ │ ├── begtable.css
│ │ │ ├── bootstrap.min.css
│ │ │ ├── btable.css
│ │ │ ├── global.css
│ │ │ ├── layout.css
│ │ │ ├── layui.css
│ │ │ ├── layui.mobile.css
│ │ │ ├── login.css
│ │ │ ├── main.css
│ │ │ ├── modules
│ │ │ │ ├── code.css
│ │ │ │ ├── icheck
│ │ │ │ │ ├── flat
│ │ │ │ │ │ ├── _all.css
│ │ │ │ │ │ ├── aero.css
│ │ │ │ │ │ ├── aero.png
│ │ │ │ │ │ ├── aero@2x.png
│ │ │ │ │ │ ├── blue.css
│ │ │ │ │ │ ├── blue.png
│ │ │ │ │ │ ├── blue@2x.png
│ │ │ │ │ │ ├── flat.css
│ │ │ │ │ │ ├── flat.png
│ │ │ │ │ │ ├── flat@2x.png
│ │ │ │ │ │ ├── green.css
│ │ │ │ │ │ ├── green.png
│ │ │ │ │ │ ├── green@2x.png
│ │ │ │ │ │ ├── grey.css
│ │ │ │ │ │ ├── grey.png
│ │ │ │ │ │ ├── grey@2x.png
│ │ │ │ │ │ ├── orange.css
│ │ │ │ │ │ ├── orange.png
│ │ │ │ │ │ ├── orange@2x.png
│ │ │ │ │ │ ├── pink.css
│ │ │ │ │ │ ├── pink.png
│ │ │ │ │ │ ├── pink@2x.png
│ │ │ │ │ │ ├── purple.css
│ │ │ │ │ │ ├── purple.png
│ │ │ │ │ │ ├── purple@2x.png
│ │ │ │ │ │ ├── red.css
│ │ │ │ │ │ ├── red.png
│ │ │ │ │ │ ├── red@2x.png
│ │ │ │ │ │ ├── yellow.css
│ │ │ │ │ │ ├── yellow.png
│ │ │ │ │ │ └── yellow@2x.png
│ │ │ │ │ ├── futurico
│ │ │ │ │ │ ├── futurico.css
│ │ │ │ │ │ ├── futurico.png
│ │ │ │ │ │ └── futurico@2x.png
│ │ │ │ │ ├── icheck.css
│ │ │ │ │ ├── line
│ │ │ │ │ │ ├── _all.css
│ │ │ │ │ │ ├── aero.css
│ │ │ │ │ │ ├── blue.css
│ │ │ │ │ │ ├── green.css
│ │ │ │ │ │ ├── grey.css
│ │ │ │ │ │ ├── line.css
│ │ │ │ │ │ ├── line.png
│ │ │ │ │ │ ├── line@2x.png
│ │ │ │ │ │ ├── orange.css
│ │ │ │ │ │ ├── pink.css
│ │ │ │ │ │ ├── purple.css
│ │ │ │ │ │ ├── red.css
│ │ │ │ │ │ └── yellow.css
│ │ │ │ │ ├── minimal
│ │ │ │ │ │ ├── _all.css
│ │ │ │ │ │ ├── aero.css
│ │ │ │ │ │ ├── aero.png
│ │ │ │ │ │ ├── aero@2x.png
│ │ │ │ │ │ ├── blue.css
│ │ │ │ │ │ ├── blue.png
│ │ │ │ │ │ ├── blue@2x.png
│ │ │ │ │ │ ├── green.css
│ │ │ │ │ │ ├── green.png
│ │ │ │ │ │ ├── green@2x.png
│ │ │ │ │ │ ├── grey.css
│ │ │ │ │ │ ├── grey.png
│ │ │ │ │ │ ├── grey@2x.png
│ │ │ │ │ │ ├── minimal.css
│ │ │ │ │ │ ├── minimal.png
│ │ │ │ │ │ ├── minimal@2x.png
│ │ │ │ │ │ ├── orange.css
│ │ │ │ │ │ ├── orange.png
│ │ │ │ │ │ ├── orange@2x.png
│ │ │ │ │ │ ├── pink.css
│ │ │ │ │ │ ├── pink.png
│ │ │ │ │ │ ├── pink@2x.png
│ │ │ │ │ │ ├── purple.css
│ │ │ │ │ │ ├── purple.png
│ │ │ │ │ │ ├── purple@2x.png
│ │ │ │ │ │ ├── red.css
│ │ │ │ │ │ ├── red.png
│ │ │ │ │ │ ├── red@2x.png
│ │ │ │ │ │ ├── yellow.css
│ │ │ │ │ │ ├── yellow.png
│ │ │ │ │ │ └── yellow@2x.png
│ │ │ │ │ ├── polaris
│ │ │ │ │ │ ├── polaris.css
│ │ │ │ │ │ ├── polaris.png
│ │ │ │ │ │ └── polaris@2x.png
│ │ │ │ │ └── square
│ │ │ │ │ │ ├── _all.css
│ │ │ │ │ │ ├── aero.css
│ │ │ │ │ │ ├── aero.png
│ │ │ │ │ │ ├── aero@2x.png
│ │ │ │ │ │ ├── blue.css
│ │ │ │ │ │ ├── blue.png
│ │ │ │ │ │ ├── blue@2x.png
│ │ │ │ │ │ ├── green.css
│ │ │ │ │ │ ├── green.png
│ │ │ │ │ │ ├── green@2x.png
│ │ │ │ │ │ ├── grey.css
│ │ │ │ │ │ ├── grey.png
│ │ │ │ │ │ ├── grey@2x.png
│ │ │ │ │ │ ├── orange.css
│ │ │ │ │ │ ├── orange.png
│ │ │ │ │ │ ├── orange@2x.png
│ │ │ │ │ │ ├── pink.css
│ │ │ │ │ │ ├── pink.png
│ │ │ │ │ │ ├── pink@2x.png
│ │ │ │ │ │ ├── purple.css
│ │ │ │ │ │ ├── purple.png
│ │ │ │ │ │ ├── purple@2x.png
│ │ │ │ │ │ ├── red.css
│ │ │ │ │ │ ├── red.png
│ │ │ │ │ │ ├── red@2x.png
│ │ │ │ │ │ ├── square.css
│ │ │ │ │ │ ├── square.png
│ │ │ │ │ │ ├── square@2x.png
│ │ │ │ │ │ ├── yellow.css
│ │ │ │ │ │ ├── yellow.png
│ │ │ │ │ │ └── yellow@2x.png
│ │ │ │ ├── laydate
│ │ │ │ │ ├── icon.png
│ │ │ │ │ └── laydate.css
│ │ │ │ └── layer
│ │ │ │ │ └── default
│ │ │ │ │ ├── icon-ext.png
│ │ │ │ │ ├── icon.png
│ │ │ │ │ ├── layer.css
│ │ │ │ │ ├── loading-0.gif
│ │ │ │ │ ├── loading-1.gif
│ │ │ │ │ └── loading-2.gif
│ │ │ └── table.css
│ │ ├── datas
│ │ │ ├── area_data.js
│ │ │ ├── btable_data.json
│ │ │ ├── laytpl_laypage_data.json
│ │ │ ├── nav.js
│ │ │ ├── nav.json
│ │ │ ├── nav_content.json
│ │ │ └── nav_member.json
│ │ ├── face
│ │ │ ├── 0.gif
│ │ │ ├── 1.gif
│ │ │ ├── 10.gif
│ │ │ ├── 11.gif
│ │ │ ├── 12.gif
│ │ │ ├── 13.gif
│ │ │ ├── 14.gif
│ │ │ ├── 15.gif
│ │ │ ├── 16.gif
│ │ │ ├── 17.gif
│ │ │ ├── 18.gif
│ │ │ ├── 19.gif
│ │ │ ├── 2.gif
│ │ │ ├── 22.gif
│ │ │ ├── 24.gif
│ │ │ ├── 25.gif
│ │ │ ├── 26.gif
│ │ │ ├── 27.gif
│ │ │ ├── 29.gif
│ │ │ ├── 3.gif
│ │ │ ├── 33.gif
│ │ │ ├── 34.gif
│ │ │ ├── 35.gif
│ │ │ ├── 36.gif
│ │ │ ├── 37.gif
│ │ │ ├── 38.gif
│ │ │ ├── 39.gif
│ │ │ ├── 4.gif
│ │ │ ├── 41.gif
│ │ │ ├── 43.gif
│ │ │ ├── 44.gif
│ │ │ ├── 45.gif
│ │ │ ├── 46.gif
│ │ │ ├── 48.gif
│ │ │ ├── 49.gif
│ │ │ ├── 5.gif
│ │ │ ├── 50.gif
│ │ │ ├── 52.gif
│ │ │ ├── 53.gif
│ │ │ ├── 54.gif
│ │ │ ├── 55.gif
│ │ │ ├── 56.gif
│ │ │ ├── 59.gif
│ │ │ ├── 6.gif
│ │ │ ├── 61.gif
│ │ │ ├── 62.gif
│ │ │ ├── 63.gif
│ │ │ ├── 65.gif
│ │ │ ├── 66.gif
│ │ │ ├── 67.gif
│ │ │ ├── 69.gif
│ │ │ ├── 7.gif
│ │ │ ├── 70.gif
│ │ │ └── 71.gif
│ │ ├── font
│ │ │ ├── iconfont.svg
│ │ │ └── iconfont.woff
│ │ ├── fonts
│ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ ├── glyphicons-halflings-regular.svg
│ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ └── glyphicons-halflings-regular.woff2
│ │ ├── images
│ │ │ ├── 0.jpg
│ │ │ ├── logo-1.png
│ │ │ └── xx.png
│ │ ├── js
│ │ │ ├── area.js
│ │ │ ├── baajax.js
│ │ │ ├── begtable.js
│ │ │ ├── btable.js
│ │ │ ├── common.js
│ │ │ ├── index.js
│ │ │ ├── layout.js
│ │ │ ├── navbar.js
│ │ │ ├── paging.js
│ │ │ ├── tab.js
│ │ │ └── validator.js
│ │ ├── lay
│ │ │ ├── dest
│ │ │ │ ├── layui.all.js
│ │ │ │ └── layui.mod.js
│ │ │ ├── lib
│ │ │ │ └── jquery.js
│ │ │ └── modules
│ │ │ │ ├── code.js
│ │ │ │ ├── element.js
│ │ │ │ ├── flow.js
│ │ │ │ ├── form.js
│ │ │ │ ├── jquery.js
│ │ │ │ ├── laydate.js
│ │ │ │ ├── layedit.js
│ │ │ │ ├── layer.js
│ │ │ │ ├── laypage.js
│ │ │ │ ├── laytpl.js
│ │ │ │ ├── mobile.js
│ │ │ │ ├── tree.js
│ │ │ │ ├── upload.js
│ │ │ │ └── util.js
│ │ ├── layui.js
│ │ ├── modules
│ │ │ ├── icheck.js
│ │ │ ├── menu.js
│ │ │ └── pjax.js
│ │ └── plugins
│ │ │ ├── HyperDown
│ │ │ ├── LICENSE
│ │ │ └── Parser.js
│ │ │ ├── bootstrap-table
│ │ │ ├── bootstrap-table-mobile.min.js
│ │ │ ├── bootstrap-table.min.js
│ │ │ ├── css
│ │ │ │ └── bootstrap-table.min.css
│ │ │ └── locale
│ │ │ │ ├── bootstrap-table-zh-CN.js
│ │ │ │ └── bootstrap-table-zh-CN.min.js
│ │ │ ├── bootstrap-treeview
│ │ │ ├── css
│ │ │ │ └── bootstrap-treeview.min.css
│ │ │ └── js
│ │ │ │ └── bootstrap-treeview.min.js
│ │ │ ├── font-awesome
│ │ │ ├── css
│ │ │ │ ├── font-awesome.css
│ │ │ │ └── font-awesome.min.css
│ │ │ └── fonts
│ │ │ │ ├── FontAwesome.otf
│ │ │ │ ├── fontawesome-webfont.eot
│ │ │ │ ├── fontawesome-webfont.svg
│ │ │ │ ├── fontawesome-webfont.ttf
│ │ │ │ ├── fontawesome-webfont.woff
│ │ │ │ └── fontawesome-webfont.woff2
│ │ │ ├── jquery-treegrid
│ │ │ ├── css
│ │ │ │ └── jquery.treegrid.css
│ │ │ ├── extension
│ │ │ │ └── jquery.treegrid.extension.js
│ │ │ ├── img
│ │ │ │ ├── collapse.png
│ │ │ │ ├── expand.png
│ │ │ │ ├── file.png
│ │ │ │ └── folder.png
│ │ │ └── js
│ │ │ │ ├── jquery.treegrid.bootstrap3.js
│ │ │ │ └── jquery.treegrid.min.js
│ │ │ ├── jquery.min.js
│ │ │ ├── marked
│ │ │ └── marked.js
│ │ │ └── select2
│ │ │ ├── css
│ │ │ ├── select2.css
│ │ │ └── select2.min.css
│ │ │ └── js
│ │ │ ├── i18n
│ │ │ ├── ar.js
│ │ │ ├── az.js
│ │ │ ├── bg.js
│ │ │ ├── ca.js
│ │ │ ├── cs.js
│ │ │ ├── da.js
│ │ │ ├── de.js
│ │ │ ├── el.js
│ │ │ ├── en.js
│ │ │ ├── es.js
│ │ │ ├── et.js
│ │ │ ├── eu.js
│ │ │ ├── fa.js
│ │ │ ├── fi.js
│ │ │ ├── fr.js
│ │ │ ├── gl.js
│ │ │ ├── he.js
│ │ │ ├── hi.js
│ │ │ ├── hr.js
│ │ │ ├── hu.js
│ │ │ ├── id.js
│ │ │ ├── is.js
│ │ │ ├── it.js
│ │ │ ├── ja.js
│ │ │ ├── km.js
│ │ │ ├── ko.js
│ │ │ ├── lt.js
│ │ │ ├── lv.js
│ │ │ ├── mk.js
│ │ │ ├── ms.js
│ │ │ ├── nb.js
│ │ │ ├── nl.js
│ │ │ ├── pl.js
│ │ │ ├── pt-BR.js
│ │ │ ├── pt.js
│ │ │ ├── ro.js
│ │ │ ├── ru.js
│ │ │ ├── sk.js
│ │ │ ├── sr-Cyrl.js
│ │ │ ├── sr.js
│ │ │ ├── sv.js
│ │ │ ├── th.js
│ │ │ ├── tr.js
│ │ │ ├── uk.js
│ │ │ ├── vi.js
│ │ │ ├── zh-CN.js
│ │ │ └── zh-TW.js
│ │ │ ├── select2.full.js
│ │ │ ├── select2.full.min.js
│ │ │ ├── select2.js
│ │ │ └── select2.min.js
│ │ ├── template
│ │ ├── biz.java.vm
│ │ ├── controller.java.vm
│ │ ├── entity.java.vm
│ │ ├── index.js.vm
│ │ ├── index.vue.vm
│ │ ├── mapper.java.vm
│ │ └── mapper.xml.vm
│ │ └── templates
│ │ ├── about.html
│ │ ├── generator
│ │ └── list.html
│ │ └── index.html
├── ace-interface
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── wxiaoqi
│ │ └── security
│ │ └── api
│ │ └── vo
│ │ ├── authority
│ │ └── PermissionInfo.java
│ │ ├── log
│ │ └── LogInfo.java
│ │ ├── search
│ │ └── IndexObject.java
│ │ └── user
│ │ └── UserInfo.java
├── ace-tool
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ ├── ToolBootstrap.java
│ │ │ ├── config
│ │ │ ├── CloudStorageConfig.java
│ │ │ └── LuceneConfiguration.java
│ │ │ ├── oss
│ │ │ ├── cloud
│ │ │ │ ├── AliyunCloudStorageService.java
│ │ │ │ ├── CloudStorageService.java
│ │ │ │ ├── OSSFactory.java
│ │ │ │ ├── QcloudCloudStorageService.java
│ │ │ │ └── QiniuCloudStorageService.java
│ │ │ ├── constants
│ │ │ │ └── OSSConstant.java
│ │ │ └── controller
│ │ │ │ └── OssController.java
│ │ │ └── search
│ │ │ ├── controller
│ │ │ └── SearchController.java
│ │ │ ├── lucene
│ │ │ ├── LuceneDao.java
│ │ │ └── util
│ │ │ │ ├── DocumentUtil.java
│ │ │ │ ├── IKAnalyzer5x.java
│ │ │ │ ├── IKTokenizer5x.java
│ │ │ │ └── QueryUtil.java
│ │ │ └── service
│ │ │ ├── LuceneService.java
│ │ │ └── impl
│ │ │ └── LuceneServiceImpl.java
│ │ └── resources
│ │ ├── application.yml
│ │ └── bootstrap.yml
└── pom.xml
├── ace-sidecar
├── ace-sidecar-client-demo
│ ├── pom.xml
│ ├── readme.md
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── sidecarclient
│ │ │ ├── PythonServerBootstrap.java
│ │ │ ├── client
│ │ │ └── PythonFeignClient.java
│ │ │ ├── entity
│ │ │ └── Message.java
│ │ │ └── rest
│ │ │ └── PythonController.java
│ │ └── resources
│ │ └── application.yml
├── ace-sidecar-server
│ ├── pom.xml
│ ├── readme.md
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── wxiaoqi
│ │ │ └── security
│ │ │ └── sidecar
│ │ │ └── SidercarBootstrap.java
│ │ └── resources
│ │ └── application.yml
└── pom.xml
├── alibaba-base
└── nacos.sql
├── docker-compose.yml
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | */target
2 | *.iml
3 | /.idea
4 | *.class
5 | target/
6 | .project
7 | .settings/
8 | .classpath
9 | ace-modules/ace-tool/src/main/resources/application-dev.yml
10 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/EnableAceAuthClient.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client;
2 |
3 | import com.github.wxiaoqi.security.auth.client.configuration.AutoConfiguration;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.context.annotation.Import;
6 |
7 | import java.lang.annotation.*;
8 |
9 | /**
10 | * Created by ace on 2017/9/15.
11 | */
12 | @Target(ElementType.TYPE)
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Import(AutoConfiguration.class)
15 | @Documented
16 | @Inherited
17 | public @interface EnableAceAuthClient {
18 | }
19 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/annotation/IgnoreClientToken.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * 忽略服务鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreClientToken {
15 | }
16 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/annotation/IgnoreUserToken.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * 忽略用户鉴权
10 | * Created by ace on 2017/9/27.
11 | */
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target(value={ElementType.METHOD,ElementType.TYPE})
14 | public @interface IgnoreUserToken {
15 | }
16 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/config/FeignOkHttpConfig.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.config;
2 |
3 | import com.github.wxiaoqi.security.auth.client.interceptor.OkHttpTokenInterceptor;
4 | import feign.Feign;
5 | import okhttp3.ConnectionPool;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.boot.autoconfigure.AutoConfigureBefore;
8 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
9 | import org.springframework.cloud.openfeign.FeignAutoConfiguration;
10 | import org.springframework.context.annotation.Bean;
11 | import org.springframework.context.annotation.Configuration;
12 |
13 | import java.util.concurrent.TimeUnit;
14 |
15 | @AutoConfigureBefore(FeignAutoConfiguration.class)
16 | @Configuration
17 | @ConditionalOnClass(Feign.class)
18 | public class FeignOkHttpConfig {
19 |
20 | @Autowired
21 | OkHttpTokenInterceptor okHttpLoggingInterceptor;
22 |
23 | private int feignOkHttpReadTimeout = 60;
24 | private int feignConnectTimeout = 60;
25 | private int feignWriteTimeout = 120;
26 |
27 | @Bean
28 | public okhttp3.OkHttpClient okHttpClient() {
29 | return new okhttp3.OkHttpClient.Builder().readTimeout(feignOkHttpReadTimeout, TimeUnit.SECONDS).connectTimeout(feignConnectTimeout, TimeUnit.SECONDS)
30 | .writeTimeout(feignWriteTimeout, TimeUnit.SECONDS).connectionPool(new ConnectionPool())
31 | .addInterceptor(okHttpLoggingInterceptor)
32 | .build();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/config/UserAuthConfig.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.config;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 |
7 | /**
8 | * Created by ace on 2017/9/15.
9 | */
10 | public class UserAuthConfig {
11 |
12 | @Value("${auth.user.token-header}")
13 | private String tokenHeader;
14 |
15 | private byte[] pubKeyByte;
16 |
17 | public String getTokenHeader() {
18 | return tokenHeader;
19 | }
20 |
21 | public void setTokenHeader(String tokenHeader) {
22 | this.tokenHeader = tokenHeader;
23 | }
24 |
25 | public String getToken(HttpServletRequest request){
26 | return request.getHeader(this.getTokenHeader());
27 | }
28 |
29 | public byte[] getPubKeyByte() {
30 | return pubKeyByte;
31 | }
32 |
33 | public void setPubKeyByte(byte[] pubKeyByte) {
34 | this.pubKeyByte = pubKeyByte;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/configuration/AutoConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.configuration;
2 |
3 | import com.github.wxiaoqi.security.auth.client.config.ServiceAuthConfig;
4 | import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.ComponentScan;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | /**
10 | * Created by ace on 2017/9/15.
11 | */
12 | @Configuration
13 | @ComponentScan({"com.github.wxiaoqi.security.auth.client","com.github.wxiaoqi.security.auth.common.event"})
14 | public class AutoConfiguration {
15 | @Bean
16 | ServiceAuthConfig getServiceAuthConfig(){
17 | return new ServiceAuthConfig();
18 | }
19 |
20 | @Bean
21 | UserAuthConfig getUserAuthConfig(){
22 | return new UserAuthConfig();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/exception/JwtIllegalArgumentException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.exception;
2 |
3 | /**
4 | * Created by ace on 2017/9/15.
5 | */
6 | public class JwtIllegalArgumentException extends Exception {
7 | public JwtIllegalArgumentException(String s) {
8 | super(s);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/exception/JwtSignatureException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.exception;
2 |
3 | /**
4 | *
5 | * @author ace
6 | * @date 2017/9/15
7 | */
8 | public class JwtSignatureException extends Exception {
9 | public JwtSignatureException(String s) {
10 | super(s);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/exception/JwtTokenExpiredException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.exception;
2 |
3 | /**
4 | * Created by ace on 2017/9/15.
5 | */
6 | public class JwtTokenExpiredException extends Exception {
7 | public JwtTokenExpiredException(String s) {
8 | super(s);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/jwt/UserAuthUtil.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.client.jwt;
2 |
3 | import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
4 | import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
5 | import com.github.wxiaoqi.security.auth.common.util.jwt.JWTHelper;
6 | import com.github.wxiaoqi.security.common.exception.auth.UserTokenException;
7 | import io.jsonwebtoken.ExpiredJwtException;
8 | import io.jsonwebtoken.SignatureException;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.context.annotation.Configuration;
11 |
12 | /**
13 | * Created by ace on 2017/9/15.
14 | */
15 | @Configuration
16 | public class UserAuthUtil {
17 | @Autowired
18 | private UserAuthConfig userAuthConfig;
19 | public IJWTInfo getInfoFromToken(String token) throws Exception {
20 | try {
21 | return JWTHelper.getInfoFromToken(token, userAuthConfig.getPubKeyByte());
22 | }catch (ExpiredJwtException ex){
23 | throw new UserTokenException("User token expired!");
24 | }catch (SignatureException ex){
25 | throw new UserTokenException("User token signature error!");
26 | }catch (IllegalArgumentException ex){
27 | throw new UserTokenException("User token is null or empty!");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | ace-auth
7 | com.github.wxiaoqi
8 | 2.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | ace-auth-common
13 |
14 |
15 | io.jsonwebtoken
16 | jjwt
17 | 0.7.0
18 |
19 |
20 | joda-time
21 | joda-time
22 | 2.9.5
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-common/src/main/java/com/github/wxiaoqi/security/auth/common/constatns/CommonConstants.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.common.constatns;
2 |
3 | /**
4 | * Created by ace on 2017/8/29.
5 | */
6 | public class CommonConstants {
7 | public final static String RESOURCE_TYPE_MENU = "menu";
8 | public final static String RESOURCE_TYPE_BTN = "button";
9 | public static final Integer EX_TOKEN_ERROR_CODE = 40101;
10 | // 用户token异常
11 | public static final Integer EX_USER_INVALID_CODE = 40102;
12 | // 客户端token异常
13 | public static final Integer EX_CLIENT_INVALID_CODE = 40131;
14 | public static final Integer EX_CLIENT_FORBIDDEN_CODE = 40331;
15 | public static final Integer EX_OTHER_CODE = 500;
16 | public static final String CONTEXT_KEY_USER_ID = "currentUserId";
17 | public static final String CONTEXT_KEY_USERNAME = "currentUserName";
18 | public static final String CONTEXT_KEY_USER_NAME = "currentUser";
19 | public static final String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
20 | public static final String JWT_KEY_USER_ID = "userId";
21 | public static final String JWT_KEY_NAME = "name";
22 | }
23 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-common/src/main/java/com/github/wxiaoqi/security/auth/common/util/StringHelper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.common.util;
2 |
3 | /**
4 | * Created by ace on 2017/9/10.
5 | */
6 | public class StringHelper {
7 | public static String getObjectValue(Object obj){
8 | return obj==null?"":obj.toString();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-common/src/main/java/com/github/wxiaoqi/security/auth/common/util/jwt/IJWTInfo.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.common.util.jwt;
2 |
3 | /**
4 | * Created by ace on 2017/9/10.
5 | */
6 | public interface IJWTInfo {
7 | /**
8 | * 获取用户名
9 | * @return
10 | */
11 | String getUniqueName();
12 |
13 | /**
14 | * 获取用户ID
15 | * @return
16 | */
17 | String getId();
18 |
19 | /**
20 | * 获取名称
21 | * @return
22 | */
23 | String getName();
24 | }
25 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-auth.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/AuthBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth;
2 |
3 |
4 | import org.mybatis.spring.annotation.MapperScan;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
9 | import org.springframework.cloud.openfeign.EnableFeignClients;
10 |
11 | /**
12 | * Created by Ace on 2017/6/2.
13 | */
14 | @SpringBootApplication
15 | @EnableDiscoveryClient
16 | @EnableFeignClients
17 | @MapperScan("com.github.wxiaoqi.security.auth.mapper")
18 | @EnableAutoConfiguration
19 | public class AuthBootstrap {
20 | public static void main(String[] args) {
21 | SpringApplication.run(AuthBootstrap.class, args);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/bean/ClientInfo.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.bean;
2 |
3 |
4 | import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
5 |
6 | /**
7 | * Created by ace on 2017/9/10.
8 | */
9 | public class ClientInfo implements IJWTInfo {
10 | String clientId;
11 | String name;
12 |
13 | public ClientInfo(String clientId, String name, String id) {
14 | this.clientId = clientId;
15 | this.name = name;
16 | this.id = id;
17 | }
18 |
19 | public void setId(String id) {
20 | this.id = id;
21 | }
22 |
23 | String id;
24 | public String getClientId() {
25 | return clientId;
26 | }
27 |
28 | public void setClientId(String clientId) {
29 | this.clientId = clientId;
30 | }
31 |
32 | public void setName(String name) {
33 | this.name = name;
34 | }
35 |
36 | @Override
37 | public String getUniqueName() {
38 | return clientId;
39 | }
40 |
41 | @Override
42 | public String getId() {
43 | return id;
44 | }
45 |
46 | @Override
47 | public String getName() {
48 | return name;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/biz/ClientServiceBiz.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.biz;
2 |
3 | import com.github.wxiaoqi.security.auth.entity.ClientService;
4 | import com.github.wxiaoqi.security.auth.mapper.ClientServiceMapper;
5 | import com.github.wxiaoqi.security.common.biz.BaseBiz;
6 | import org.springframework.stereotype.Service;
7 |
8 | /**
9 | * @author ace
10 | * @create 2017/12/30.
11 | */
12 | @Service
13 | public class ClientServiceBiz extends BaseBiz {
14 | }
15 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/configuration/ClientConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.configuration;
2 |
3 | import org.springframework.beans.factory.annotation.Value;
4 | import org.springframework.context.annotation.Configuration;
5 |
6 | /**
7 | * Created by ace on 2017/9/12.
8 | */
9 | @Configuration
10 | public class ClientConfiguration {
11 | @Value("${client.id}")
12 | private String clientId;
13 | @Value("${client.secret}")
14 | private String clientSecret;
15 | @Value("${client.token-header}")
16 | private String clientTokenHeader;
17 |
18 | public String getClientTokenHeader() {
19 | return clientTokenHeader;
20 | }
21 |
22 | public String getClientSecret() {
23 | return clientSecret;
24 | }
25 |
26 | public String getClientId() {
27 | return clientId;
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/configuration/FeignConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.configuration;
2 |
3 | import com.github.wxiaoqi.security.auth.interceptor.ClientTokenInterceptor;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * Created by ace on 2017/9/12.
9 | */
10 | @Configuration
11 | public class FeignConfiguration {
12 | @Bean
13 | ClientTokenInterceptor getClientTokenInterceptor(){
14 | return new ClientTokenInterceptor();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/configuration/KeyConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.configuration;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author ace
9 | * @create 2017/12/17.
10 | */
11 | @Configuration
12 | @Data
13 | public class KeyConfiguration {
14 | @Value("${jwt.rsa-secret}")
15 | private String userSecret;
16 | @Value("${client.rsa-secret}")
17 | private String serviceSecret;
18 | private byte[] userPubKey;
19 | private byte[] userPriKey;
20 | private byte[] servicePriKey;
21 | private byte[] servicePubKey;
22 | }
23 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/configuration/UserConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.configuration;
2 |
3 | import lombok.Data;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author ace
9 | * @create 2017/12/26.
10 | */
11 | @Configuration
12 | @Data
13 | public class UserConfiguration {
14 | @Value("${jwt.token-header}")
15 | private String userTokenHeader;
16 | }
17 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/ServiceController.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.controller;
2 |
3 | import com.github.wxiaoqi.security.auth.biz.ClientBiz;
4 | import com.github.wxiaoqi.security.auth.entity.Client;
5 | import com.github.wxiaoqi.security.auth.entity.ClientService;
6 | import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
7 | import com.github.wxiaoqi.security.common.rest.BaseController;
8 | import org.springframework.web.bind.annotation.*;
9 |
10 | /**
11 | * @author ace
12 | * @create 2017/12/26.
13 | */
14 | @RestController
15 | @RequestMapping("service")
16 | public class ServiceController extends BaseController{
17 |
18 | @RequestMapping(value = "/{id}/client", method = RequestMethod.PUT)
19 | @ResponseBody
20 | public ObjectRestResponse modifyUsers(@PathVariable int id, String clients){
21 | baseBiz.modifyClientServices(id, clients);
22 | return new ObjectRestResponse().rel(true);
23 | }
24 |
25 | @RequestMapping(value = "/{id}/client", method = RequestMethod.GET)
26 | @ResponseBody
27 | public ObjectRestResponse getUsers(@PathVariable int id){
28 | return new ObjectRestResponse().rel(true).data(baseBiz.getClientServices(id));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.feign;
2 |
3 | import com.github.wxiaoqi.security.api.vo.user.UserInfo;
4 | import com.github.wxiaoqi.security.auth.configuration.FeignConfiguration;
5 | import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
6 | import org.springframework.cloud.openfeign.FeignClient;
7 | import org.springframework.web.bind.annotation.RequestBody;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 | import org.springframework.web.bind.annotation.RequestMethod;
10 |
11 |
12 | /**
13 | * ${DESCRIPTION}
14 | *
15 | * @author wanghaobin
16 | * @create 2017-06-21 8:11
17 | */
18 | @FeignClient(value = "ace-admin",configuration = FeignConfiguration.class)
19 | public interface IUserService {
20 | @RequestMapping(value = "/api/user/validate", method = RequestMethod.POST)
21 | public UserInfo validate(@RequestBody JwtAuthenticationRequest authenticationRequest);
22 | }
23 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/interceptor/ClientTokenInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.interceptor;
2 |
3 | import com.github.wxiaoqi.security.auth.configuration.ClientConfiguration;
4 | import com.github.wxiaoqi.security.auth.service.AuthClientService;
5 | import feign.RequestInterceptor;
6 | import feign.RequestTemplate;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 |
11 | /**
12 | * Created by ace on 2017/9/12.
13 | */
14 | public class ClientTokenInterceptor implements RequestInterceptor {
15 | private Logger logger = LoggerFactory.getLogger(ClientTokenInterceptor.class);
16 | @Autowired
17 | private ClientConfiguration clientConfiguration;
18 | @Autowired
19 | private AuthClientService authClientService;
20 |
21 | @Override
22 | public void apply(RequestTemplate requestTemplate) {
23 | try {
24 | requestTemplate.header(clientConfiguration.getClientTokenHeader(), authClientService.apply(clientConfiguration.getClientId(), clientConfiguration.getClientSecret()));
25 | } catch (Exception e) {
26 | e.printStackTrace();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/mapper/ClientMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.mapper;
2 |
3 | import com.github.wxiaoqi.security.auth.entity.Client;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | import java.util.List;
7 |
8 | public interface ClientMapper extends Mapper {
9 | // @Select(" SELECT\n" +
10 | // " client.CODE\n" +
11 | // " FROM\n" +
12 | // " auth_client client\n" +
13 | // " INNER JOIN auth_client_service gcs ON gcs.client_id = client.id\n" +
14 | // " WHERE\n" +
15 | // " gcs.service_id = #{serviceId}")
16 | // @ResultType(String.class)
17 | List selectAllowedClient(String serviceId);
18 |
19 | List selectAuthorityServiceInfo(int clientId);
20 | }
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/mapper/ClientServiceMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.mapper;
2 |
3 | import com.github.wxiaoqi.security.auth.entity.ClientService;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | public interface ClientServiceMapper extends Mapper {
7 | void deleteByServiceId(int id);
8 | }
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthClientService.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.service;
2 |
3 |
4 | import java.util.List;
5 |
6 | /**
7 | * Created by ace on 2017/9/10.
8 | */
9 | public interface AuthClientService {
10 | public String apply(String clientId, String secret) throws Exception;
11 |
12 | /**
13 | * 获取授权的客户端列表
14 | * @param serviceId
15 | * @param secret
16 | * @return
17 | */
18 | public List getAllowedClient(String serviceId, String secret);
19 |
20 | /**
21 | * 获取服务授权的客户端列表
22 | * @param serviceId
23 | * @return
24 | */
25 | public List getAllowedClient(String serviceId);
26 |
27 | public void registryClient();
28 |
29 | public void validate(String clientId, String secret) throws Exception;
30 | }
31 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.service;
2 |
3 |
4 | import com.github.wxiaoqi.security.auth.util.user.JwtAuthenticationRequest;
5 |
6 | public interface AuthService {
7 | String login(JwtAuthenticationRequest authenticationRequest) throws Exception;
8 | String refresh(String oldToken) throws Exception;
9 | void validate(String token) throws Exception;
10 | }
11 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/util/client/ClientTokenUtil.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.util.client;
2 |
3 | import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
4 | import com.github.wxiaoqi.security.auth.common.util.jwt.JWTHelper;
5 | import com.github.wxiaoqi.security.auth.configuration.KeyConfiguration;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.beans.factory.annotation.Value;
10 | import org.springframework.context.annotation.Configuration;
11 |
12 | /**
13 | * Created by ace on 2017/9/10.
14 | */
15 | @Configuration
16 | public class ClientTokenUtil {
17 | private Logger logger = LoggerFactory.getLogger(ClientTokenUtil.class);
18 |
19 | @Value("${client.expire}")
20 | private int expire;
21 | @Autowired
22 | private KeyConfiguration keyConfiguration;
23 |
24 | public String generateToken(IJWTInfo jwtInfo) throws Exception {
25 | return JWTHelper.generateToken(jwtInfo, keyConfiguration.getServicePriKey(), expire);
26 | }
27 |
28 | public IJWTInfo getInfoFromToken(String token) throws Exception {
29 | return JWTHelper.getInfoFromToken(token, keyConfiguration.getServicePubKey());
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/util/user/JwtAuthenticationRequest.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.util.user;
2 |
3 | import java.io.Serializable;
4 |
5 | public class JwtAuthenticationRequest implements Serializable {
6 |
7 | private static final long serialVersionUID = -8445943548965154778L;
8 |
9 | private String username;
10 | private String password;
11 |
12 |
13 | public JwtAuthenticationRequest(String username, String password) {
14 | this.username = username;
15 | this.password = password;
16 | }
17 |
18 | public JwtAuthenticationRequest() {
19 | }
20 |
21 | public String getPassword() {
22 | return password;
23 | }
24 |
25 | public void setPassword(String password) {
26 | this.password = password;
27 | }
28 |
29 | public String getUsername() {
30 | return username;
31 | }
32 |
33 | public void setUsername(String username) {
34 | this.username = username;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/util/user/JwtAuthenticationResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.util.user;
2 |
3 | import java.io.Serializable;
4 |
5 | public class JwtAuthenticationResponse implements Serializable {
6 | private static final long serialVersionUID = 1250166508152483573L;
7 |
8 | private final String token;
9 |
10 | public JwtAuthenticationResponse(String token) {
11 | this.token = token;
12 | }
13 |
14 | public String getToken() {
15 | return this.token;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/util/user/JwtTokenUtil.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.auth.util.user;
2 |
3 | import com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo;
4 | import com.github.wxiaoqi.security.auth.common.util.jwt.JWTHelper;
5 | import com.github.wxiaoqi.security.auth.configuration.KeyConfiguration;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.beans.factory.annotation.Value;
8 | import org.springframework.data.redis.core.RedisTemplate;
9 | import org.springframework.stereotype.Component;
10 |
11 | /**
12 | * Created by ace on 2017/9/10.
13 | */
14 | @Component
15 | public class JwtTokenUtil {
16 |
17 | @Value("${jwt.expire}")
18 | private int expire;
19 | @Autowired
20 | private KeyConfiguration keyConfiguration;
21 |
22 | @Autowired
23 | private RedisTemplate redisTemplate;
24 |
25 | public String generateToken(IJWTInfo jwtInfo) throws Exception {
26 | return JWTHelper.generateToken(jwtInfo, keyConfiguration.getUserPriKey(),expire);
27 | }
28 |
29 | public IJWTInfo getInfoFromToken(String token) throws Exception {
30 | return JWTHelper.getInfoFromToken(token, keyConfiguration.getUserPubKey());
31 | }
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ace-auth/ace-auth-server/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: ace-auth
4 | cloud:
5 | nacos:
6 | config:
7 | server-addr: 127.0.0.1:8848
8 | file-extension: yaml
9 | profiles:
10 | active: dev
--------------------------------------------------------------------------------
/ace-auth/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | ace-security
7 | com.github.wxiaoqi
8 | 2.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | ace-auth
13 | pom
14 |
15 |
16 | ace-auth-client
17 | ace-auth-server
18 | ace-auth-common
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/CommonConstants.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.constant;
2 |
3 | /**
4 | * Created by ace on 2017/8/29.
5 | */
6 | public class CommonConstants {
7 | public final static String RESOURCE_TYPE_MENU = "menu";
8 | public final static String RESOURCE_TYPE_BTN = "button";
9 | // 用户token异常
10 | public static final Integer EX_USER_INVALID_CODE = 40101;
11 | public static final Integer EX_USER_PASS_INVALID_CODE = 40001;
12 | // 客户端token异常
13 | public static final Integer EX_CLIENT_INVALID_CODE = 40301;
14 | public static final Integer EX_CLIENT_FORBIDDEN_CODE = 40331;
15 | public static final Integer EX_OTHER_CODE = 500;
16 | public static final String CONTEXT_KEY_USER_ID = "currentUserId";
17 | public static final String CONTEXT_KEY_USERNAME = "currentUserName";
18 | public static final String CONTEXT_KEY_USER_NAME = "currentUser";
19 | public static final String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
20 | public static final String JWT_KEY_USER_ID = "userId";
21 | public static final String JWT_KEY_NAME = "name";
22 | }
23 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/RestCodeConstants.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.constant;
2 |
3 | /**
4 | * Created by ace on 2017/8/23.
5 | */
6 | public class RestCodeConstants {
7 |
8 | public static final int TOKEN_ERROR_CODE = 40101;
9 | public static final int TOKEN_FORBIDDEN_CODE = 40301;
10 | }
11 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/constant/UserConstant.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.constant;
2 |
3 | /**
4 | * ${DESCRIPTION}
5 | *
6 | * @author wanghaobin
7 | * @create 2017-06-14 8:36
8 | */
9 | public class UserConstant {
10 | public static int PW_ENCORDER_SALT = 12;
11 | }
12 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/BaseException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception;
2 |
3 | /**
4 | * Created by ace on 2017/9/8.
5 | */
6 | public class BaseException extends RuntimeException {
7 | private int status = 200;
8 |
9 | public int getStatus() {
10 | return status;
11 | }
12 |
13 | public void setStatus(int status) {
14 | this.status = status;
15 | }
16 |
17 | public BaseException() {
18 | }
19 |
20 | public BaseException(String message,int status) {
21 | super(message);
22 | this.status = status;
23 | }
24 |
25 | public BaseException(String message) {
26 | super(message);
27 | }
28 |
29 | public BaseException(String message, Throwable cause) {
30 | super(message, cause);
31 | }
32 |
33 | public BaseException(Throwable cause) {
34 | super(cause);
35 | }
36 |
37 | public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
38 | super(message, cause, enableSuppression, writableStackTrace);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/auth/ClientForbiddenException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception.auth;
2 |
3 |
4 | import com.github.wxiaoqi.security.common.constant.CommonConstants;
5 | import com.github.wxiaoqi.security.common.exception.BaseException;
6 |
7 | /**
8 | * Created by ace on 2017/9/12.
9 | */
10 | public class ClientForbiddenException extends BaseException {
11 | public ClientForbiddenException(String message) {
12 | super(message, CommonConstants.EX_CLIENT_FORBIDDEN_CODE);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/auth/ClientInvalidException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception.auth;
2 |
3 |
4 | import com.github.wxiaoqi.security.common.constant.CommonConstants;
5 | import com.github.wxiaoqi.security.common.exception.BaseException;
6 |
7 | /**
8 | * Created by ace on 2017/9/10.
9 | */
10 | public class ClientInvalidException extends BaseException {
11 | public ClientInvalidException(String message) {
12 | super(message, CommonConstants.EX_CLIENT_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/auth/ClientTokenException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception.auth;
2 |
3 |
4 | import com.github.wxiaoqi.security.common.constant.CommonConstants;
5 | import com.github.wxiaoqi.security.common.exception.BaseException;
6 |
7 | /**
8 | * Created by ace on 2017/9/10.
9 | */
10 | public class ClientTokenException extends BaseException {
11 | public ClientTokenException(String message) {
12 | super(message, CommonConstants.EX_CLIENT_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/auth/UserInvalidException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception.auth;
2 |
3 |
4 | import com.github.wxiaoqi.security.common.constant.CommonConstants;
5 | import com.github.wxiaoqi.security.common.exception.BaseException;
6 |
7 | /**
8 | * Created by ace on 2017/9/8.
9 | */
10 | public class UserInvalidException extends BaseException {
11 | public UserInvalidException(String message) {
12 | super(message, CommonConstants.EX_USER_PASS_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/auth/UserTokenException.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.exception.auth;
2 |
3 |
4 | import com.github.wxiaoqi.security.common.constant.CommonConstants;
5 | import com.github.wxiaoqi.security.common.exception.BaseException;
6 |
7 | /**
8 | * Created by ace on 2017/9/8.
9 | */
10 | public class UserTokenException extends BaseException {
11 | public UserTokenException(String message) {
12 | super(message, CommonConstants.EX_USER_INVALID_CODE);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/msg/BaseResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.msg;
2 |
3 | /**
4 | * Created by ace on 2017/8/23.
5 | */
6 | public class BaseResponse {
7 | private int status = 200;
8 | private String message;
9 |
10 | public BaseResponse(int status, String message) {
11 | this.status = status;
12 | this.message = message;
13 | }
14 |
15 | public BaseResponse() {
16 | }
17 |
18 | public String getMessage() {
19 | return message;
20 | }
21 |
22 | public void setMessage(String message) {
23 | this.message = message;
24 | }
25 |
26 | public int getStatus() {
27 | return status;
28 | }
29 |
30 | public void setStatus(int status) {
31 | this.status = status;
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/msg/ListRestResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.msg;
2 |
3 | /**
4 | * ${DESCRIPTION}
5 | *
6 | * @author wanghaobin
7 | * @create 2017-06-09 7:32
8 | */
9 | public class ListRestResponse {
10 | String msg;
11 | T result;
12 | int count;
13 |
14 |
15 |
16 | public String getMsg() {
17 | return msg;
18 | }
19 |
20 | public void setMsg(String msg) {
21 | this.msg = msg;
22 | }
23 |
24 | public T getResult() {
25 | return result;
26 | }
27 |
28 | public void setResult(T result) {
29 | this.result = result;
30 | }
31 |
32 | public int getCount() {
33 | return count;
34 | }
35 |
36 | public void setCount(int count) {
37 | this.count = count;
38 | }
39 |
40 | public ListRestResponse count(int count) {
41 | this.setCount(count);
42 | return this;
43 | }
44 |
45 | public ListRestResponse count(Long count) {
46 | this.setCount(count.intValue());
47 | return this;
48 | }
49 |
50 | public ListRestResponse msg(String msg) {
51 | this.setMsg(msg);
52 | return this;
53 | }
54 |
55 | public ListRestResponse result(T result) {
56 | this.setResult(result);
57 | return this;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/msg/ObjectRestResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.msg;
2 |
3 | /**
4 | * Created by Ace on 2017/6/11.
5 | */
6 | public class ObjectRestResponse extends BaseResponse {
7 |
8 | T data;
9 | boolean rel;
10 |
11 | public boolean isRel() {
12 | return rel;
13 | }
14 |
15 | public void setRel(boolean rel) {
16 | this.rel = rel;
17 | }
18 |
19 |
20 | public ObjectRestResponse rel(boolean rel) {
21 | this.setRel(rel);
22 | return this;
23 | }
24 |
25 |
26 | public ObjectRestResponse data(T data) {
27 | this.setData(data);
28 | return this;
29 | }
30 | public T getData() {
31 | return data;
32 | }
33 |
34 | public void setData(T data) {
35 | this.data = data;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/msg/auth/TokenErrorResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.msg.auth;
2 |
3 | import com.github.wxiaoqi.security.common.constant.RestCodeConstants;
4 | import com.github.wxiaoqi.security.common.msg.BaseResponse;
5 |
6 | /**
7 | * Created by ace on 2017/8/23.
8 | */
9 | public class TokenErrorResponse extends BaseResponse {
10 | public TokenErrorResponse(String message) {
11 | super(RestCodeConstants.TOKEN_ERROR_CODE, message);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/msg/auth/TokenForbiddenResponse.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.msg.auth;
2 |
3 | import com.github.wxiaoqi.security.common.constant.RestCodeConstants;
4 | import com.github.wxiaoqi.security.common.msg.BaseResponse;
5 |
6 | /**
7 | * Created by ace on 2017/8/25.
8 | */
9 | public class TokenForbiddenResponse extends BaseResponse {
10 | public TokenForbiddenResponse(String message) {
11 | super(RestCodeConstants.TOKEN_FORBIDDEN_CODE, message);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/util/ClientUtil.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.util;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 |
5 | public class ClientUtil {
6 | /**
7 | * 获取客户端真实ip
8 | * @param request
9 | * @return
10 | */
11 | public static String getClientIp(HttpServletRequest request){
12 | String ip = request.getHeader("x-forwarded-for");
13 | if (ip==null||ip.length()==0||"unknown".equalsIgnoreCase(ip)) {
14 | ip = request.getHeader("Proxy-Client-IP");
15 | }
16 | if (ip==null||ip.length()==0||"unknown".equalsIgnoreCase(ip)) {
17 | ip = request.getHeader("WL-Proxy-Client-IP");
18 | }
19 | if (ip==null||ip.length()==0||"unknown".equalsIgnoreCase(ip)) {
20 | ip = request.getRemoteAddr();
21 | }
22 | return ip;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/util/Query.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.util;
2 |
3 |
4 | import java.util.LinkedHashMap;
5 | import java.util.Map;
6 |
7 | /**
8 | * 查询参数
9 | */
10 | public class Query extends LinkedHashMap {
11 | private static final long serialVersionUID = 1L;
12 | //当前页码
13 | private int page = 1;
14 | //每页条数
15 | private int limit = 10;
16 |
17 | public Query(Map params){
18 | this.putAll(params);
19 | //分页参数
20 | if(params.get("page")!=null) {
21 | this.page = Integer.parseInt(params.get("page").toString());
22 | }
23 | if(params.get("limit")!=null) {
24 | this.limit = Integer.parseInt(params.get("limit").toString());
25 | }
26 | this.remove("page");
27 | this.remove("limit");
28 | }
29 |
30 |
31 | public int getPage() {
32 | return page;
33 | }
34 |
35 | public void setPage(int page) {
36 | this.page = page;
37 | }
38 |
39 | public int getLimit() {
40 | return limit;
41 | }
42 |
43 | public void setLimit(int limit) {
44 | this.limit = limit;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/util/StringHelper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.util;
2 |
3 | /**
4 | * Created by ace on 2017/9/10.
5 | */
6 | public class StringHelper {
7 | public static String getObjectValue(Object obj){
8 | return obj==null?"":obj.toString();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/util/UUIDUtils.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.util;
2 |
3 | import java.util.UUID;
4 |
5 | /**
6 | * Created by ace on 2017/9/27.
7 | */
8 | public class UUIDUtils {
9 | public static String[] chars = new String[] { "a", "b", "c", "d", "e", "f",
10 | "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
11 | "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
12 | "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
13 | "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
14 | "W", "X", "Y", "Z" };
15 |
16 |
17 | public static String generateShortUuid() {
18 | StringBuffer shortBuffer = new StringBuffer();
19 | String uuid = UUID.randomUUID().toString().replace("-", "");
20 | for (int i = 0; i < 8; i++) {
21 | String str = uuid.substring(i * 4, i * 4 + 4);
22 | int x = Integer.parseInt(str, 16);
23 | shortBuffer.append(chars[x % 0x3E]);
24 | }
25 | return shortBuffer.toString();
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ace-common/src/main/java/com/github/wxiaoqi/security/common/vo/TreeNode.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.common.vo;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | /**
7 | * Created by Ace on 2017/6/12.
8 | */
9 | public class TreeNode {
10 | protected int id;
11 | protected int parentId;
12 |
13 | public List getChildren() {
14 | return children;
15 | }
16 |
17 | public void setChildren(List children) {
18 | this.children = children;
19 | }
20 |
21 | List children = new ArrayList();
22 |
23 | public int getId() {
24 | return id;
25 | }
26 |
27 | public void setId(int id) {
28 | this.id = id;
29 | }
30 |
31 | public int getParentId() {
32 | return parentId;
33 | }
34 |
35 | public void setParentId(int parentId) {
36 | this.parentId = parentId;
37 | }
38 |
39 | public void add(TreeNode node){
40 | children.add(node);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ace-control/ace-monitor/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-monitor.jar app.jar
4 | RUN bash -c 'touch /app.jar'
5 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
6 |
--------------------------------------------------------------------------------
/ace-control/ace-monitor/src/main/java/com/github/wxiaoqi/security/monitor/MonitorBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.monitor;
2 |
3 | import de.codecentric.boot.admin.server.config.EnableAdminServer;
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 |
8 | /**
9 | * ${DESCRIPTION}
10 | *
11 | * @author wanghaobin
12 | * @create 2017-05-25 12:44
13 | */
14 | @SpringBootApplication
15 | @EnableAdminServer
16 | @EnableDiscoveryClient
17 | public class MonitorBootstrap {
18 | public static void main(String[] args) {
19 | SpringApplication.run(MonitorBootstrap.class, args);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ace-control/ace-monitor/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: ace-monitor
4 | cloud:
5 | nacos:
6 | discovery:
7 | server-addr: 127.0.0.1:8848
8 |
9 | server:
10 | port: 8764 #启动端口
11 | #
12 | #eureka:
13 | # instance:
14 | # preferIpAddress: true
15 | # statusPageUrlPath: /actuator/info
16 | # healthCheckUrlPath: /actuator/health
17 | # client:
18 | # registerWithEureka: true
19 | # fetchRegistry: true
20 | # serviceUrl:
21 | # defaultZone: http://localhost:8761/eureka/
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos-server-0.8.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwn132/cloud-platform/2aae951fffb02340bacbbc264eaa60e026ddb9c6/ace-control/ace-nacos/nacos-server-0.8.0.zip
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/NOTICE:
--------------------------------------------------------------------------------
1 | Nacos
2 | Copyright 2018-2019 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Alibaba MiddleWare Group.
6 |
7 | ------
8 | This product has a bundle netty:
9 | The Spring oot Project
10 | =================
11 |
12 | Please visit the Netty web site for more information:
13 |
14 | * http://netty.io/
15 |
16 | Copyright 2014 The Netty Project
17 |
18 | The Netty Project licenses this file to you under the Apache License,
19 | version 2.0 (the "License"); you may not use this file except in compliance
20 | with the License. You may obtain a copy of the License at:
21 |
22 | http://www.apache.org/licenses/LICENSE-2.0
23 |
24 | Unless required by applicable law or agreed to in writing, software
25 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
26 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
27 | License for the specific language governing permissions and limitations
28 | under the License.
29 |
30 | Also, please refer to each LICENSE..txt file, which is located in
31 | the 'license' directory of the distribution file, for the license terms of the
32 | components that this product depends on.
33 |
34 | ------
35 | This product has a bundle commons-lang, which includes software from the Spring Framework,
36 | under the Apache License 2.0 (see: StringUtils.containsWhitespace())
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/bin/shutdown.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem Copyright 1999-2018 Alibaba Group Holding Ltd.
3 | rem Licensed under the Apache License, Version 2.0 (the "License");
4 | rem you may not use this file except in compliance with the License.
5 | rem You may obtain a copy of the License at
6 | rem
7 | rem http://www.apache.org/licenses/LICENSE-2.0
8 | rem
9 | rem Unless required by applicable law or agreed to in writing, software
10 | rem distributed under the License is distributed on an "AS IS" BASIS,
11 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | rem See the License for the specific language governing permissions and
13 | rem limitations under the License.
14 | if not exist "%JAVA_HOME%\bin\jps.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! & EXIT /B 1
15 |
16 | setlocal
17 |
18 | set "PATH=%JAVA_HOME%\bin;%PATH%"
19 |
20 | echo killing nacos server
21 |
22 | for /f "tokens=1" %%i in ('jps -m ^| find "nacos"') do ( taskkill /F /PID %%i )
23 |
24 | echo Done!
25 |
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/bin/shutdown.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Copyright 1999-2018 Alibaba Group Holding Ltd.
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 |
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | pid=`ps ax | grep -i 'nacos' |grep java | grep -v grep | awk '{print $1}'`
17 | if [ -z "$pid" ] ; then
18 | echo "No nacosServer running."
19 | exit -1;
20 | fi
21 |
22 | echo "The nacosServer(${pid}) is running..."
23 |
24 | kill ${pid}
25 |
26 | echo "Send shutdown request to nacosServer(${pid}) OK"
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/conf/application.properties:
--------------------------------------------------------------------------------
1 | # spring
2 |
3 | server.contextPath=/nacos
4 | server.servlet.contextPath=/nacos
5 | server.port=8848
6 |
7 | nacos.cmdb.dumpTaskInterval=3600
8 | nacos.cmdb.eventTaskInterval=10
9 | nacos.cmdb.labelTaskInterval=300
10 | nacos.cmdb.loadDataAtStart=false
11 |
12 |
13 | # metrics for prometheus
14 | #management.endpoints.web.exposure.include=*
15 |
16 | # metrics for elastic search
17 | management.metrics.export.elastic.enabled=false
18 | #management.metrics.export.elastic.host=http://localhost:9200
19 |
20 | # metrics for influx
21 | management.metrics.export.influx.enabled=false
22 | #management.metrics.export.influx.db=springboot
23 | #management.metrics.export.influx.uri=http://localhost:8086
24 | #management.metrics.export.influx.auto-create-db=true
25 | #management.metrics.export.influx.consistency=one
26 | #management.metrics.export.influx.compressed=true
27 |
28 | server.tomcat.accesslog.enabled=true
29 | server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D
30 | # default current work dir
31 | server.tomcat.basedir=
32 |
33 | ## spring security config
34 | ### turn off security
35 | #spring.security.enabled=false
36 | #management.security=false
37 | #security.basic.enabled=false
38 | #nacos.security.ignore.urls=/**
39 |
40 | nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**
41 |
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/conf/application.properties.example:
--------------------------------------------------------------------------------
1 | # spring
2 |
3 | server.contextPath=/nacos
4 | server.servlet.contextPath=/nacos
5 | server.port=8848
6 |
7 |
8 | db.num=2
9 | db.url.0=jdbc:mysql://11.162.196.16:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
10 | db.url.1=jdbc:mysql://11.163.152.9:3306/nacos_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
11 | db.user=nacos_devtest
12 | db.password=nacos
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/conf/cluster.conf.example:
--------------------------------------------------------------------------------
1 | #it is ip
2 | #example
3 | 10.10.109.214
4 | 11.16.128.34
5 | 11.16.128.36
--------------------------------------------------------------------------------
/ace-control/ace-nacos/nacos/plugins/cmdb/nacos-cmdb-plugin-example.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwn132/cloud-platform/2aae951fffb02340bacbbc264eaa60e026ddb9c6/ace-control/ace-nacos/nacos/plugins/cmdb/nacos-cmdb-plugin-example.jar
--------------------------------------------------------------------------------
/ace-control/ace-sentinel/sentinel-dashboard.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cwn132/cloud-platform/2aae951fffb02340bacbbc264eaa60e026ddb9c6/ace-control/ace-sentinel/sentinel-dashboard.jar
--------------------------------------------------------------------------------
/ace-control/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | ace-security
7 | com.github.wxiaoqi
8 | 2.0-SNAPSHOT
9 |
10 | 4.0.0
11 | pom
12 | ace-control
13 |
14 | ace-monitor
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ace-gate/src/main/java/com/github/wxiaoqi/security/gate/GatewayServerBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.gate;
2 |
3 | import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
4 | import com.github.wxiaoqi.security.gate.utils.DBLog;
5 | import org.springframework.boot.SpringApplication;
6 | import org.springframework.boot.autoconfigure.SpringBootApplication;
7 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
8 | import org.springframework.cloud.openfeign.EnableFeignClients;
9 |
10 | /**
11 | * @author ace
12 | * @create 2018/3/12.
13 | */
14 | @SpringBootApplication
15 | @EnableDiscoveryClient
16 | @EnableAceAuthClient
17 | @EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign","com.github.wxiaoqi.security.gate.feign"})
18 | public class GatewayServerBootstrap {
19 | public static void main(String[] args) {
20 | DBLog.getInstance().start();
21 | SpringApplication.run(GatewayServerBootstrap.class, args);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ace-gate/src/main/java/com/github/wxiaoqi/security/gate/config/GatewayConfig.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.gate.config;
2 |
3 | import com.github.wxiaoqi.security.gate.handler.RequestBodyRoutePredicateFactory;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 | /**
8 | * @author ace
9 | * @create 2019/1/27.
10 | */
11 | @Configuration
12 | public class GatewayConfig {
13 | @Bean
14 | RequestBodyRoutePredicateFactory requestBodyRoutePredicateFactory() {
15 | return new RequestBodyRoutePredicateFactory();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ace-gate/src/main/java/com/github/wxiaoqi/security/gate/fallback/UserServiceFallback.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.gate.fallback;
2 |
3 | import com.github.wxiaoqi.security.gate.feign.IUserService;
4 | import com.github.wxiaoqi.security.api.vo.authority.PermissionInfo;
5 | import lombok.extern.slf4j.Slf4j;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.web.bind.annotation.PathVariable;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author ace
13 | * @create 2018/3/7.
14 | */
15 | @Service
16 | @Slf4j
17 | public class UserServiceFallback implements IUserService {
18 | @Override
19 | public List getPermissionByUsername(@PathVariable("username") String username) {
20 | log.error("调用{}异常{}","getPermissionByUsername",username);
21 | return null;
22 | }
23 |
24 | @Override
25 | public List getAllPermissionInfo() {
26 | log.error("调用{}异常","getPermissionByUsername");
27 | return null;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ace-gate/src/main/java/com/github/wxiaoqi/security/gate/feign/ILogService.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.gate.feign;
2 |
3 | import com.github.wxiaoqi.security.api.vo.log.LogInfo;
4 | import org.springframework.cloud.openfeign.FeignClient;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RequestMethod;
7 |
8 | /**
9 | * ${DESCRIPTION}
10 | *
11 | * @author wanghaobin
12 | * @create 2017-07-01 15:16
13 | */
14 | @FeignClient("ace-admin")
15 | public interface ILogService {
16 | @RequestMapping(value="/api/log/save",method = RequestMethod.POST)
17 | void saveLog(LogInfo info);
18 | }
19 |
--------------------------------------------------------------------------------
/ace-gate/src/main/java/com/github/wxiaoqi/security/gate/feign/IUserService.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.gate.feign;
2 |
3 | import com.github.wxiaoqi.security.gate.fallback.UserServiceFallback;
4 | import com.github.wxiaoqi.security.api.vo.authority.PermissionInfo;
5 | import org.springframework.cloud.openfeign.FeignClient;
6 | import org.springframework.web.bind.annotation.PathVariable;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RequestMethod;
9 |
10 | import java.util.List;
11 |
12 |
13 | /**
14 | * ${DESCRIPTION}
15 | *
16 | * @author wanghaobin
17 | * @create 2017-06-21 8:11
18 | */
19 | @FeignClient(value = "ace-admin",fallback = UserServiceFallback.class)
20 | public interface IUserService {
21 | @RequestMapping(value="/api/user/un/{username}/permissions",method = RequestMethod.GET)
22 | public List getPermissionByUsername(@PathVariable("username") String username);
23 | @RequestMapping(value="/api/permissions",method = RequestMethod.GET)
24 | List getAllPermissionInfo();
25 | }
26 |
--------------------------------------------------------------------------------
/ace-gate/src/main/resources/bootstrap.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: ace-gateway
4 | cloud:
5 | nacos:
6 | config:
7 | server-addr: 127.0.0.1:8848
8 | file-extension: yaml
9 | profiles:
10 | active: dev
11 | main:
12 | allow-bean-definition-overriding: true
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM livingobjects/jre8
2 | VOLUME /tmp
3 | ADD ace-admin.jar app.jar
4 | ADD wait-for-it.sh /wait-for-it.sh
5 | RUN bash -c 'touch /app.jar'
6 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
7 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/AdminBootstrap.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin;
2 |
3 | import com.ace.cache.EnableAceCache;
4 | import com.github.wxiaoqi.security.auth.client.EnableAceAuthClient;
5 | import com.spring4all.swagger.EnableSwagger2Doc;
6 | import org.mybatis.spring.annotation.MapperScan;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 | import org.springframework.boot.builder.SpringApplicationBuilder;
9 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
10 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
11 | import org.springframework.cloud.openfeign.EnableFeignClients;
12 | import org.springframework.scheduling.annotation.EnableScheduling;
13 | import org.springframework.transaction.annotation.EnableTransactionManagement;
14 |
15 | /**
16 | * ${DESCRIPTION}
17 | *
18 | * @author wanghaobin
19 | * @create 2017-05-25 12:44
20 | */
21 | @EnableDiscoveryClient
22 | @EnableCircuitBreaker
23 | @SpringBootApplication
24 | @EnableFeignClients({"com.github.wxiaoqi.security.auth.client.feign"})
25 | @EnableScheduling
26 | @EnableAceAuthClient
27 | @EnableAceCache
28 | @EnableTransactionManagement
29 | @MapperScan("com.github.wxiaoqi.security.admin.mapper")
30 | @EnableSwagger2Doc
31 | public class AdminBootstrap {
32 | public static void main(String[] args) {
33 | new SpringApplicationBuilder(AdminBootstrap.class).run(args); }
34 | }
35 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/GateLogBiz.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.biz;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.GateLog;
4 | import com.github.wxiaoqi.security.admin.mapper.GateLogMapper;
5 | import com.github.wxiaoqi.security.common.biz.BaseBiz;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * ${DESCRIPTION}
11 | *
12 | * @author wanghaobin
13 | * @create 2017-07-01 14:36
14 | */
15 | @Service
16 | @Transactional(rollbackFor = Exception.class)
17 | public class GateLogBiz extends BaseBiz {
18 |
19 | @Override
20 | public void insert(GateLog entity) {
21 | mapper.insert(entity);
22 | }
23 |
24 | @Override
25 | public void insertSelective(GateLog entity) {
26 | mapper.insertSelective(entity);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/GroupTypeBiz.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.biz;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | import com.github.wxiaoqi.security.admin.entity.GroupType;
6 | import com.github.wxiaoqi.security.admin.mapper.GroupTypeMapper;
7 | import com.github.wxiaoqi.security.common.biz.BaseBiz;
8 | import org.springframework.transaction.annotation.Transactional;
9 |
10 | /**
11 | * ${DESCRIPTION}
12 | *
13 | * @author wanghaobin
14 | * @create 2017-06-12 8:48
15 | */
16 | @Service
17 | @Transactional(rollbackFor = Exception.class)
18 | public class GroupTypeBiz extends BaseBiz {
19 | }
20 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/ResourceAuthorityBiz.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.biz;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.ResourceAuthority;
4 | import com.github.wxiaoqi.security.admin.mapper.ResourceAuthorityMapper;
5 | import com.github.wxiaoqi.security.common.biz.BaseBiz;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | /**
10 | * Created by Ace on 2017/6/19.
11 | */
12 | @Service
13 | @Transactional(rollbackFor = Exception.class)
14 | public class ResourceAuthorityBiz extends BaseBiz {
15 | }
16 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/constant/AdminCommonConstant.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.constant;
2 |
3 | /**
4 | * ${DESCRIPTION}
5 | *
6 | * @author wanghaobin
7 | * @create 2017-06-17 14:41
8 | */
9 | public class AdminCommonConstant {
10 | public final static int ROOT = -1;
11 | public final static int DEFAULT_GROUP_TYPE = 0;
12 | /**
13 | * 权限关联类型
14 | */
15 | public final static String AUTHORITY_TYPE_GROUP = "group";
16 | /**
17 | * 权限资源类型
18 | */
19 | public final static String RESOURCE_TYPE_MENU = "menu";
20 | public final static String RESOURCE_TYPE_BTN = "button";
21 |
22 | public final static String RESOURCE_REQUEST_METHOD_GET = "GET";
23 | public final static String RESOURCE_REQUEST_METHOD_PUT = "PUT";
24 | public final static String RESOURCE_REQUEST_METHOD_DELETE = "DELETE";
25 | public final static String RESOURCE_REQUEST_METHOD_POST = "POST";
26 |
27 | public final static String RESOURCE_ACTION_VISIT = "访问";
28 |
29 | public final static String BOOLEAN_NUMBER_FALSE = "0";
30 |
31 | public final static String BOOLEAN_NUMBER_TRUE = "1";
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/ElementMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.mapper;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.Element;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | import java.util.List;
8 |
9 | public interface ElementMapper extends Mapper {
10 | public List selectAuthorityElementByUserId(@Param("userId")String userId);
11 | public List selectAuthorityMenuElementByUserId(@Param("userId")String userId,@Param("menuId")String menuId);
12 | public List selectAuthorityElementByClientId(@Param("clientId")String clientId);
13 | public List selectAllElementPermissions();
14 | }
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/GateLogMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.mapper;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.GateLog;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | public interface GateLogMapper extends Mapper {
7 | }
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/GroupMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.mapper;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.Group;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | public interface GroupMapper extends Mapper {
8 | public void deleteGroupMembersById (@Param("groupId") int groupId);
9 | public void deleteGroupLeadersById (@Param("groupId") int groupId);
10 | public void insertGroupMembersById (@Param("groupId") int groupId,@Param("userId") int userId);
11 | public void insertGroupLeadersById (@Param("groupId") int groupId,@Param("userId") int userId);
12 | }
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/GroupTypeMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.mapper;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.GroupType;
4 | import tk.mybatis.mapper.common.Mapper;
5 |
6 | public interface GroupTypeMapper extends Mapper {
7 | }
--------------------------------------------------------------------------------
/ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MenuMapper.java:
--------------------------------------------------------------------------------
1 | package com.github.wxiaoqi.security.admin.mapper;
2 |
3 | import com.github.wxiaoqi.security.admin.entity.Menu;
4 | import org.apache.ibatis.annotations.Param;
5 | import tk.mybatis.mapper.common.Mapper;
6 |
7 | import java.util.List;
8 |
9 | public interface MenuMapper extends Mapper