Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
6bd2231a
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6bd2231a
编写于
11月 04, 2022
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
App credential to string type
上级
9bf04827
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
75 addition
and
73 deletion
+75
-73
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
+8
-8
maxkey-core/src/main/java/org/maxkey/entity/apps/AppsOAuth20Details.java
.../main/java/org/maxkey/entity/apps/AppsOAuth20Details.java
+3
-0
maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java
...java/org/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java
+4
-4
maxkey-protocols/maxkey-protocol-extendapi/src/main/java/org/maxkey/authz/exapi/endpoint/ExtendApiAuthorizeEndpoint.java
...xkey/authz/exapi/endpoint/ExtendApiAuthorizeEndpoint.java
+1
-1
maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Apps.ts
...ey-web-frontend/maxkey-web-mgt-app/src/app/entity/Apps.ts
+53
-54
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/AppListController.java
...ain/java/org/maxkey/web/contorller/AppListController.java
+4
-4
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java
...ava/org/maxkey/web/apps/contorller/BaseAppContorller.java
+2
-2
未找到文件。
maxkey-core/src/main/java/org/maxkey/entity/apps/Apps.java
浏览文件 @
6bd2231a
...
...
@@ -42,10 +42,10 @@ public class Apps extends JpaBaseEntity implements Serializable {
private
static
final
long
serialVersionUID
=
-
6264641546959620712L
;
public
static
final
class
CREDENTIALS
{
public
static
final
int
USER_DEFINED
=
3
;
public
static
final
int
SHARED
=
2
;
public
static
final
int
SYSTEM
=
1
;
public
static
final
int
NONE
=
0
;
public
static
final
String
USER_DEFINED
=
"user_defined"
;
public
static
final
String
SHARED
=
"shared"
;
public
static
final
String
SYSTEM
=
"system"
;
public
static
final
String
NONE
=
"none"
;
}
public
static
final
class
VISIBLE
{
...
...
@@ -100,7 +100,7 @@ public class Apps extends JpaBaseEntity implements Serializable {
* CREDENTIAL VALUES USER-DEFINED SYSTEM SHARED NONE
*/
@Column
private
int
credential
;
private
String
credential
;
@Column
private
String
sharedUsername
;
@Column
...
...
@@ -116,6 +116,7 @@ public class Apps extends JpaBaseEntity implements Serializable {
@Column
private
String
logoutUrl
;
@Column
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
int
logoutType
;
/*
* extendAttr
...
...
@@ -173,7 +174,6 @@ public class Apps extends JpaBaseEntity implements Serializable {
public
Apps
()
{
super
();
isSignature
=
ConstsBoolean
.
FALSE
;
credential
=
CREDENTIALS
.
NONE
;
}
...
...
@@ -354,14 +354,14 @@ public class Apps extends JpaBaseEntity implements Serializable {
/**
* @return the credential
*/
public
int
getCredential
()
{
public
String
getCredential
()
{
return
credential
;
}
/**
* @param credential the credential to set
*/
public
void
setCredential
(
int
credential
)
{
public
void
setCredential
(
String
credential
)
{
this
.
credential
=
credential
;
}
...
...
maxkey-core/src/main/java/org/maxkey/entity/apps/AppsOAuth20Details.java
浏览文件 @
6bd2231a
...
...
@@ -94,6 +94,7 @@ public class AppsOAuth20Details extends Apps {
this
.
setAppName
(
application
.
getAppName
());
this
.
setLoginUrl
(
application
.
getLoginUrl
());
this
.
setLogoutUrl
(
application
.
getLogoutUrl
());
this
.
setLogoutType
(
application
.
getLogoutType
());
this
.
setCategory
(
application
.
getCategory
());
this
.
setProtocol
(
application
.
getProtocol
());
this
.
setIcon
(
application
.
getIcon
());
...
...
@@ -103,6 +104,8 @@ public class AppsOAuth20Details extends Apps {
this
.
setVendor
(
application
.
getVendor
());
this
.
setVendorUrl
(
application
.
getVendorUrl
());
this
.
setVisible
(
application
.
getVisible
());
this
.
setIsAdapter
(
application
.
getIsAdapter
());
this
.
setAdapter
(
application
.
getAdapter
());
this
.
setAdapterId
(
application
.
getAdapterId
());
this
.
setAdapterName
(
application
.
getAdapterName
());
...
...
maxkey-protocols/maxkey-protocol-authorize/src/main/java/org/maxkey/authz/endpoint/AuthorizeBaseEndpoint.java
浏览文件 @
6bd2231a
...
...
@@ -76,24 +76,24 @@ public class AuthorizeBaseEndpoint {
account
.
setUsername
(
userInfo
.
getUsername
());
account
.
setAppName
(
app
.
getAppName
());
if
(
loadApp
.
getCredential
()
==
Apps
.
CREDENTIALS
.
USER_DEFINED
){
if
(
loadApp
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
USER_DEFINED
)
){
account
=
accountsService
.
load
(
new
Accounts
(
userInfo
.
getId
(),
loadApp
.
getId
()));
if
(
account
!=
null
){
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
decoder
(
account
.
getRelatedPassword
()));
}
}
else
if
(
loadApp
.
getCredential
()
==
Apps
.
CREDENTIALS
.
SHARED
){
}
else
if
(
loadApp
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
SHARED
)
){
account
.
setRelatedUsername
(
loadApp
.
getSharedUsername
());
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
decoder
(
loadApp
.
getSharedPassword
()));
}
else
if
(
loadApp
.
getCredential
()
==
Apps
.
CREDENTIALS
.
SYSTEM
){
}
else
if
(
loadApp
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
SYSTEM
)
){
account
.
setUsername
(
AbstractAuthorizeAdapter
.
getValueByUserAttr
(
userInfo
,
loadApp
.
getSystemUserAttr
())
);
//decoder database stored encode password
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
decoder
(
userInfo
.
getDecipherable
()));
}
else
if
(
loadApp
.
getCredential
()
==
Apps
.
CREDENTIALS
.
NONE
){
}
else
if
(
loadApp
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
NONE
)
){
account
.
setUsername
(
userInfo
.
getUsername
());
account
.
setRelatedPassword
(
userInfo
.
getUsername
());
...
...
maxkey-protocols/maxkey-protocol-extendapi/src/main/java/org/maxkey/authz/exapi/endpoint/ExtendApiAuthorizeEndpoint.java
浏览文件 @
6bd2231a
...
...
@@ -67,7 +67,7 @@ public class ExtendApiAuthorizeEndpoint extends AuthorizeBaseEndpoint{
_logger
.
debug
(
"Adapter {}"
,
apps
.
getAdapter
());
AbstractAuthorizeAdapter
adapter
=
(
AbstractAuthorizeAdapter
)
Instance
.
newInstance
(
apps
.
getAdapter
());
Accounts
account
=
getAccounts
(
apps
,
currentUser
);
if
(
apps
.
getCredential
()
==
Apps
.
CREDENTIALS
.
USER_DEFINED
&&
account
==
null
)
{
if
(
apps
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
USER_DEFINED
)
&&
account
==
null
)
{
return
initCredentialView
(
id
,
"/authorize/api/"
+
id
);
}
...
...
maxkey-web-frontend/maxkey-web-mgt-app/src/app/entity/Apps.ts
浏览文件 @
6bd2231a
...
...
@@ -40,6 +40,7 @@ export class Apps extends BaseEntity {
logoutType
!
:
String
;
isExtendAttr
!
:
String
;
extendAttr
!
:
String
;
resourceMgt
!
:
String
;
userPropertys
!
:
String
;
isSignature
!
:
String
;
isAdapter
!
:
String
;
...
...
@@ -54,10 +55,12 @@ export class Apps extends BaseEntity {
constructor
()
{
super
();
this
.
category
=
'
none
'
;
this
.
frequently
=
'
no
'
;
this
.
resourceMgt
=
'
false
'
;
this
.
visible
=
'
0
'
;
this
.
isAdapter
=
'
0
'
;
this
.
logoutType
=
'
0
'
;
this
.
frequently
=
'
no
'
;
this
.
isExtendAttr
=
'
0
'
;
}
override
init
(
data
:
any
):
void
{
...
...
@@ -67,10 +70,6 @@ export class Apps extends BaseEntity {
}
else
{
this
.
switch_status
=
false
;
}
this
.
isAdapter
=
`
${
data
.
isAdapter
}
`
;
this
.
isExtendAttr
=
`
${
data
.
isExtendAttr
}
`
;
this
.
logoutType
=
`
${
data
.
logoutType
}
`
;
this
.
visible
=
`
${
data
.
visible
}
`
;
}
override
trans
():
void
{
...
...
maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/AppListController.java
浏览文件 @
6bd2231a
...
...
@@ -86,12 +86,12 @@ public class AppListController {
@RequestMapping
(
value
=
{
"/account/get"
})
@ResponseBody
public
ResponseEntity
<?>
getAccount
(
@RequestParam
(
"credential"
)
int
credential
,
@RequestParam
(
"credential"
)
String
credential
,
@RequestParam
(
"appId"
)
String
appId
,
@CurrentUser
UserInfo
currentUser
)
{
Accounts
account
=
null
;
if
(
credential
==
Apps
.
CREDENTIALS
.
USER_DEFINED
)
{
if
(
credential
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
USER_DEFINED
)
)
{
account
=
accountsService
.
load
(
new
Accounts
(
currentUser
.
getId
(),
appId
));
account
.
setRelatedPassword
(
PasswordReciprocal
.
getInstance
().
decoder
(
...
...
@@ -110,11 +110,11 @@ public class AppListController {
@RequestMapping
(
value
=
{
"/account/update"
})
@ResponseBody
public
ResponseEntity
<?>
updateAccount
(
@RequestParam
(
"credential"
)
int
credential
,
@RequestParam
(
"credential"
)
String
credential
,
@ModelAttribute
Accounts
account
,
@CurrentUser
UserInfo
currentUser
)
{
Accounts
appUsers
=
new
Accounts
();
if
(
credential
==
Apps
.
CREDENTIALS
.
USER_DEFINED
)
{
if
(
credential
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
USER_DEFINED
)
)
{
appUsers
=
accountsService
.
load
(
new
Accounts
(
currentUser
.
getId
(),
account
.
getAppId
()));
if
(
appUsers
==
null
)
{
appUsers
=
new
Accounts
();
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/apps/contorller/BaseAppContorller.java
浏览文件 @
6bd2231a
...
...
@@ -72,7 +72,7 @@ public class BaseAppContorller {
}
protected
void
encodeSharedPassword
(
Apps
application
){
if
(
application
.
getCredential
()!=
Apps
.
CREDENTIALS
.
SHARED
){
if
(
!
application
.
getCredential
().
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
SHARED
)
){
if
(
application
.
getProtocol
().
equals
(
ConstsProtocols
.
FORMBASED
)){
if
(
StringUtils
.
isNotBlank
(
application
.
getSharedPassword
())){
application
.
setSharedPassword
(
...
...
@@ -83,7 +83,7 @@ public class BaseAppContorller {
}
protected
void
decoderSharedPassword
(
Apps
application
){
if
(
application
.
getCredential
()
!=
Apps
.
CREDENTIALS
.
SHARED
){
if
(
application
.
getCredential
()
.
equalsIgnoreCase
(
Apps
.
CREDENTIALS
.
SHARED
)
){
if
(
application
.
getProtocol
().
equals
(
ConstsProtocols
.
FORMBASED
)){
if
(
StringUtils
.
isNotBlank
(
application
.
getSharedPassword
())){
application
.
setSharedPassword
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录