Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
809c02c4
提交
809c02c4
编写于
5月 13, 2020
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zuul劫持登录到uaa-api
上级
3aa8980a
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
25 行增加
和
15 行删除
+25
-15
%APP%SecurityConfig.java.ftl
...KGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
+0
-3
application-%APP_PKGPATH%-prod.yml.ftl
...src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
+6
-0
DevBootSecurityConfig.java.ftl
.../java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
+0
-3
application-dev.yml.ftl
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
+10
-2
%API%SecurityConfig.java.ftl
...ATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
+0
-3
AuthenticationController.java.ftl
...%SYS_PKGPATH%/util/rest/AuthenticationController.java.ftl
+2
-3
AuthorizationTokenFilter.java.ftl
..._PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
+1
-1
IBZUAAUserService.java.ftl
...ava/%SYS_PKGPATH%/util/service/IBZUAAUserService.java.ftl
+2
-0
IBZUSERServiceImpl.java.ftl
...va/%SYS_PKGPATH%/util/service/IBZUSERServiceImpl.java.ftl
+2
-0
SimpleUserService.java.ftl
...ava/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
+2
-0
未找到文件。
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/java/%SYS_PKGPATH%/%APP_PKGPATH%/config/%APP%SecurityConfig.java.ftl
浏览文件 @
809c02c4
...
...
@@ -34,9 +34,6 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
浏览文件 @
809c02c4
...
...
@@ -46,6 +46,12 @@ zuul:
serviceId: ibzwf-api
stripPrefix: true
</#if>
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
loginv7:
path: /v7/login
serviceId: ibzuaa-api
stripPrefix: false
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization
...
...
SLN/%PUBPRJ%-boot/src/main/java/%SYS_PKGPATH%/config/DevBootSecurityConfig.java.ftl
浏览文件 @
809c02c4
...
...
@@ -33,9 +33,6 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
浏览文件 @
809c02c4
...
...
@@ -17,11 +17,11 @@ server:
zuul:
routes:
<#assign haswfentity=false>
<#list item.getAllPS
App
DataEntities() as appDataEntity>
<#list item.getAllPSDataEntities() as appDataEntity>
<#assign serviceId="">
<#assign serviceUrl=srfpluralize(appDataEntity.codeName?lower_case)>
<#assign appEntity=appDataEntity.name?lower_case>
<#assign psDataEntity=appDataEntity
.getPSDataEntity()
>
<#assign psDataEntity=appDataEntity>
<#assign systemName=sys.getCodeName()?lower_case>
<#if psDataEntity.hasPSDEWF()??>
<#assign haswfentity=true>
...
...
@@ -30,10 +30,12 @@ zuul:
<#comment>serviceApi模式</#comment>
<#assign serviceId=(psDataEntity.getPSSubSysServiceAPI().getServiceCodeName())!''>
<#assign serviceUrl=srfpluralize(appDataEntity.name?lower_case)>
<#if serviceId!="">
${appEntity}:
path: /${serviceUrl}/**
serviceId: ${serviceId}
stripPrefix: false
</#if>
</#if>
</#list>
<#if haswfentity==true>
...
...
@@ -42,6 +44,12 @@ zuul:
serviceId: ibzwf-api
stripPrefix: false
</#if>
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
loginv7:
path: /v7/login
serviceId: ibzuaa-api
stripPrefix: false
</#if>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
- Cookie,Set-Cookie,Authorization
...
...
SLN/%PUBPRJ%-provider/%PUBPRJ%-provider-%SYSAPI_PKGPATH%/src/main/java/%SYS_PKGPATH%/%SYSAPI_PKGPATH%/config/%API%SecurityConfig.java.ftl
浏览文件 @
809c02c4
...
...
@@ -34,9 +34,6 @@ public class ${item.codeName}SecurityConfig extends WebSecurityConfigurerAdapter
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
/**
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/rest/AuthenticationController.java.ftl
浏览文件 @
809c02c4
...
...
@@ -18,9 +18,11 @@ import org.springframework.security.core.userdetails.UserDetails;
import
org
.
springframework
.
validation
.
annotation
.
Validated
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnProperty
;
@
RestController
@
RequestMapping
(
"/"
)
@
ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"false"
)
public
class
AuthenticationController
{
...
...
@@ -31,9 +33,6 @@ public class AuthenticationController
private
AuthTokenUtil
jwtTokenUtil
;
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
@
PostMapping
(
value
=
${
r
'"${ibiz.auth.path:v7/login}"'
})
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/security/AuthorizationTokenFilter.java.ftl
浏览文件 @
809c02c4
...
...
@@ -30,7 +30,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private
final
AuthTokenUtil
authTokenUtil
;
private
final
String
tokenHeader
;
public
AuthorizationTokenFilter
(
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>@
Qualifier
(
"IBZUAAUserService"
)</#
if
>
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@
Value
(${
r
'"${ibiz.jwt.header:Authorization}"'
})
String
tokenHeader
)
{
public
AuthorizationTokenFilter
(
AuthenticationUserService
userDetailsService
,
AuthTokenUtil
authTokenUtil
,
@
Value
(${
r
'"${ibiz.jwt.header:Authorization}"'
})
String
tokenHeader
)
{
this
.
userDetailsService
=
userDetailsService
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
tokenHeader
=
tokenHeader
;
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZUAAUserService.java.ftl
浏览文件 @
809c02c4
...
...
@@ -15,11 +15,13 @@ import org.springframework.context.annotation.Primary;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*/
@
Service
(
"IBZUAAUserService"
)
@
ConditionalOnExpression
(
"${r'${ibiz.enablePermissionValid:false}'}||'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('IBZUAAUserService')"
)
public
class
IBZUAAUserService
implements
AuthenticationUserService
{
@
Autowired
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/IBZUSERServiceImpl.java.ftl
浏览文件 @
809c02c4
...
...
@@ -16,11 +16,13 @@ import ${pub.getPKGCodeName()}.util.mapper.IBZUSERMapper;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
IBZUSER
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*/
@
Service
(
"IBZUSERService"
)
@
ConditionalOnExpression
(
"(!${r'${ibiz.enablePermissionValid:false}'})&&'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('IBZUSERService')"
)
public
class
IBZUSERServiceImpl
extends
ServiceImpl
<
IBZUSERMapper
,
IBZUSER
>
implements
IBZUSERService
,
AuthenticationUserService
{
@
Value
(${
r
'"${ibiz.auth.pwencrymode:0}"'
})
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/service/SimpleUserService.java.ftl
浏览文件 @
809c02c4
...
...
@@ -19,12 +19,14 @@ import org.springframework.util.StringUtils;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*/
@
Primary
@
Service
(
"SimpleUserService"
)
@
ConditionalOnExpression
(
"(!${r'${ibiz.enablePermissionValid:false}'})&&'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('SimpleUserService')"
)
public
class
SimpleUserService
implements
AuthenticationUserService
{
@
Override
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录