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
...
@@ -34,9 +34,6 @@ public class ${app.getPKGCodeName()}SecurityConfig extends WebSecurityConfigurer
private
AuthenticationEntryPoint
unauthorizedHandler
;
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
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:
...
@@ -46,6 +46,12 @@ zuul:
serviceId: ibzwf-api
serviceId: ibzwf-api
stripPrefix: true
stripPrefix: true
</#if>
</#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>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
sensitive-headers:
- Cookie,Set-Cookie,Authorization
- 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 {
...
@@ -33,9 +33,6 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
private
AuthenticationEntryPoint
unauthorizedHandler
;
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
private
AuthenticationUserService
userDetailsService
;
/**
/**
...
...
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
浏览文件 @
809c02c4
...
@@ -17,11 +17,11 @@ server:
...
@@ -17,11 +17,11 @@ server:
zuul:
zuul:
routes:
routes:
<#assign haswfentity=false>
<#assign haswfentity=false>
<#list item.getAllPS
App
DataEntities() as appDataEntity>
<#list item.getAllPSDataEntities() as appDataEntity>
<#assign serviceId="">
<#assign serviceId="">
<#assign serviceUrl=srfpluralize(appDataEntity.codeName?lower_case)>
<#assign serviceUrl=srfpluralize(appDataEntity.codeName?lower_case)>
<#assign appEntity=appDataEntity.name?lower_case>
<#assign appEntity=appDataEntity.name?lower_case>
<#assign psDataEntity=appDataEntity
.getPSDataEntity()
>
<#assign psDataEntity=appDataEntity>
<#assign systemName=sys.getCodeName()?lower_case>
<#assign systemName=sys.getCodeName()?lower_case>
<#if psDataEntity.hasPSDEWF()??>
<#if psDataEntity.hasPSDEWF()??>
<#assign haswfentity=true>
<#assign haswfentity=true>
...
@@ -30,11 +30,13 @@ zuul:
...
@@ -30,11 +30,13 @@ zuul:
<#comment>serviceApi模式</#comment>
<#comment>serviceApi模式</#comment>
<#assign serviceId=(psDataEntity.getPSSubSysServiceAPI().getServiceCodeName())!''>
<#assign serviceId=(psDataEntity.getPSSubSysServiceAPI().getServiceCodeName())!''>
<#assign serviceUrl=srfpluralize(appDataEntity.name?lower_case)>
<#assign serviceUrl=srfpluralize(appDataEntity.name?lower_case)>
<#if serviceId!="">
${appEntity}:
${appEntity}:
path: /${serviceUrl}/**
path: /${serviceUrl}/**
serviceId: ${serviceId}
serviceId: ${serviceId}
stripPrefix: false
stripPrefix: false
</#if>
</#if>
</#if>
</#list>
</#list>
<#if haswfentity==true>
<#if haswfentity==true>
wfcore:
wfcore:
...
@@ -42,6 +44,12 @@ zuul:
...
@@ -42,6 +44,12 @@ zuul:
serviceId: ibzwf-api
serviceId: ibzwf-api
stripPrefix: false
stripPrefix: false
</#if>
</#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>
<#comment>通过设置该参数,避免Zuul转发请求时丢失Authorization请求头信息</#comment>
sensitive-headers:
sensitive-headers:
- Cookie,Set-Cookie,Authorization
- 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
...
@@ -34,9 +34,6 @@ public class ${item.codeName}SecurityConfig extends WebSecurityConfigurerAdapter
private
AuthenticationEntryPoint
unauthorizedHandler
;
private
AuthenticationEntryPoint
unauthorizedHandler
;
@
Autowired
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
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;
...
@@ -18,9 +18,11 @@ import org.springframework.security.core.userdetails.UserDetails;
import
org
.
springframework
.
validation
.
annotation
.
Validated
;
import
org
.
springframework
.
validation
.
annotation
.
Validated
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Qualifier
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnProperty
;
@
RestController
@
RestController
@
RequestMapping
(
"/"
)
@
RequestMapping
(
"/"
)
@
ConditionalOnProperty
(
name
=
"ibiz.enablePermissionValid"
,
havingValue
=
"false"
)
public
class
AuthenticationController
public
class
AuthenticationController
{
{
...
@@ -31,9 +33,6 @@ public class AuthenticationController
...
@@ -31,9 +33,6 @@ public class AuthenticationController
private
AuthTokenUtil
jwtTokenUtil
;
private
AuthTokenUtil
jwtTokenUtil
;
@
Autowired
@
Autowired
<#
if
sys
.
getPSSystemSetting
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()??
&&
sys
.
getPSSystemSetting
().
getDataAccCtrlArch
()==
1
>
@
Qualifier
(
"IBZUAAUserService"
)
</#
if
>
private
AuthenticationUserService
userDetailsService
;
private
AuthenticationUserService
userDetailsService
;
@
PostMapping
(
value
=
${
r
'"${ibiz.auth.path:v7/login}"'
})
@
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 {
...
@@ -30,7 +30,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private
final
AuthTokenUtil
authTokenUtil
;
private
final
AuthTokenUtil
authTokenUtil
;
private
final
String
tokenHeader
;
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
.
userDetailsService
=
userDetailsService
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
authTokenUtil
=
authTokenUtil
;
this
.
tokenHeader
=
tokenHeader
;
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;
...
@@ -15,11 +15,13 @@ import org.springframework.context.annotation.Primary;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*
实体
[
IBZUSER
]
服务对象接口实现
*/
*/
@
Service
(
"IBZUAAUserService"
)
@
Service
(
"IBZUAAUserService"
)
@
ConditionalOnExpression
(
"${r'${ibiz.enablePermissionValid:false}'}||'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('IBZUAAUserService')"
)
public
class
IBZUAAUserService
implements
AuthenticationUserService
{
public
class
IBZUAAUserService
implements
AuthenticationUserService
{
@
Autowired
@
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;
...
@@ -16,11 +16,13 @@ import ${pub.getPKGCodeName()}.util.mapper.IBZUSERMapper;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
IBZUSER
;
import
${
pub
.
getPKGCodeName
()}.
util
.
domain
.
IBZUSER
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
DigestUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
util
.
StringUtils
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*
实体
[
IBZUSER
]
服务对象接口实现
*/
*/
@
Service
(
"IBZUSERService"
)
@
Service
(
"IBZUSERService"
)
@
ConditionalOnExpression
(
"(!${r'${ibiz.enablePermissionValid:false}'})&&'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('IBZUSERService')"
)
public
class
IBZUSERServiceImpl
extends
ServiceImpl
<
IBZUSERMapper
,
IBZUSER
>
implements
IBZUSERService
,
AuthenticationUserService
{
public
class
IBZUSERServiceImpl
extends
ServiceImpl
<
IBZUSERMapper
,
IBZUSER
>
implements
IBZUSERService
,
AuthenticationUserService
{
@
Value
(${
r
'"${ibiz.auth.pwencrymode:0}"'
})
@
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;
...
@@ -19,12 +19,14 @@ import org.springframework.util.StringUtils;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
com
.
alibaba
.
fastjson
.
JSONObject
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Value
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOnExpression
;
/**
/**
*
实体
[
IBZUSER
]
服务对象接口实现
*
实体
[
IBZUSER
]
服务对象接口实现
*/
*/
@
Primary
@
Primary
@
Service
(
"SimpleUserService"
)
@
Service
(
"SimpleUserService"
)
@
ConditionalOnExpression
(
"(!${r'${ibiz.enablePermissionValid:false}'})&&'${r'${ibiz.auth.service:SimpleUserService}'}'.equals('SimpleUserService')"
)
public
class
SimpleUserService
implements
AuthenticationUserService
{
public
class
SimpleUserService
implements
AuthenticationUserService
{
@
Override
@
Override
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录