Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
Sureness
提交
7f5e4752
Sureness
项目概览
lzh_me
/
Sureness
与 Fork 源项目一致
Fork自
sureness / Sureness
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Sureness
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7f5e4752
编写于
1月 09, 2021
作者:
sinat_25235033
提交者:
GitHub
1月 09, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
only match subject supportRoles once (#47)
上级
ae0de660
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
22 deletion
+16
-22
core/src/main/java/com/usthe/sureness/mgt/SecurityManager.java
...src/main/java/com/usthe/sureness/mgt/SecurityManager.java
+0
-9
core/src/main/java/com/usthe/sureness/mgt/SurenessSecurityManager.java
.../java/com/usthe/sureness/mgt/SurenessSecurityManager.java
+16
-13
未找到文件。
core/src/main/java/com/usthe/sureness/mgt/SecurityManager.java
浏览文件 @
7f5e4752
...
...
@@ -14,15 +14,6 @@ import java.util.List;
*/
public
interface
SecurityManager
{
/**
* auth entrance, put the subject in authentication and authorization process
* @param subject subject
* @return com.usthe.sureness.subject.Subject
* @throws BaseSurenessException sureness exception
*/
SubjectSum
checkIn
(
Subject
subject
)
throws
BaseSurenessException
;
/**
* auth entrance, put the request in authentication and authorization process
* @param var1 request
...
...
core/src/main/java/com/usthe/sureness/mgt/SurenessSecurityManager.java
浏览文件 @
7f5e4752
...
...
@@ -57,17 +57,6 @@ public class SurenessSecurityManager implements SecurityManager {
}
}
@Override
public
SubjectSum
checkIn
(
Subject
subject
)
throws
BaseSurenessException
{
// Determine whether the requested resource is a filtered resource
// if yes, pass directly
if
(
pathRoleMatcher
.
isExcludedResource
(
subject
))
{
return
null
;
}
pathRoleMatcher
.
matchRole
(
subject
);
return
processorManager
.
process
(
subject
);
}
@Override
public
SubjectSum
checkIn
(
Object
var1
)
throws
BaseSurenessException
{
checkComponentInit
();
...
...
@@ -75,13 +64,27 @@ public class SurenessSecurityManager implements SecurityManager {
// Create a subject list to try auth one by one
List
<
Subject
>
subjectList
=
createSubject
(
var1
);
RuntimeException
lastException
=
new
UnsupportedSubjectException
(
"this request can not "
+
"create subject by creators"
);
"create subject by creators
,please config no subject creator by default
"
);
// for the subject keys, try one by one
// if one success, pass and return directly
boolean
noTryExcluded
=
true
;
Subject
preSubject
=
null
;
for
(
Subject
thisSubject
:
subjectList
)
{
try
{
return
checkIn
(
thisSubject
);
// Determine whether the requested resource is a filtered resource
// if yes, pass directly
if
(
noTryExcluded
&&
pathRoleMatcher
.
isExcludedResource
(
thisSubject
))
{
return
null
;
}
noTryExcluded
=
false
;
if
(
preSubject
==
null
)
{
pathRoleMatcher
.
matchRole
(
thisSubject
);
preSubject
=
thisSubject
;
}
else
{
thisSubject
.
setSupportRoles
(
preSubject
.
getSupportRoles
());
}
return
processorManager
.
process
(
thisSubject
);
}
catch
(
BaseSurenessException
e
)
{
lastException
=
e
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录