记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
a676dca1
Commit
a676dca1
authored
Nov 04, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+验票TOKEN验证;
parent
20e6e9dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
8 deletions
+46
-8
GlobalAuthorityInterceptor.java
...quidnet/common/web/filter/GlobalAuthorityInterceptor.java
+17
-6
AdamAuthorityInterceptor.java
...et/service/adam/interceptor/AdamAuthorityInterceptor.java
+2
-2
KylinAuthorityInterceptor.java
.../service/kylin/interceptor/KylinAuthorityInterceptor.java
+27
-0
No files found.
liquidnet-bus-common/liquidnet-common-web/src/main/java/com/liquidnet/common/web/filter/GlobalAuthorityInterceptor.java
View file @
a676dca1
...
...
@@ -34,14 +34,14 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
/**
* 模式I(与模式II互斥)
* <p>
*
无需鉴权的URI.REGEX
* 无需鉴权的URI.REGEX
* </p>
*/
private
List
<
String
>
excludeUrlPattern
;
/**
* 模式II(与模式I互斥)
* <p>
*
需要鉴权的URI.REGEX
* 需要鉴权的URI.REGEX
* </p>
*/
private
List
<
String
>
includeUrlPattern
;
...
...
@@ -206,7 +206,7 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
String
ssoUidM5TokenKey
=
jwtValidator
.
getMsoRedisKey
()
.
concat
(
currentUid
).
concat
(
":"
).
concat
(
DigestUtils
.
md5DigestAsHex
(
token
.
getBytes
(
StandardCharsets
.
UTF_8
)));
String
val
=
this
.
getAccessToken
(
ssoUidM5TokenKey
);
String
val
=
this
.
getAccessToken
ForStation
(
ssoUidM5TokenKey
);
Integer
online
=
null
==
val
?
null
:
Integer
.
valueOf
(
val
);
return
null
!=
online
&&
online
==
1
||
this
.
responseHandlerRefuse
(
response
,
TOKEN_INVALID
);
...
...
@@ -224,9 +224,9 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
}
/**
* 查取
服务器
令牌票据
* 查取
账号
令牌票据
*
* @param ssokey
用户
令牌KEY
* @param ssokey
账号
令牌KEY
* @return String 令牌票据
*/
public
String
getAccessToken
(
String
ssokey
)
{
...
...
@@ -241,8 +241,19 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"
Authority.check e
xception"
,
e
);
log
.
error
(
"
GLOBAL:Authority Check E
xception"
,
e
);
}
return
val
;
}
/**
* 查取专业版账号令牌票据
*
* @param msokey 账号令牌KEY
* @return String 令牌票据
*/
public
String
getAccessTokenForStation
(
String
msokey
)
{
// 专业版只提供现场验票,且账号体系及验票功能均在`kylin`中,查取逻辑在`kylin`中重写实现
return
null
;
}
}
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/interceptor/AdamAuthorityInterceptor.java
View file @
a676dca1
...
...
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
@Component
public
class
AdamAuthorityInterceptor
extends
GlobalAuthorityInterceptor
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
Global
AuthorityInterceptor
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
Adam
AuthorityInterceptor
.
class
);
@Autowired
RedisUtil
redisUtil
;
...
...
@@ -20,7 +20,7 @@ public class AdamAuthorityInterceptor extends GlobalAuthorityInterceptor {
try
{
val
=
(
String
)
redisUtil
.
get
(
ssokey
);
}
catch
(
Exception
e
)
{
log
.
error
(
"A
uthority.check e
xception"
,
e
);
log
.
error
(
"A
DAM:Authority Check E
xception"
,
e
);
}
return
val
;
}
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/interceptor/KylinAuthorityInterceptor.java
0 → 100644
View file @
a676dca1
package
com
.
liquidnet
.
service
.
kylin
.
interceptor
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.web.filter.GlobalAuthorityInterceptor
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
public
class
KylinAuthorityInterceptor
extends
GlobalAuthorityInterceptor
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
KylinAuthorityInterceptor
.
class
);
@Autowired
RedisUtil
redisUtil
;
@Override
public
String
getAccessTokenForStation
(
String
msokey
)
{
String
val
=
null
;
try
{
val
=
(
String
)
redisUtil
.
get
(
msokey
);
}
catch
(
Exception
e
)
{
log
.
error
(
"KYLIN:Authority Check Exception"
,
e
);
}
return
val
;
}
}
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