Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
61878e81
Commit
61878e81
authored
Oct 08, 2020
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.调整安全框架兼容性(更加宽松)
2.增加安全配置
parent
7755ad60
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
178 additions
and
8 deletions
+178
-8
AbstractCommonController.java
...resentation/noui/controller/AbstractCommonController.java
+2
-2
DataSecurityUtil.java
...java/org/sss/presentation/noui/util/DataSecurityUtil.java
+13
-2
security.properties
src/main/resources/security.properties
+163
-4
No files found.
src/main/java/org/sss/presentation/noui/controller/AbstractCommonController.java
View file @
61878e81
...
...
@@ -90,7 +90,7 @@ public abstract class AbstractCommonController {
if
(
DataSecurityUtil
.
isSafeMode
()
&&
noUiRequest
.
isSecurity
())
{
if
(
DataSecurityUtil
.
needDecrypt
(
noUiRequest
.
getReqUrl
()))
{
String
[]
clientpars
=
DataSecurityUtil
.
getSafeConfigByReqUrl
(
context
,
noUiRequest
.
getReqUrl
()
+
DataSecurityUtil
.
DECRYPT_FIX
);
String
[]
clientpars
=
DataSecurityUtil
.
getSafeConfigByReqUrl
(
context
,
noUiRequest
,
noUiRequest
.
getReqUrl
()
+
DataSecurityUtil
.
DECRYPT_FIX
);
if
(!
ArrayUtils
.
isEmpty
(
clientpars
)){
if
(
paramsMap
.
containsKey
(
DataSecurityUtil
.
BACKGROUND_ID
))
{
//合法性校验操作(场景:用户做修改、删除时调用)
...
...
@@ -157,7 +157,7 @@ public abstract class AbstractCommonController {
if
(
DataSecurityUtil
.
isSafeMode
()
&&
noUiRequest
.
isSecurity
())
{
if
(
DataSecurityUtil
.
needEncrypt
(
noUiRequest
.
getReqUrl
()))
{
//加密操作(场景:用户查询指定信息时调用,后续会做修改,删除等操作)
String
[]
pars
=
DataSecurityUtil
.
getSafeConfigByReqUrl
(
context
,
noUiRequest
.
getReqUrl
()
+
DataSecurityUtil
.
ENCRYPT_FIX
);
String
[]
pars
=
DataSecurityUtil
.
getSafeConfigByReqUrl
(
context
,
noUiRequest
,
noUiRequest
.
getReqUrl
()
+
DataSecurityUtil
.
ENCRYPT_FIX
);
serverEnc
=
DataSecurityUtil
.
encrypt
(
pars
,
noUiRequest
.
getUserId
());
afterReturnData
.
put
(
DataSecurityUtil
.
BACKGROUND_ID
,
serverEnc
);
}
...
...
src/main/java/org/sss/presentation/noui/util/DataSecurityUtil.java
View file @
61878e81
...
...
@@ -8,6 +8,7 @@ import org.sss.common.model.IBaseObject;
import
org.sss.common.model.IDatafield
;
import
org.sss.common.model.IModule
;
import
org.sss.common.model.IModuleList
;
import
org.sss.presentation.noui.api.request.NoUiRequest
;
import
org.sss.presentation.noui.common.Constants
;
import
org.sss.presentation.noui.context.NoUiContext
;
...
...
@@ -18,6 +19,7 @@ import java.util.*;
* 使用动态盐机制,每个盐只做一次双向校验后就失效
*/
public
class
DataSecurityUtil
{
public
static
final
String
DEFAULT_CHECK
=
"selinr"
;
public
static
final
String
ENCRYPT_FIX
=
"_encode"
;
public
static
final
String
DECRYPT_FIX
=
"_decode"
;
public
static
final
String
ENCRYPT_ERROR
=
"encrypt exception"
;
...
...
@@ -86,10 +88,11 @@ public class DataSecurityUtil {
* 获取指定交易的安全配置
*
* @param context 交易上下文
* @param noUiRequest 请求对象
* @param configKey 安全配置的key
* @return 指定交易的安全配置信息
*/
public
static
String
[]
getSafeConfigByReqUrl
(
NoUiContext
context
,
String
configKey
)
{
public
static
String
[]
getSafeConfigByReqUrl
(
NoUiContext
context
,
NoUiRequest
noUiRequest
,
String
configKey
)
{
String
[]
safeConfigByTrnNames
=
securityConfig
.
get
(
configKey
);
for
(
String
safeConfigByTrnName
:
safeConfigByTrnNames
)
{
if
(!
StringUtil
.
isEmpty
(
safeConfigByTrnName
))
{
...
...
@@ -110,7 +113,15 @@ public class DataSecurityUtil {
}
else
{
if
(
baseObject
instanceof
IDatafield
<?>)
{
IDatafield
<
Object
>
dataField
=
(
IDatafield
<
Object
>)
baseObject
;
String
val
=
dataField
.
getValue
().
toString
();
Object
valobj
=
dataField
.
getValue
();
String
val
=
null
;
if
(
valobj
==
null
){
if
(
noUiRequest
.
getParamsMap
().
containsKey
(
DEFAULT_CHECK
)){
val
=
noUiRequest
.
getParamsMap
().
get
(
DEFAULT_CHECK
).
toString
();
}
}
else
{
val
=
valobj
.
toString
();
}
pars
[
i
]
=
val
;
}
else
if
(
baseObject
instanceof
IModuleList
<?>)
{
IModuleList
<?>
moduleList
=
(
IModuleList
<?>)
baseObject
;
...
...
src/main/resources/security.properties
View file @
61878e81
#安全开关(ON:开;OFF:关)
switch
=
ON
#共享前置机构管理
/bchreg/
regsel_encode
=
\\
recp
\\
bchtmplst[]
\\
inr
#共享前置机构注销
/bhgdel/
init_decode
=
\\
bhggrp
\\
rec
\\
inr
/bhgdel/
init_encode
=
\\
bhggrp
\\
rec
\\
inr
/bhgdel/
sav_decode
=
\\
bhggrp
\\
rec
\\
inr
#共享前置机构复核
/bhgrel/
init_decode
=
\\
bhggrp
\\
rec
\\
inr
/bhgrel/
init_encode
=
\\
bhggrp
\\
rec
\\
inr
/bhgrel/
relrow_decode
=
\\
bhggrp
\\
rec
\\
inr
#共享前置用户管理
/usrreg/
regsel_encode
=
\\
recp
\\
usrlst[]
\\
inr
#共享前置用户注销
/urgdel/
init_decode
=
\\
urggrp
\\
rec
\\
inr
/urgdel/
init_encode
=
\\
urggrp
\\
rec
\\
inr
/urgdel/
sav_decode
=
\\
urggrp
\\
rec
\\
inr
#共享前置用户重置
/urgrst/
init_decode
=
\\
urggrp
\\
rec
\\
inr
/urgrst/
init_encode
=
\\
urggrp
\\
rec
\\
inr
/urgrst/
sav_decode
=
\\
urggrp
\\
rec
\\
inr
#共享前置用户修改
/urgame/
init_decode
=
\\
urggrp
\\
rec
\\
inr
/urgame/
init_encode
=
\\
urggrp
\\
rec
\\
inr
/urgame/
sav_decode
=
\\
urggrp
\\
rec
\\
inr
#共享前置用户复核
/urgrel/
init_decode
=
\\
urggrp
\\
rec
\\
inr
/urgrel/
init_encode
=
\\
urggrp
\\
rec
\\
inr
/urgrel/
relrow_decode
=
\\
urggrp
\\
rec
\\
inr
#共享前置公告——查询
/elsinf/
sel_encode
=
\\
infgrp
\\
inflst[]
\\
inr
#共享前置公告——复核
/elsinf/
rel_decode
=
\\
infgrp
\\
rec
\\
inr
#共享前置公告——删除
/elsinf/
del_decode
=
\\
infgrp
\\
rec
\\
inr
#机构管理——查询
/dblbch/
sel_encode
=
\\
bchp
\\
bchlst[]
\\
inr
#机构管理——修改
/dbebch/
init_decode
=
\\
bchgrp
\\
rec
\\
inr
/dbebch/
init_encode
=
\\
bchgrp
\\
rec
\\
inr
/dbebch/
sav_decode
=
\\
bchgrp
\\
rec
\\
inr
#机构管理——删除
/dbdbch/
init_decode
=
\\
bchgrp
\\
rec
\\
inr
/dbdbch/
init_encode
=
\\
bchgrp
\\
rec
\\
inr
/dbdbch/
sav_decode
=
\\
bchgrp
\\
rec
\\
inr
#机构管理——复核
/bchrel/
init_encode
=
\\
bchgrp
\\
rec
\\
inr
/bchrel/
relrow_decode
=
\\
bchgrp
\\
rec
\\
inr
#角色管理——查询
/dblrol/
sel_encode
=
\\
rolp
\\
rollst[]
\\
inr
#角色管理——修改
/dberol/
init_decode
=
\\
rolgrp
\\
rec
\\
inr
/dberol/
init_encode
=
\\
rolgrp
\\
rec
\\
inr
/dberol/
sav_decode
=
\\
rolgrp
\\
rec
\\
inr
#角色管理——删除
/dbdrol/
init_encode
=
\\
rolgrp
\\
rec
\\
inr
/dbdrol/
sav_decode
=
\\
rolgrp
\\
rec
\\
inr
#用户管理——查询
/dblusr/
regsel_encode
=
\\
usrp
\\
usrlst[]
\\
inr
#用户管理——注销
/dbdusr/
init_decode
=
\\
usrgrp
\\
rec
\\
inr
/dbdusr/
init_encode
=
\\
usrgrp
\\
rec
\\
inr
/dbdusr/
sav_decode
=
\\
usrgrp
\\
rec
\\
inr
#用户管理——删除
/dbiusr/
init_decode
=
\\
usrgrp
\\
rec
\\
inr
/dbiusr/
init_encode
=
\\
usrgrp
\\
rec
\\
inr
/dbiusr/
sav_decode
=
\\
usrgrp
\\
rec
\\
inr
#用户管理——修改
/dbeusr/
init_decode
=
\\
usrgrp
\\
rec
\\
inr
/dbeusr/
init_encode
=
\\
usrgrp
\\
rec
\\
inr
/dbeusr/
sav_decode
=
\\
usrgrp
\\
rec
\\
inr
#用户管理——复核
/usrrel/
init_decode
=
\\
usrgrp
\\
rec
\\
inr
/usrrel/
init_encode
=
\\
usrgrp
\\
rec
\\
inr
/usrrel/
relrow_decode
=
\\
usrgrp
\\
rec
\\
inr
#客户管理——查询
/dblpty/
sel_encode
=
\\
ptyp
\\
ptylst[]
\\
inr
#客户管理——修改
/dbepty/
init_decode
=
\\
ptygrp
\\
rec
\\
inr
/dbepty/
init_encode
=
\\
ptygrp
\\
rec
\\
inr
,
\\
ptygrp
\\
rec
\\
extkey
/dbepty/
sav_decode
=
\\
ptygrp
\\
rec
\\
inr
,
\\
ptygrp
\\
rec
\\
extkey
/dbepty/
init_encode
=
\\
ptygrp
\\
rec
\\
inr
/dbepty/
sav_decode
=
\\
ptygrp
\\
rec
\\
inr
#客户管理——删除
/dbdpty/
init_decode
=
\\
ptygrp
\\
rec
\\
inr
/dbdpty/
init_encode
=
\\
ptygrp
\\
rec
\\
inr
/dbdpty/
sav_decode
=
\\
ptygrp
\\
rec
\\
inr
#
#参与机构公告——查询
/bchinf/
sel_encode
=
\\
infgrp
\\
inflst[]
\\
inr
#参与机构公告——复核
/bchinf/
rel_decode
=
\\
infgrp
\\
rec
\\
inr
#参与机构公告——删除
/bchinf/
del_decode
=
\\
infgrp
\\
rec
\\
inr
#国内买方信用证
/ditsel/
sellst_encode
=
\\
ditmod
\\
didlst[]
\\
inr,
\\
bdtmod
\\
bddlst[]
\\
inr
#拒付
/bdtdcr/
init_decode
=
\\
bddgrp
\\
rec
\\
inr
/bdtdcr/
init_encode
=
\\
bddgrp
\\
rec
\\
inr
/bdtdcr/
sav_decode
=
\\
bddgrp
\\
rec
\\
inr
#退单
/bdtrtn/
init_decode
=
\\
bddgrp
\\
rec
\\
inr
/bdtrtn/
init_encode
=
\\
bddgrp
\\
rec
\\
inr
/bdtrtn/
sav_decode
=
\\
bddgrp
\\
rec
\\
inr
#退单
/bdtacc/
init_decode
=
\\
bddgrp
\\
rec
\\
inr
/bdtacc/
init_encode
=
\\
bddgrp
\\
rec
\\
inr
/bdtacc/
sav_decode
=
\\
bddgrp
\\
rec
\\
inr
#付款
/bdtset/
init_decode
=
\\
bddgrp
\\
rec
\\
inr
/bdtset/
init_encode
=
\\
bddgrp
\\
rec
\\
inr
/bdtset/
sav_decode
=
\\
bddgrp
\\
rec
\\
inr
#注销闭卷
/ditcan/
init_decode
=
\\
didgrp
\\
rec
\\
inr
/ditcan/
init_encode
=
\\
didgrp
\\
rec
\\
inr
/ditcan/
sav_decode
=
\\
didgrp
\\
rec
\\
inr
#修改请求
/ditram/
init_decode
=
\\
didgrp
\\
rec
\\
inr
/ditram/
init_encode
=
\\
didgrp
\\
rec
\\
inr
/ditram/
sav_decode
=
\\
didgrp
\\
rec
\\
inr
#国内卖方信用证
/detsel/
sellst_encode
=
\\
detmod
\\
dedlst[]
\\
inr,
\\
bmtmod
\\
bmdlst[]
\\
inr
#寄单
/bmtrgf/
init_decode
=
\\
dedgrp
\\
rec
\\
inr
/bmtrgf/
init_encode
=
\\
dedgrp
\\
rec
\\
inr
/bmtrgf/
sav_decode
=
\\
dedgrp
\\
rec
\\
inr
#寄单索款修改
/bmtrfc/
init_decode
=
\\
bmdgrp
\\
rec
\\
inr
/bmtrfc/
init_encode
=
\\
bmdgrp
\\
rec
\\
inr
/bmtrfc/
sav_decode
=
\\
bmdgrp
\\
rec
\\
inr
#议付
/bmtneg/
init_decode
=
\\
bmdgrp
\\
rec
\\
inr
/bmtneg/
init_encode
=
\\
bmdgrp
\\
rec
\\
inr
/bmtneg/
sav_decode
=
\\
bmdgrp
\\
rec
\\
inr
#拒绝通知
/detrej/
init_decode
=
\\
dedgrp
\\
rec
\\
inr
/detrej/
init_encode
=
\\
dedgrp
\\
rec
\\
inr
/detrej/
sav_decode
=
\\
dedgrp
\\
rec
\\
inr
#复核夹
/trnrel/
searow_encode
=
\\
recpan
\\
trnlst[]
\\
inr
/trnrel/
init_decode
=
\\
trn
\\
inr
/trnrel/
init_encode
=
\\
trn
\\
inr
/trnrel/
relrow_decode
=
\\
trn
\\
inr
/trnrel/
reprow_decode
=
\\
trn
\\
inr
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment