Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
2cd04e78
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
12 个月 前同步成功
通知
76
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2cd04e78
编写于
11月 13, 2021
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SCIM optimize
上级
681906e0
变更
51
显示空白变更内容
内联
并排
Showing
51 changed file
with
961 addition
and
221 deletion
+961
-221
maxkey-core/src/main/java/org/maxkey/entity/Organizations.java
...y-core/src/main/java/org/maxkey/entity/Organizations.java
+51
-2
maxkey-identitys/maxkey-identity-rest/src/main/java/org/maxkey/identity/rest/RestOrganizationController.java
.../org/maxkey/identity/rest/RestOrganizationController.java
+1
-1
maxkey-identitys/maxkey-identity-rest/src/main/java/org/maxkey/identity/rest/RestUserInfoController.java
...java/org/maxkey/identity/rest/RestUserInfoController.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimGroupController.java
.../maxkey/identity/scim/controller/ScimGroupController.java
+134
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimOrganizationController.java
.../identity/scim/controller/ScimOrganizationController.java
+117
-34
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimServiceProviderConfigController.java
.../scim/controller/ScimServiceProviderConfigController.java
+3
-2
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimUserController.java
...g/maxkey/identity/scim/controller/ScimUserController.java
+168
-33
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimEnterprise.java
...va/org/maxkey/identity/scim/resources/ScimEnterprise.java
+14
-6
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimEnterpriseUser.java
...rg/maxkey/identity/scim/resources/ScimEnterpriseUser.java
+6
-6
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimFormattedName.java
...org/maxkey/identity/scim/resources/ScimFormattedName.java
+3
-3
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimGroup.java
...in/java/org/maxkey/identity/scim/resources/ScimGroup.java
+5
-5
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimGroupRef.java
...java/org/maxkey/identity/scim/resources/ScimGroupRef.java
+10
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimManager.java
.../java/org/maxkey/identity/scim/resources/ScimManager.java
+3
-3
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimMemberRef.java
...ava/org/maxkey/identity/scim/resources/ScimMemberRef.java
+8
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimMeta.java
...ain/java/org/maxkey/identity/scim/resources/ScimMeta.java
+9
-3
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimMultiValuedAttribute.java
...key/identity/scim/resources/ScimMultiValuedAttribute.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimOrganization.java
.../org/maxkey/identity/scim/resources/ScimOrganization.java
+53
-11
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimOrganizationAddress.java
...xkey/identity/scim/resources/ScimOrganizationAddress.java
+2
-2
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimOrganizationEmail.java
...maxkey/identity/scim/resources/ScimOrganizationEmail.java
+3
-3
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimOrganizationPhoneNumber.java
.../identity/scim/resources/ScimOrganizationPhoneNumber.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimParameters.java
...va/org/maxkey/identity/scim/resources/ScimParameters.java
+85
-0
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimResource.java
...java/org/maxkey/identity/scim/resources/ScimResource.java
+6
-6
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimSearchResult.java
.../org/maxkey/identity/scim/resources/ScimSearchResult.java
+11
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUser.java
...ain/java/org/maxkey/identity/scim/resources/ScimUser.java
+70
-37
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserAddress.java
...a/org/maxkey/identity/scim/resources/ScimUserAddress.java
+2
-2
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserEmail.java
...ava/org/maxkey/identity/scim/resources/ScimUserEmail.java
+3
-3
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserEntitlement.java
...g/maxkey/identity/scim/resources/ScimUserEntitlement.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserExtension.java
...org/maxkey/identity/scim/resources/ScimUserExtension.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserIm.java
...n/java/org/maxkey/identity/scim/resources/ScimUserIm.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserOrganization.java
.../maxkey/identity/scim/resources/ScimUserOrganization.java
+39
-0
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserPhoneNumber.java
...g/maxkey/identity/scim/resources/ScimUserPhoneNumber.java
+12
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserPhoto.java
...ava/org/maxkey/identity/scim/resources/ScimUserPhoto.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserRole.java
...java/org/maxkey/identity/scim/resources/ScimUserRole.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserX509Certificate.java
...xkey/identity/scim/resources/ScimUserX509Certificate.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimEnterpriseUserJsonString2ObjectTest.java
...im/resources/ScimEnterpriseUserJsonString2ObjectTest.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimEnterpriseUserJsonTest.java
...y/identity/scim/resources/ScimEnterpriseUserJsonTest.java
+12
-12
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimGroupJsonString2ObjectTest.java
...entity/scim/resources/ScimGroupJsonString2ObjectTest.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimGroupJsonTest.java
...org/maxkey/identity/scim/resources/ScimGroupJsonTest.java
+6
-6
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimUserJsonString2ObjectTest.java
...dentity/scim/resources/ScimUserJsonString2ObjectTest.java
+1
-1
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimUserJsonTest.java
.../org/maxkey/identity/scim/resources/ScimUserJsonTest.java
+11
-11
maxkey-lib/mybatis-jpa-extra-2.6.jar
maxkey-lib/mybatis-jpa-extra-2.6.jar
+0
-0
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/GroupMemberMapper.java
...java/org/maxkey/persistence/mapper/GroupMemberMapper.java
+3
-0
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/GroupsMapper.java
...main/java/org/maxkey/persistence/mapper/GroupsMapper.java
+2
-0
maxkey-persistence/src/main/java/org/maxkey/persistence/service/GroupMemberService.java
...va/org/maxkey/persistence/service/GroupMemberService.java
+8
-0
maxkey-persistence/src/main/java/org/maxkey/persistence/service/GroupsService.java
...in/java/org/maxkey/persistence/service/GroupsService.java
+4
-0
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/GroupMemberMapper.xml
...maxkey/persistence/mapper/xml/mysql/GroupMemberMapper.xml
+46
-0
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/GroupsMapper.xml
.../org/maxkey/persistence/mapper/xml/mysql/GroupsMapper.xml
+16
-0
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtJobs.java
...axkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtJobs.java
+2
-2
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java
...-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java
+9
-3
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/jobs/AccountsStrategyJob.java
...gt/src/main/java/org/maxkey/jobs/AccountsStrategyJob.java
+6
-4
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/jobs/DynamicGroupsJob.java
...b-mgt/src/main/java/org/maxkey/jobs/DynamicGroupsJob.java
+6
-4
未找到文件。
maxkey-core/src/main/java/org/maxkey/entity/Organizations.java
浏览文件 @
2cd04e78
...
...
@@ -43,6 +43,7 @@ public class Organizations extends JpaBaseEntity implements Serializable {
private
String
fullName
;
@Column
private
String
parentId
;
private
String
parentCode
;
@Column
private
String
parentName
;
@Column
...
...
@@ -85,6 +86,14 @@ public class Organizations extends JpaBaseEntity implements Serializable {
private
String
description
;
@Column
private
int
status
;
@Column
String
createdBy
;
@Column
String
createdDate
;
@Column
String
modifiedBy
;
@Column
String
modifiedDate
;
private
int
isPrimary
=
0
;
...
...
@@ -136,6 +145,14 @@ public class Organizations extends JpaBaseEntity implements Serializable {
this
.
parentId
=
parentId
;
}
public
String
getParentCode
()
{
return
parentCode
;
}
public
void
setParentCode
(
String
parentCode
)
{
this
.
parentCode
=
parentCode
;
}
public
String
getParentName
()
{
return
parentName
;
}
...
...
@@ -322,6 +339,38 @@ public class Organizations extends JpaBaseEntity implements Serializable {
this
.
reorgNamePath
=
reorgNamePath
;
}
public
String
getCreatedBy
()
{
return
createdBy
;
}
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
String
getCreatedDate
()
{
return
createdDate
;
}
public
void
setCreatedDate
(
String
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
public
String
getModifiedBy
()
{
return
modifiedBy
;
}
public
void
setModifiedBy
(
String
modifiedBy
)
{
this
.
modifiedBy
=
modifiedBy
;
}
public
String
getModifiedDate
()
{
return
modifiedDate
;
}
public
void
setModifiedDate
(
String
modifiedDate
)
{
this
.
modifiedDate
=
modifiedDate
;
}
@Override
public
String
toString
()
{
StringBuilder
builder
=
new
StringBuilder
();
...
...
maxkey-identitys/maxkey-identity-rest/src/main/java/org/maxkey/identity/rest/RestOrganizationController.java
浏览文件 @
2cd04e78
...
...
@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import
org.springframework.web.util.UriComponentsBuilder
;
@Controller
@RequestMapping
(
value
={
"/
im/api
/Organization"
})
@RequestMapping
(
value
={
"/
api/idm
/Organization"
})
public
class
RestOrganizationController
{
@Autowired
...
...
maxkey-identitys/maxkey-identity-rest/src/main/java/org/maxkey/identity/rest/RestUserInfoController.java
浏览文件 @
2cd04e78
...
...
@@ -35,7 +35,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import
org.springframework.web.util.UriComponentsBuilder
;
@Controller
@RequestMapping
(
value
={
"/
im/api
/Users"
})
@RequestMapping
(
value
={
"/
api/idm
/Users"
})
public
class
RestUserInfoController
{
@Autowired
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimGroupController.java
浏览文件 @
2cd04e78
...
...
@@ -17,9 +17,142 @@
package
org.maxkey.identity.scim.controller
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.identity.scim.resources.ScimGroup
;
import
org.maxkey.identity.scim.resources.ScimMemberRef
;
import
org.maxkey.identity.scim.resources.ScimMeta
;
import
org.maxkey.identity.scim.resources.ScimParameters
;
import
org.maxkey.identity.scim.resources.ScimSearchResult
;
import
org.maxkey.persistence.service.GroupMemberService
;
import
org.maxkey.persistence.service.GroupsService
;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.converter.json.MappingJacksonValue
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.util.UriComponentsBuilder
;
@RequestMapping
(
value
=
"/im/scim/v2/Groups"
)
@RestController
@RequestMapping
(
value
=
"/api/idm/SCIM/v2/Groups"
)
public
class
ScimGroupController
{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
ScimGroupController
.
class
);
@Autowired
GroupsService
groupsService
;
@Autowired
GroupMemberService
groupMemberService
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
get
(
@PathVariable
String
id
,
@RequestParam
(
required
=
false
)
String
attributes
)
{
Groups
groups
=
groupsService
.
get
(
id
);
ScimGroup
scimGroup
=
group2ScimGroup
(
groups
);
List
<
UserInfo
>
userList
=
groupMemberService
.
queryMemberByGroupId
(
id
);
if
(
userList
!=
null
&&
userList
.
size
()
>
0
)
{
Set
<
ScimMemberRef
>
members
=
new
HashSet
<
ScimMemberRef
>();
for
(
UserInfo
user
:
userList
)
{
members
.
add
(
new
ScimMemberRef
(
user
.
getDisplayName
(),
user
.
getId
()));
}
scimGroup
.
setMembers
(
members
);
}
return
new
MappingJacksonValue
(
scimGroup
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
MappingJacksonValue
create
(
@RequestBody
ScimGroup
scimGroup
,
@RequestParam
(
required
=
false
)
String
attributes
,
UriComponentsBuilder
builder
)
throws
IOException
{
Groups
group
=
scimGroup2Group
(
scimGroup
);
groupsService
.
insert
(
group
);
return
get
(
group
.
getId
(),
attributes
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
public
MappingJacksonValue
replace
(
@PathVariable
String
id
,
@RequestBody
ScimGroup
scimGroup
,
@RequestParam
(
required
=
false
)
String
attributes
)
throws
IOException
{
Groups
group
=
scimGroup2Group
(
scimGroup
);
groupsService
.
update
(
group
);
return
get
(
group
.
getId
(),
attributes
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
delete
(
@PathVariable
final
String
id
)
{
groupsService
.
remove
(
id
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
searchWithGet
(
@ModelAttribute
ScimParameters
requestParameters
)
{
return
searchWithPost
(
requestParameters
);
}
@RequestMapping
(
value
=
"/.search"
,
method
=
RequestMethod
.
POST
)
public
MappingJacksonValue
searchWithPost
(
@ModelAttribute
ScimParameters
requestParameters
)
{
requestParameters
.
parse
();
_logger
.
debug
(
"requestParameters {} "
,
requestParameters
);
Groups
queryModel
=
new
Groups
();
queryModel
.
setPageSize
(
requestParameters
.
getCount
());
queryModel
.
calculate
(
requestParameters
.
getStartIndex
());
JpaPageResults
<
Groups
>
orgResults
=
groupsService
.
queryPageResults
(
queryModel
);
List
<
ScimGroup
>
resultList
=
new
ArrayList
<
ScimGroup
>();
for
(
Groups
group
:
orgResults
.
getRows
())
{
resultList
.
add
(
group2ScimGroup
(
group
));
}
ScimSearchResult
<
ScimGroup
>
scimSearchResult
=
new
ScimSearchResult
<
ScimGroup
>(
resultList
,
orgResults
.
getRecords
(),
requestParameters
.
getCount
(),
requestParameters
.
getStartIndex
());
return
new
MappingJacksonValue
(
scimSearchResult
);
}
public
ScimGroup
group2ScimGroup
(
Groups
group
)
{
ScimGroup
scimGroup
=
new
ScimGroup
();
scimGroup
.
setId
(
group
.
getId
());
scimGroup
.
setExternalId
(
group
.
getId
());
scimGroup
.
setDisplayName
(
group
.
getName
());
ScimMeta
meta
=
new
ScimMeta
(
"Group"
);
if
(
StringUtils
.
isNotBlank
(
group
.
getCreatedDate
())){
meta
.
setCreated
(
DateUtils
.
parse
(
group
.
getCreatedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
if
(
StringUtils
.
isNotBlank
(
group
.
getModifiedDate
())){
meta
.
setLastModified
(
DateUtils
.
parse
(
group
.
getModifiedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
scimGroup
.
setMeta
(
meta
);
return
scimGroup
;
}
public
Groups
scimGroup2Group
(
ScimGroup
scimGroup
)
{
Groups
group
=
new
Groups
();
group
.
setId
(
scimGroup
.
getId
());
group
.
setName
(
scimGroup
.
getDisplayName
());
return
group
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimOrganizationController.java
浏览文件 @
2cd04e78
...
...
@@ -18,14 +18,24 @@
package
org.maxkey.identity.scim.controller
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.maxkey.identity.scim.resources.Organization
;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.entity.Organizations
;
import
org.maxkey.identity.scim.resources.ScimMeta
;
import
org.maxkey.identity.scim.resources.ScimOrganization
;
import
org.maxkey.identity.scim.resources.ScimParameters
;
import
org.maxkey.identity.scim.resources.ScimSearchResult
;
import
org.maxkey.identity.scim.resources.User
;
import
org.maxkey.persistence.service.OrganizationsService
;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.converter.json.MappingJacksonValue
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -45,57 +55,130 @@ import org.springframework.web.util.UriComponentsBuilder;
* http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3
*/
@RestController
@RequestMapping
(
value
=
"/
im/scim
/v2/Organization"
)
@RequestMapping
(
value
=
"/
api/idm/SCIM
/v2/Organization"
)
public
class
ScimOrganizationController
{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
ScimOrganizationController
.
class
);
@Autowired
OrganizationsService
organizationsService
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
get
Organization
(
@PathVariable
String
id
,
public
MappingJacksonValue
get
(
@PathVariable
String
id
,
@RequestParam
(
required
=
false
)
String
attributes
)
{
//Organization user = null;
return
null
;
Organizations
org
=
organizationsService
.
get
(
id
);
ScimOrganization
scimOrg
=
org2ScimOrg
(
org
);
return
new
MappingJacksonValue
(
scimOrg
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
MappingJacksonValue
>
create
(
@RequestBody
Organization
user
,
public
MappingJacksonValue
create
(
@RequestBody
ScimOrganization
scimOrg
,
@RequestParam
(
required
=
false
)
String
attributes
,
UriComponentsBuilder
builder
)
throws
IOException
{
//Organization createdUser = null;
return
null
;
Organizations
createOrg
=
scimOrg2Org
(
scimOrg
);
organizationsService
.
insert
(
createOrg
);
return
get
(
createOrg
.
getId
(),
attributes
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
public
ResponseEntity
<
MappingJacksonValue
>
replace
(
@PathVariable
String
id
,
@RequestBody
Organization
user
,
@RequestParam
(
required
=
false
)
String
attributes
)
throws
IOException
{
//Organization createdUser = null
;
return
null
;
public
MappingJacksonValue
replace
(
@PathVariable
String
id
,
@RequestBody
ScimOrganization
scimOrg
,
@RequestParam
(
required
=
false
)
String
attributes
)
throws
IOException
{
Organizations
updateOrg
=
scimOrg2Org
(
scimOrg
);
organizationsService
.
update
(
updateOrg
)
;
return
get
(
id
,
attributes
)
;
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
delete
(
@PathVariable
final
String
id
)
{
//tokenService.revokeAllTokensOfUser(id);
organizationsService
.
remove
(
id
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
searchWithGet
(
@
RequestParam
Map
<
String
,
String
>
requestParameters
)
{
public
MappingJacksonValue
searchWithGet
(
@
ModelAttribute
ScimParameters
requestParameters
)
{
return
searchWithPost
(
requestParameters
);
}
@RequestMapping
(
value
=
"/.search"
,
method
=
RequestMethod
.
POST
)
public
MappingJacksonValue
searchWithPost
(
@RequestParam
Map
<
String
,
String
>
requestParameters
)
{
//ScimSearchResult<User> scimSearchResult = null;
/*
requestParameters.get("filter"),
requestParameters.get("sortBy"),
requestParameters.getOrDefault("sortOrder", "ascending"), // scim default
Integer.parseInt(requestParameters.getOrDefault("count", "" + ScimServiceProviderConfigController.MAX_RESULTS)),
Integer.parseInt(requestParameters.getOrDefault("startIndex", "1")); // scim default
*/
//String attributes = (requestParameters.containsKey("attributes") ? requestParameters.get("attributes") : "");
return
null
;
public
MappingJacksonValue
searchWithPost
(
@ModelAttribute
ScimParameters
requestParameters
)
{
requestParameters
.
parse
();
_logger
.
debug
(
"requestParameters {} "
,
requestParameters
);
Organizations
queryModel
=
new
Organizations
();
queryModel
.
setPageSize
(
requestParameters
.
getCount
());
queryModel
.
calculate
(
requestParameters
.
getStartIndex
());
JpaPageResults
<
Organizations
>
orgResults
=
organizationsService
.
queryPageResults
(
queryModel
);
List
<
ScimOrganization
>
resultList
=
new
ArrayList
<
ScimOrganization
>();
for
(
Organizations
org
:
orgResults
.
getRows
())
{
resultList
.
add
(
org2ScimOrg
(
org
));
}
ScimSearchResult
<
ScimOrganization
>
scimSearchResult
=
new
ScimSearchResult
<
ScimOrganization
>(
resultList
,
orgResults
.
getRecords
(),
requestParameters
.
getCount
(),
requestParameters
.
getStartIndex
());
return
new
MappingJacksonValue
(
scimSearchResult
);
}
public
ScimOrganization
org2ScimOrg
(
Organizations
org
)
{
ScimOrganization
scimOrg
=
new
ScimOrganization
();
scimOrg
.
setId
(
org
.
getId
());
scimOrg
.
setCode
(
org
.
getCode
());
scimOrg
.
setName
(
org
.
getName
());
scimOrg
.
setDisplayName
(
org
.
getName
());
scimOrg
.
setFullName
(
org
.
getFullName
());
scimOrg
.
setType
(
org
.
getType
());
scimOrg
.
setLevel
(
org
.
getLevel
());
scimOrg
.
setDivision
(
org
.
getDivision
());
scimOrg
.
setSortOrder
(
org
.
getSortOrder
());
scimOrg
.
setCodePath
(
org
.
getCodePath
());
scimOrg
.
setNamePath
(
org
.
getNamePath
());
scimOrg
.
setDescription
(
org
.
getDescription
());
scimOrg
.
setParentId
(
org
.
getParentId
());
scimOrg
.
setParent
(
org
.
getParentId
());
//scimOrg.setParentCode(org.getParentId());
scimOrg
.
setParentName
(
org
.
getParentName
());
scimOrg
.
setParentName
(
org
.
getParentName
());
if
(
StringUtils
.
isNotBlank
(
org
.
getSortOrder
()))
{
scimOrg
.
setOrder
(
Long
.
parseLong
(
org
.
getSortOrder
()));
}
else
{
scimOrg
.
setOrder
(
1
);
}
scimOrg
.
setExternalId
(
org
.
getId
());
ScimMeta
meta
=
new
ScimMeta
(
"Organization"
);
if
(
StringUtils
.
isNotBlank
(
org
.
getCreatedDate
())){
meta
.
setCreated
(
DateUtils
.
parse
(
org
.
getCreatedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
if
(
StringUtils
.
isNotBlank
(
org
.
getModifiedDate
())){
meta
.
setLastModified
(
DateUtils
.
parse
(
org
.
getModifiedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
scimOrg
.
setMeta
(
meta
);
return
scimOrg
;
}
public
Organizations
scimOrg2Org
(
ScimOrganization
scimOrg
)
{
Organizations
org
=
new
Organizations
();
org
.
setId
(
scimOrg
.
getId
());
org
.
setCode
(
scimOrg
.
getCode
());
org
.
setFullName
(
scimOrg
.
getFullName
());
org
.
setName
(
StringUtils
.
isNotBlank
(
scimOrg
.
getName
())
?
scimOrg
.
getName
():
scimOrg
.
getDisplayName
());
org
.
setParentId
(
StringUtils
.
isNotBlank
(
scimOrg
.
getParentId
())?
scimOrg
.
getParentId
():
scimOrg
.
getParent
());
org
.
setParentCode
(
scimOrg
.
getParentCode
());
org
.
setParentName
(
scimOrg
.
getParentName
());
org
.
setSortOrder
(
StringUtils
.
isNotBlank
(
scimOrg
.
getSortOrder
()
)?
scimOrg
.
getSortOrder
():
scimOrg
.
getOrder
()+
""
);
org
.
setLevel
(
scimOrg
.
getLevel
());
org
.
setType
(
scimOrg
.
getType
());
org
.
setDivision
(
scimOrg
.
getDivision
());
org
.
setDescription
(
scimOrg
.
getDescription
());
return
org
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimServiceProviderConfigController.java
浏览文件 @
2cd04e78
...
...
@@ -26,10 +26,11 @@ import java.util.HashSet;
import
java.util.Set
;
@RestController
@RequestMapping
(
value
=
"/
im/scim
/v2/ServiceProviderConfig"
)
@RequestMapping
(
value
=
"/
api/idm/SCIM
/v2/ServiceProviderConfig"
)
public
class
ScimServiceProviderConfigController
{
public
static
final
int
MAX_RESULTS
=
100
;
public
static
final
int
MAX_RESULTS
=
500
;
public
static
final
int
MAX_RESULTS_LIMIT
=
5000
;
@RequestMapping
@ResponseBody
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/controller/ScimUserController.java
浏览文件 @
2cd04e78
...
...
@@ -18,13 +18,34 @@
package
org.maxkey.identity.scim.controller
;
import
java.io.IOException
;
import
java.util.Map
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.mybatis.jpa.persistence.JpaPageResults
;
import
org.maxkey.constants.ConstantsStatus
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.identity.scim.resources.ScimEnterprise
;
import
org.maxkey.identity.scim.resources.ScimGroupRef
;
import
org.maxkey.identity.scim.resources.ScimManager
;
import
org.maxkey.identity.scim.resources.ScimMeta
;
import
org.maxkey.identity.scim.resources.ScimParameters
;
import
org.maxkey.identity.scim.resources.ScimSearchResult
;
import
org.maxkey.identity.scim.resources.User
;
import
org.maxkey.identity.scim.resources.ScimOrganizationEmail.UserEmailType
;
import
org.maxkey.identity.scim.resources.ScimOrganizationPhoneNumber.UserPhoneNumberType
;
import
org.maxkey.identity.scim.resources.ScimUser
;
import
org.maxkey.identity.scim.resources.ScimUserEmail
;
import
org.maxkey.identity.scim.resources.ScimFormattedName
;
import
org.maxkey.identity.scim.resources.ScimUserPhoneNumber
;
import
org.maxkey.persistence.service.GroupsService
;
import
org.maxkey.persistence.service.UserInfoService
;
import
org.maxkey.util.DateUtils
;
import
org.maxkey.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.converter.json.MappingJacksonValue
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -44,56 +65,170 @@ import org.springframework.web.util.UriComponentsBuilder;
* http://tools.ietf.org/html/draft-ietf-scim-api-00#section-3
*/
@RestController
@RequestMapping
(
value
=
"/
im/scim
/v2/Users"
)
@RequestMapping
(
value
=
"/
api/idm/SCIM
/v2/Users"
)
public
class
ScimUserController
{
final
static
Logger
_logger
=
LoggerFactory
.
getLogger
(
ScimUserController
.
class
);
@Autowired
private
UserInfoService
userInfoService
;
@Autowired
GroupsService
groupsService
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
get
User
(
@PathVariable
String
id
,
public
MappingJacksonValue
get
(
@PathVariable
String
id
,
@RequestParam
(
required
=
false
)
String
attributes
)
{
//User user = null;
return
null
;
UserInfo
userInfo
=
userInfoService
.
get
(
id
);
ScimUser
scimUser
=
userInfo2ScimUser
(
userInfo
);
return
new
MappingJacksonValue
(
scimUser
);
}
@RequestMapping
(
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
MappingJacksonValue
>
create
(
@RequestBody
User
user
,
public
MappingJacksonValue
create
(
@RequestBody
Scim
User
user
,
@RequestParam
(
required
=
false
)
String
attributes
,
UriComponentsBuilder
builder
)
throws
IOException
{
//User createdUser = null;
return
null
;
UserInfo
userInfo
=
scimUser2UserInfo
(
user
);
userInfoService
.
insert
(
userInfo
);
return
get
(
userInfo
.
getId
(),
attributes
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
public
ResponseEntity
<
MappingJacksonValue
>
replace
(
@PathVariable
String
id
,
@RequestBody
User
user
,
public
MappingJacksonValue
replace
(
@PathVariable
String
id
,
@RequestBody
Scim
User
user
,
@RequestParam
(
required
=
false
)
String
attributes
)
throws
IOException
{
//User createdUser = null;
return
null
;
UserInfo
userInfo
=
scimUser2UserInfo
(
user
);
userInfoService
.
update
(
userInfo
);
return
get
(
id
,
attributes
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@ResponseStatus
(
HttpStatus
.
OK
)
public
void
delete
(
@PathVariable
final
String
id
)
{
//tokenService.revokeAllTokensOfUser(id);
userInfoService
.
remove
(
id
);
}
@RequestMapping
(
method
=
RequestMethod
.
GET
)
public
MappingJacksonValue
searchWithGet
(
@
RequestParam
Map
<
String
,
String
>
requestParameters
)
{
public
MappingJacksonValue
searchWithGet
(
@
ModelAttribute
ScimParameters
requestParameters
)
{
return
searchWithPost
(
requestParameters
);
}
@RequestMapping
(
value
=
"/.search"
,
method
=
RequestMethod
.
POST
)
public
MappingJacksonValue
searchWithPost
(
@RequestParam
Map
<
String
,
String
>
requestParameters
)
{
//ScimSearchResult<User> scimSearchResult = null;
/*
requestParameters.get("filter"),
requestParameters.get("sortBy"),
requestParameters.getOrDefault("sortOrder", "ascending"), // scim default
Integer.parseInt(requestParameters.getOrDefault("count", "" + ScimServiceProviderConfigController.MAX_RESULTS)),
Integer.parseInt(requestParameters.getOrDefault("startIndex", "1")); // scim default
*/
//String attributes = (requestParameters.containsKey("attributes") ? requestParameters.get("attributes") : "");
return
null
;
public
MappingJacksonValue
searchWithPost
(
@ModelAttribute
ScimParameters
requestParameters
)
{
requestParameters
.
parse
();
_logger
.
debug
(
"requestParameters {} "
,
requestParameters
);
UserInfo
queryModel
=
new
UserInfo
();
queryModel
.
setPageSize
(
requestParameters
.
getCount
());
queryModel
.
calculate
(
requestParameters
.
getStartIndex
());
JpaPageResults
<
UserInfo
>
orgResults
=
userInfoService
.
queryPageResults
(
queryModel
);
List
<
ScimUser
>
resultList
=
new
ArrayList
<
ScimUser
>();
for
(
UserInfo
user
:
orgResults
.
getRows
())
{
resultList
.
add
(
userInfo2ScimUser
(
user
));
}
ScimSearchResult
<
ScimUser
>
scimSearchResult
=
new
ScimSearchResult
<
ScimUser
>(
resultList
,
orgResults
.
getRecords
(),
requestParameters
.
getCount
(),
requestParameters
.
getStartIndex
());
return
new
MappingJacksonValue
(
scimSearchResult
);
}
public
ScimUser
userInfo2ScimUser
(
UserInfo
userInfo
)
{
ScimUser
scimUser
=
new
ScimUser
();
scimUser
.
setId
(
userInfo
.
getId
());
scimUser
.
setExternalId
(
userInfo
.
getId
());
scimUser
.
setDisplayName
(
userInfo
.
getDisplayName
());
scimUser
.
setUserName
(
userInfo
.
getUsername
());
scimUser
.
setName
(
new
ScimFormattedName
(
userInfo
.
getFormattedName
(),
userInfo
.
getFamilyName
(),
userInfo
.
getGivenName
(),
userInfo
.
getMiddleName
(),
userInfo
.
getHonorificPrefix
(),
userInfo
.
getHonorificSuffix
()
)
);
scimUser
.
setNickName
(
userInfo
.
getNickName
());
scimUser
.
setTitle
(
userInfo
.
getJobTitle
());
scimUser
.
setUserType
(
userInfo
.
getUserType
());
ScimEnterprise
enterprise
=
new
ScimEnterprise
();
enterprise
.
setDepartmentId
(
userInfo
.
getDepartmentId
());
enterprise
.
setDepartment
(
userInfo
.
getDepartment
());
enterprise
.
setCostCenter
(
userInfo
.
getCostCenter
());
enterprise
.
setManager
(
new
ScimManager
(
userInfo
.
getManagerId
(),
userInfo
.
getManager
()));
enterprise
.
setDivision
(
userInfo
.
getDivision
());
enterprise
.
setEmployeeNumber
(
userInfo
.
getEmployeeNumber
());
scimUser
.
setEnterprise
(
enterprise
);
List
<
String
>
organizationsList
=
new
ArrayList
<
String
>();
organizationsList
.
add
(
userInfo
.
getDepartmentId
());
scimUser
.
setOrganization
(
organizationsList
);
List
<
String
>
groupsList
=
new
ArrayList
<
String
>();
List
<
ScimGroupRef
>
groups
=
new
ArrayList
<
ScimGroupRef
>();
for
(
Groups
group
:
groupsService
.
queryGroupByUserId
(
userInfo
.
getId
())){
groupsList
.
add
(
group
.
getId
());
groups
.
add
(
new
ScimGroupRef
(
group
.
getId
(),
group
.
getName
()));
}
scimUser
.
setGroup
(
groupsList
);
scimUser
.
setGroups
(
groups
);
scimUser
.
setTimezone
(
userInfo
.
getTimeZone
());
scimUser
.
setLocale
(
userInfo
.
getLocale
());
scimUser
.
setPreferredLanguage
(
userInfo
.
getPreferredLanguage
());
scimUser
.
setActive
(
userInfo
.
getStatus
()
==
ConstantsStatus
.
ACTIVE
);
List
<
ScimUserEmail
>
emails
=
new
ArrayList
<
ScimUserEmail
>();
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getEmail
())){
emails
.
add
(
new
ScimUserEmail
(
userInfo
.
getEmail
(),
UserEmailType
.
OTHER
,
true
));
}
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getWorkEmail
())){
emails
.
add
(
new
ScimUserEmail
(
userInfo
.
getEmail
(),
UserEmailType
.
WORK
,
false
));
}
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getHomeEmail
())){
emails
.
add
(
new
ScimUserEmail
(
userInfo
.
getEmail
(),
UserEmailType
.
HOME
,
false
));
}
if
(
emails
.
size
()
>
0
)
{
scimUser
.
setEmails
(
emails
);
}
List
<
ScimUserPhoneNumber
>
phoneNumbers
=
new
ArrayList
<
ScimUserPhoneNumber
>();
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getMobile
())){
phoneNumbers
.
add
(
new
ScimUserPhoneNumber
(
userInfo
.
getMobile
(),
UserPhoneNumberType
.
MOBILE
,
true
));
}
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getWorkPhoneNumber
())){
phoneNumbers
.
add
(
new
ScimUserPhoneNumber
(
userInfo
.
getWorkPhoneNumber
(),
UserPhoneNumberType
.
WORK
,
false
));
}
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getHomePhoneNumber
())){
phoneNumbers
.
add
(
new
ScimUserPhoneNumber
(
userInfo
.
getHomePhoneNumber
(),
UserPhoneNumberType
.
HOME
,
false
));
}
if
(
phoneNumbers
.
size
()
>
0
)
{
scimUser
.
setPhoneNumbers
(
phoneNumbers
);
}
ScimMeta
meta
=
new
ScimMeta
(
"User"
);
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getCreatedDate
())){
meta
.
setCreated
(
DateUtils
.
parse
(
userInfo
.
getCreatedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
if
(
StringUtils
.
isNotBlank
(
userInfo
.
getModifiedDate
())){
meta
.
setLastModified
(
DateUtils
.
parse
(
userInfo
.
getModifiedDate
(),
DateUtils
.
FORMAT_DATE_YYYY_MM_DD_HH_MM_SS
));
}
scimUser
.
setMeta
(
meta
);
return
scimUser
;
}
public
UserInfo
scimUser2UserInfo
(
ScimUser
scimUser
)
{
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setId
(
scimUser
.
getId
());
userInfo
.
setUsername
(
scimUser
.
getUserName
());
return
userInfo
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Enterprise.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Enterprise.java
浏览文件 @
2cd04e78
...
...
@@ -19,15 +19,16 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
Enterprise
implements
Serializable
{
public
class
Scim
Enterprise
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
204619629148409697L
;
private
String
employeeNumber
;
private
String
costCenter
;
private
String
organization
;
private
String
division
;
private
String
departmentId
;
private
String
department
;
private
Manager
manager
;
private
Scim
Manager
manager
;
public
String
getEmployeeNumber
()
{
return
employeeNumber
;
...
...
@@ -53,19 +54,26 @@ public class Enterprise implements Serializable {
public
void
setDivision
(
String
division
)
{
this
.
division
=
division
;
}
public
String
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
String
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
String
getDepartment
()
{
return
department
;
}
public
void
setDepartment
(
String
department
)
{
this
.
department
=
department
;
}
public
Manager
getManager
()
{
public
Scim
Manager
getManager
()
{
return
manager
;
}
public
void
setManager
(
Manager
manager
)
{
public
void
setManager
(
Scim
Manager
manager
)
{
this
.
manager
=
manager
;
}
public
Enterprise
()
{
public
Scim
Enterprise
()
{
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/EnterpriseUser.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
EnterpriseUser.java
浏览文件 @
2cd04e78
...
...
@@ -21,25 +21,25 @@ import java.util.HashSet;
import
com.fasterxml.jackson.annotation.JsonProperty
;
public
class
EnterpriseUser
extends
User
{
public
class
ScimEnterpriseUser
extends
Scim
User
{
private
static
final
long
serialVersionUID
=
3212312511630459427L
;
public
static
final
String
SCHEMA
=
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
;
@JsonProperty
(
SCHEMA
)
Enterprise
enterprise
;
Scim
Enterprise
enterprise
;
public
EnterpriseUser
()
{
public
Scim
EnterpriseUser
()
{
schemas
=
new
HashSet
<
String
>();
schemas
.
add
(
User
.
SCHEMA
);
schemas
.
add
(
Scim
User
.
SCHEMA
);
schemas
.
add
(
SCHEMA
);
}
public
Enterprise
getEnterprise
()
{
public
Scim
Enterprise
getEnterprise
()
{
return
enterprise
;
}
public
void
setEnterprise
(
Enterprise
enterprise
)
{
public
void
setEnterprise
(
Scim
Enterprise
enterprise
)
{
this
.
enterprise
=
enterprise
;
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
User
Name.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
ScimFormatted
Name.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
User
Name
implements
Serializable
{
public
class
ScimFormatted
Name
implements
Serializable
{
/**
*
...
...
@@ -67,7 +67,7 @@ public class UserName implements Serializable {
public
void
setHonorificSuffix
(
String
honorificSuffix
)
{
this
.
honorificSuffix
=
honorificSuffix
;
}
public
User
Name
(
String
formatted
,
String
familyName
,
String
givenName
,
String
middleName
,
String
honorificPrefix
,
public
ScimFormatted
Name
(
String
formatted
,
String
familyName
,
String
givenName
,
String
middleName
,
String
honorificPrefix
,
String
honorificSuffix
)
{
super
();
this
.
formatted
=
formatted
;
...
...
@@ -77,7 +77,7 @@ public class UserName implements Serializable {
this
.
honorificPrefix
=
honorificPrefix
;
this
.
honorificSuffix
=
honorificSuffix
;
}
public
User
Name
()
{
public
ScimFormatted
Name
()
{
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Group.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Group.java
浏览文件 @
2cd04e78
...
...
@@ -20,13 +20,13 @@ package org.maxkey.identity.scim.resources;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
Group
extends
Resource
{
public
class
ScimGroup
extends
Scim
Resource
{
private
static
final
long
serialVersionUID
=
404613567384513866L
;
public
static
final
String
SCHEMA
=
"urn:ietf:params:scim:schemas:core:2.0:Group"
;
private
String
displayName
;
private
Set
<
MemberRef
>
members
;
private
Set
<
Scim
MemberRef
>
members
;
public
String
getDisplayName
()
{
return
displayName
;
...
...
@@ -34,14 +34,14 @@ public class Group extends Resource{
public
void
setDisplayName
(
String
displayName
)
{
this
.
displayName
=
displayName
;
}
public
Set
<
MemberRef
>
getMembers
()
{
public
Set
<
Scim
MemberRef
>
getMembers
()
{
return
members
;
}
public
void
setMembers
(
Set
<
MemberRef
>
members
)
{
public
void
setMembers
(
Set
<
Scim
MemberRef
>
members
)
{
this
.
members
=
members
;
}
public
Group
()
{
public
Scim
Group
()
{
schemas
=
new
HashSet
<
String
>();
schemas
.
add
(
SCHEMA
);
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/GroupRef.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
GroupRef.java
浏览文件 @
2cd04e78
...
...
@@ -17,11 +17,20 @@
package
org.maxkey.identity.scim.resources
;
public
class
GroupRef
extends
MultiValuedAttribute
{
public
class
ScimGroupRef
extends
Scim
MultiValuedAttribute
{
/**
*
*/
private
static
final
long
serialVersionUID
=
7069453283024141999L
;
public
ScimGroupRef
()
{
super
();
}
public
ScimGroupRef
(
String
value
,
String
display
)
{
super
();
this
.
value
=
value
;
this
.
display
=
display
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Manager.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Manager.java
浏览文件 @
2cd04e78
...
...
@@ -17,7 +17,7 @@
package
org.maxkey.identity.scim.resources
;
public
class
Manager
{
public
class
Scim
Manager
{
private
String
managerId
;
private
String
displayName
;
...
...
@@ -33,9 +33,9 @@ public class Manager {
public
void
setDisplayName
(
String
displayName
)
{
this
.
displayName
=
displayName
;
}
public
Manager
()
{
public
Scim
Manager
()
{
}
public
Manager
(
String
managerId
,
String
displayName
)
{
public
Scim
Manager
(
String
managerId
,
String
displayName
)
{
super
();
this
.
managerId
=
managerId
;
this
.
displayName
=
displayName
;
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/MemberRef.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
MemberRef.java
浏览文件 @
2cd04e78
...
...
@@ -17,11 +17,18 @@
package
org.maxkey.identity.scim.resources
;
public
class
MemberRef
extends
MultiValuedAttribute
{
public
class
ScimMemberRef
extends
Scim
MultiValuedAttribute
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6018893424394625889L
;
public
ScimMemberRef
()
{
}
public
ScimMemberRef
(
String
display
,
String
value
)
{
this
.
display
=
display
;
this
.
value
=
value
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Meta.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Meta.java
浏览文件 @
2cd04e78
...
...
@@ -26,7 +26,7 @@ import org.maxkey.json.*;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
public
class
Meta
implements
Serializable
{
public
class
Scim
Meta
implements
Serializable
{
/**
*
...
...
@@ -87,10 +87,16 @@ public class Meta implements Serializable {
public
void
setResourceType
(
String
resourceType
)
{
this
.
resourceType
=
resourceType
;
}
public
Meta
()
{
public
Scim
Meta
()
{
}
public
Meta
(
String
resourceType
,
Date
created
,
Date
lastModified
,
String
location
,
String
version
,
public
ScimMeta
(
String
resourceType
)
{
this
.
resourceType
=
resourceType
;
this
.
version
=
"1.0"
;
}
public
ScimMeta
(
String
resourceType
,
Date
created
,
Date
lastModified
,
String
location
,
String
version
,
Set
<
String
>
attributes
)
{
super
();
this
.
resourceType
=
resourceType
;
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/MultiValuedAttribute.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
MultiValuedAttribute.java
浏览文件 @
2cd04e78
...
...
@@ -21,7 +21,7 @@ import java.io.Serializable;
import
com.fasterxml.jackson.annotation.JsonProperty
;
public
class
MultiValuedAttribute
implements
Serializable
{
public
class
Scim
MultiValuedAttribute
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6878912593878245947L
;
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Organization.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Organization.java
浏览文件 @
2cd04e78
...
...
@@ -20,7 +20,7 @@ package org.maxkey.identity.scim.resources;
import
java.util.HashSet
;
import
java.util.List
;
public
class
Organization
extends
Resource
{
public
class
ScimOrganization
extends
Scim
Resource
{
/**
*
...
...
@@ -48,16 +48,24 @@ public class Organization extends Resource{
private
String
division
;
private
List
<
OrganizationAddress
>
addresses
;
private
List
<
Scim
OrganizationAddress
>
addresses
;
private
List
<
OrganizationEmail
>
emails
;
private
List
<
ScimOrganizationEmail
>
emails
;
private
List
<
ScimOrganizationPhoneNumber
>
phoneNumbers
;
private
List
<
OrganizationPhoneNumber
>
phoneNumbers
;
private
String
sortOrder
;
private
String
description
;
// T/IDAC 002—2021
private
String
displayName
;
//name
private
long
order
;
//sortOrder
private
String
parent
;
//parentId
private
String
parentCode
;
//parent code
public
String
getCode
()
{
return
code
;
}
...
...
@@ -154,33 +162,67 @@ public class Organization extends Resource{
this
.
description
=
description
;
}
public
List
<
OrganizationAddress
>
getAddresses
()
{
public
List
<
Scim
OrganizationAddress
>
getAddresses
()
{
return
addresses
;
}
public
void
setAddresses
(
List
<
OrganizationAddress
>
addresses
)
{
public
void
setAddresses
(
List
<
Scim
OrganizationAddress
>
addresses
)
{
this
.
addresses
=
addresses
;
}
public
List
<
OrganizationEmail
>
getEmails
()
{
public
List
<
Scim
OrganizationEmail
>
getEmails
()
{
return
emails
;
}
public
void
setEmails
(
List
<
OrganizationEmail
>
emails
)
{
public
void
setEmails
(
List
<
Scim
OrganizationEmail
>
emails
)
{
this
.
emails
=
emails
;
}
public
List
<
OrganizationPhoneNumber
>
getPhoneNumbers
()
{
public
List
<
Scim
OrganizationPhoneNumber
>
getPhoneNumbers
()
{
return
phoneNumbers
;
}
public
void
setPhoneNumbers
(
List
<
OrganizationPhoneNumber
>
phoneNumbers
)
{
public
void
setPhoneNumbers
(
List
<
Scim
OrganizationPhoneNumber
>
phoneNumbers
)
{
this
.
phoneNumbers
=
phoneNumbers
;
}
public
Organization
()
{
public
String
getDisplayName
()
{
return
displayName
;
}
public
void
setDisplayName
(
String
displayName
)
{
this
.
displayName
=
displayName
;
}
public
long
getOrder
()
{
return
order
;
}
public
void
setOrder
(
long
order
)
{
this
.
order
=
order
;
}
public
String
getParent
()
{
return
parent
;
}
public
void
setParent
(
String
parent
)
{
this
.
parent
=
parent
;
}
public
String
getParentCode
()
{
return
parentCode
;
}
public
void
setParentCode
(
String
parentCode
)
{
this
.
parentCode
=
parentCode
;
}
public
ScimOrganization
()
{
schemas
=
new
HashSet
<
String
>();
schemas
.
add
(
SCHEMA
);
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
User
Address.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
ScimOrganization
Address.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserAddress
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimOrganizationAddress
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
@@ -81,7 +81,7 @@ public class UserAddress extends MultiValuedAttribute implements Serializable {
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
User
Address
()
{
public
ScimOrganization
Address
()
{
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
User
Email.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
ScimOrganization
Email.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserEmail
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimOrganizationEmail
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
@@ -57,10 +57,10 @@ public class UserEmail extends MultiValuedAttribute implements Serializable {
this
.
primary
=
primary
;
}
public
User
Email
()
{
public
ScimOrganization
Email
()
{
}
public
User
Email
(
String
value
,
String
type
,
boolean
primary
)
{
public
ScimOrganization
Email
(
String
value
,
String
type
,
boolean
primary
)
{
super
();
this
.
value
=
value
;
this
.
type
=
type
;
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/OrganizationPhoneNumber.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
OrganizationPhoneNumber.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
OrganizationPhoneNumber
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimOrganizationPhoneNumber
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimParameters.java
0 → 100644
浏览文件 @
2cd04e78
package
org.maxkey.identity.scim.resources
;
import
org.maxkey.identity.scim.controller.ScimServiceProviderConfigController
;
public
class
ScimParameters
{
int
startIndex
=
1
;
int
count
=
ScimServiceProviderConfigController
.
MAX_RESULTS
;
String
filter
;
String
sortBy
;
String
sortOrder
=
"ascending"
;
String
attributes
;
public
ScimParameters
()
{
}
public
void
parse
()
{
if
(
startIndex
==
-
1
)
{
count
=
ScimServiceProviderConfigController
.
MAX_RESULTS_LIMIT
;
}
if
(
startIndex
<=
0
)
{
startIndex
=
1
;
}
if
(
count
>
ScimServiceProviderConfigController
.
MAX_RESULTS
&&
count
!=
ScimServiceProviderConfigController
.
MAX_RESULTS_LIMIT
)
{
count
=
ScimServiceProviderConfigController
.
MAX_RESULTS
;
}
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
count
)
{
this
.
count
=
count
;
}
public
int
getStartIndex
()
{
return
startIndex
;
}
public
void
setStartIndex
(
int
startIndex
)
{
this
.
startIndex
=
startIndex
;
}
public
String
getfilter
()
{
return
filter
;
}
public
void
setfilter
(
String
filter
)
{
this
.
filter
=
filter
;
}
public
String
getSortBy
()
{
return
sortBy
;
}
public
void
setSortBy
(
String
sortBy
)
{
this
.
sortBy
=
sortBy
;
}
public
String
getSortOrder
()
{
return
sortOrder
;
}
public
void
setSortOrder
(
String
sortOrder
)
{
this
.
sortOrder
=
sortOrder
;
}
public
String
getAttributes
()
{
return
attributes
;
}
public
void
setAttributes
(
String
attributes
)
{
this
.
attributes
=
attributes
;
}
@Override
public
String
toString
()
{
return
"ScimParameters [count="
+
count
+
", startIndex="
+
startIndex
+
", filter="
+
filter
+
", sortBy="
+
sortBy
+
", sortOrder="
+
sortOrder
+
", attributes="
+
attributes
+
"]"
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/Resource.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
Resource.java
浏览文件 @
2cd04e78
...
...
@@ -20,7 +20,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
import
java.util.Set
;
public
class
Resource
implements
Serializable
{
public
class
Scim
Resource
implements
Serializable
{
/**
*
...
...
@@ -29,12 +29,12 @@ public class Resource implements Serializable {
protected
Set
<
String
>
schemas
;
private
String
id
;
private
String
externalId
;
private
Meta
meta
;
private
Scim
Meta
meta
;
public
Resource
()
{
public
Scim
Resource
()
{
}
public
Resource
(
String
id
,
String
externalId
,
Meta
meta
,
Set
<
String
>
schemas
)
{
public
ScimResource
(
String
id
,
String
externalId
,
Scim
Meta
meta
,
Set
<
String
>
schemas
)
{
super
();
this
.
id
=
id
;
this
.
externalId
=
externalId
;
...
...
@@ -54,10 +54,10 @@ public class Resource implements Serializable {
public
void
setExternalId
(
String
externalId
)
{
this
.
externalId
=
externalId
;
}
public
Meta
getMeta
()
{
public
Scim
Meta
getMeta
()
{
return
meta
;
}
public
void
setMeta
(
Meta
meta
)
{
public
void
setMeta
(
Scim
Meta
meta
)
{
this
.
meta
=
meta
;
}
public
Set
<
String
>
getSchemas
()
{
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimSearchResult.java
浏览文件 @
2cd04e78
...
...
@@ -27,12 +27,22 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public
class
ScimSearchResult
<
T
>{
public
static
class
Constants
{
public
static
final
String
FILTER
=
"filter"
;
public
static
final
String
SORTBY
=
"sortBy"
;
public
static
final
String
COUNT
=
"count"
;
public
static
final
String
STARTINDEX
=
"startIndex"
;
}
public
static
final
String
SCHEMA
=
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
;
public
static
final
int
MAX_RESULTS
=
100
;
private
long
totalResults
;
private
long
itemsPerPage
;
private
long
startIndex
;
private
Set
<
String
>
schemas
=
new
HashSet
<>(
Collections
.
singletonList
(
SCHEMA
));
@JsonProperty
(
"Resources"
)
private
List
<
T
>
resources
=
new
ArrayList
<>();
/**
...
...
@@ -50,7 +60,7 @@ public class ScimSearchResult <T>{
/**
* gets a list of found {@link
User}s or {@link
Group}s
* gets a list of found {@link
ScimUser}s or {@link Scim
Group}s
*
* @return a list of found resources
*/
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/User.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
User.java
浏览文件 @
2cd04e78
...
...
@@ -21,17 +21,21 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Map
;
public
class
User
extends
Resource
{
import
com.fasterxml.jackson.annotation.JsonProperty
;
public
class
ScimUser
extends
ScimResource
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
7478787809774041557L
;
public
static
String
SCHEMA
=
"urn:ietf:params:scim:schemas:core:2.0:User"
;
public
static
final
String
SCHEMA
=
"urn:ietf:params:scim:schemas:core:2.0:User"
;
public
static
final
String
SCHEMA_ENTERPRISE
=
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
;
private
String
userName
;
private
User
Name
name
;
private
ScimFormatted
Name
name
;
private
String
displayName
;
private
String
nickName
;
private
String
profileUrl
;
...
...
@@ -43,34 +47,42 @@ public class User extends Resource{
private
Boolean
active
;
private
String
password
;
private
List
<
UserEmail
>
emails
;
private
List
<
Scim
UserEmail
>
emails
;
private
List
<
UserPhoneNumber
>
phoneNumbers
;
private
List
<
Scim
UserPhoneNumber
>
phoneNumbers
;
private
List
<
UserIm
>
ims
;
@JsonProperty
(
SCHEMA_ENTERPRISE
)
ScimEnterprise
enterprise
;
private
List
<
UserPhoto
>
photos
;
private
List
<
ScimUserIm
>
ims
;
private
List
<
ScimUserPhoto
>
photos
;
// Can't really validate that one. value is not acessible
private
List
<
UserAddress
>
addresses
;
private
List
<
ScimUserAddress
>
addresses
;
private
List
<
ScimGroupRef
>
groups
;
private
List
<
GroupRef
>
group
s
;
private
List
<
ScimUserEntitlement
>
entitlement
s
;
private
List
<
UserEntitlement
>
entitlement
s
;
private
List
<
ScimUserRole
>
role
s
;
private
List
<
UserRole
>
roles
;
private
List
<
ScimUserX509Certificate
>
x509Certificates
;
private
Map
<
String
,
ScimUserExtension
>
extensions
;
// T/IDAC 002—2021
private
List
<
String
>
organization
;
private
List
<
String
>
group
;
private
List
<
UserX509Certificate
>
x509Certificates
;
private
Map
<
String
,
UserExtension
>
extensions
;
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
User
Name
getName
()
{
public
ScimFormatted
Name
getName
()
{
return
name
;
}
public
void
setName
(
User
Name
name
)
{
public
void
setName
(
ScimFormatted
Name
name
)
{
this
.
name
=
name
;
}
public
String
getDisplayName
()
{
...
...
@@ -133,67 +145,88 @@ public class User extends Resource{
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
List
<
UserEmail
>
getEmails
()
{
public
List
<
Scim
UserEmail
>
getEmails
()
{
return
emails
;
}
public
void
setEmails
(
List
<
UserEmail
>
emails
)
{
public
void
setEmails
(
List
<
Scim
UserEmail
>
emails
)
{
this
.
emails
=
emails
;
}
public
List
<
UserPhoneNumber
>
getPhoneNumbers
()
{
public
List
<
Scim
UserPhoneNumber
>
getPhoneNumbers
()
{
return
phoneNumbers
;
}
public
void
setPhoneNumbers
(
List
<
UserPhoneNumber
>
phoneNumbers
)
{
public
void
setPhoneNumbers
(
List
<
Scim
UserPhoneNumber
>
phoneNumbers
)
{
this
.
phoneNumbers
=
phoneNumbers
;
}
public
List
<
UserIm
>
getIms
()
{
public
List
<
Scim
UserIm
>
getIms
()
{
return
ims
;
}
public
void
setIms
(
List
<
UserIm
>
ims
)
{
public
void
setIms
(
List
<
Scim
UserIm
>
ims
)
{
this
.
ims
=
ims
;
}
public
List
<
UserPhoto
>
getPhotos
()
{
public
List
<
Scim
UserPhoto
>
getPhotos
()
{
return
photos
;
}
public
void
setPhotos
(
List
<
UserPhoto
>
photos
)
{
public
void
setPhotos
(
List
<
Scim
UserPhoto
>
photos
)
{
this
.
photos
=
photos
;
}
public
List
<
UserAddress
>
getAddresses
()
{
public
List
<
Scim
UserAddress
>
getAddresses
()
{
return
addresses
;
}
public
void
setAddresses
(
List
<
UserAddress
>
addresses
)
{
public
void
setAddresses
(
List
<
Scim
UserAddress
>
addresses
)
{
this
.
addresses
=
addresses
;
}
public
List
<
GroupRef
>
getGroups
()
{
public
List
<
Scim
GroupRef
>
getGroups
()
{
return
groups
;
}
public
void
setGroups
(
List
<
GroupRef
>
groups
)
{
public
void
setGroups
(
List
<
Scim
GroupRef
>
groups
)
{
this
.
groups
=
groups
;
}
public
List
<
UserEntitlement
>
getEntitlements
()
{
public
List
<
Scim
UserEntitlement
>
getEntitlements
()
{
return
entitlements
;
}
public
void
setEntitlements
(
List
<
UserEntitlement
>
entitlements
)
{
public
void
setEntitlements
(
List
<
Scim
UserEntitlement
>
entitlements
)
{
this
.
entitlements
=
entitlements
;
}
public
List
<
UserRole
>
getRoles
()
{
public
List
<
Scim
UserRole
>
getRoles
()
{
return
roles
;
}
public
void
setRoles
(
List
<
UserRole
>
roles
)
{
public
void
setRoles
(
List
<
Scim
UserRole
>
roles
)
{
this
.
roles
=
roles
;
}
public
List
<
UserX509Certificate
>
getX509Certificates
()
{
public
List
<
Scim
UserX509Certificate
>
getX509Certificates
()
{
return
x509Certificates
;
}
public
void
setX509Certificates
(
List
<
UserX509Certificate
>
x509Certificates
)
{
public
void
setX509Certificates
(
List
<
Scim
UserX509Certificate
>
x509Certificates
)
{
this
.
x509Certificates
=
x509Certificates
;
}
public
Map
<
String
,
UserExtension
>
getExtensions
()
{
public
Map
<
String
,
Scim
UserExtension
>
getExtensions
()
{
return
extensions
;
}
public
void
setExtensions
(
Map
<
String
,
UserExtension
>
extensions
)
{
public
void
setExtensions
(
Map
<
String
,
Scim
UserExtension
>
extensions
)
{
this
.
extensions
=
extensions
;
}
public
User
()
{
public
ScimEnterprise
getEnterprise
()
{
return
enterprise
;
}
public
void
setEnterprise
(
ScimEnterprise
enterprise
)
{
this
.
enterprise
=
enterprise
;
}
public
List
<
String
>
getOrganization
()
{
return
organization
;
}
public
void
setOrganization
(
List
<
String
>
organization
)
{
this
.
organization
=
organization
;
}
public
List
<
String
>
getGroup
()
{
return
group
;
}
public
void
setGroup
(
List
<
String
>
group
)
{
this
.
group
=
group
;
}
public
ScimUser
()
{
schemas
=
new
HashSet
<
String
>();
schemas
.
add
(
SCHEMA
);
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Organization
Address.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
ScimUser
Address.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
OrganizationAddress
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserAddress
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
@@ -81,7 +81,7 @@ public class OrganizationAddress extends MultiValuedAttribute implements Seriali
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Organization
Address
()
{
public
ScimUser
Address
()
{
}
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Organization
Email.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
ScimUser
Email.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
OrganizationEmail
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserEmail
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
@@ -57,10 +57,10 @@ public class OrganizationEmail extends MultiValuedAttribute implements Serializa
this
.
primary
=
primary
;
}
public
Organization
Email
()
{
public
ScimUser
Email
()
{
}
public
Organization
Email
(
String
value
,
String
type
,
boolean
primary
)
{
public
ScimUser
Email
(
String
value
,
String
type
,
boolean
primary
)
{
super
();
this
.
value
=
value
;
this
.
type
=
type
;
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserEntitlement.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserEntitlement.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserEntitlement
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserEntitlement
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserExtension.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserExtension.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserExtension
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserExtension
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserIm.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserIm.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserIm
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserIm
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/ScimUserOrganization.java
0 → 100644
浏览文件 @
2cd04e78
/*
* Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.maxkey.identity.scim.resources
;
import
java.io.Serializable
;
public
class
ScimUserOrganization
extends
ScimMultiValuedAttribute
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
3201987266085144715L
;
public
ScimUserOrganization
()
{
super
();
}
public
ScimUserOrganization
(
String
value
,
String
display
,
boolean
primary
)
{
super
();
this
.
value
=
value
;
this
.
display
=
display
;
this
.
primary
=
primary
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserPhoneNumber.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserPhoneNumber.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserPhoneNumber
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserPhoneNumber
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
@@ -35,4 +35,15 @@ public class UserPhoneNumber extends MultiValuedAttribute implements Serializabl
public
static
final
String
OTHER
=
"other"
;
}
public
ScimUserPhoneNumber
()
{
super
();
}
public
ScimUserPhoneNumber
(
String
value
,
String
type
,
boolean
primary
)
{
super
();
this
.
value
=
value
;
this
.
type
=
type
;
this
.
primary
=
primary
;
}
}
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserPhoto.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserPhoto.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserPhoto
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserPhoto
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserRole.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserRole.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserRole
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserRole
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/UserX509Certificate.java
→
maxkey-identitys/maxkey-identity-scim/src/main/java/org/maxkey/identity/scim/resources/
Scim
UserX509Certificate.java
浏览文件 @
2cd04e78
...
...
@@ -19,7 +19,7 @@ package org.maxkey.identity.scim.resources;
import
java.io.Serializable
;
public
class
UserX509Certificate
extends
MultiValuedAttribute
implements
Serializable
{
public
class
ScimUserX509Certificate
extends
Scim
MultiValuedAttribute
implements
Serializable
{
/**
*
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimEnterpriseUserJsonString2ObjectTest.java
浏览文件 @
2cd04e78
...
...
@@ -25,7 +25,7 @@ public class ScimEnterpriseUserJsonString2ObjectTest {
public
static
void
main
(
String
[]
args
)
{
String
userJsonString
=
ReadJson2String
.
read
(
"ScimEnterpriseUserJsonString.json"
);
EnterpriseUser
u
=
JsonUtils
.
json2Object
(
userJsonString
,
EnterpriseUser
.
class
);
ScimEnterpriseUser
u
=
JsonUtils
.
json2Object
(
userJsonString
,
Scim
EnterpriseUser
.
class
);
System
.
out
.
println
(
(
new
JsonPretty
()).
format
(
JsonUtils
.
object2Json
(
u
)));
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimEnterpriseUserJsonTest.java
浏览文件 @
2cd04e78
...
...
@@ -27,12 +27,12 @@ public class ScimEnterpriseUserJsonTest {
public
static
void
main
(
String
[]
args
)
{
EnterpriseUser
u
=
new
EnterpriseUser
();
ScimEnterpriseUser
u
=
new
Scim
EnterpriseUser
();
u
.
setUserName
(
"UserName"
);
u
.
setExternalId
(
"UserName"
);
u
.
setId
(
"1111111111111"
);
Meta
meta
=
new
Meta
();
ScimMeta
meta
=
new
Scim
Meta
();
meta
.
setVersion
(
"W\\/\"f250dd84f0671c3\""
);
meta
.
setCreated
(
new
Date
());
meta
.
setLocation
(
"https://example.com/v2/Users/2819c223..."
);
...
...
@@ -40,7 +40,7 @@ public class ScimEnterpriseUserJsonTest {
meta
.
setLastModified
(
new
Date
());
u
.
setMeta
(
meta
);
UserName
un
=
new
User
Name
();
ScimFormattedName
un
=
new
ScimFormatted
Name
();
un
.
setFamilyName
(
"Jensen"
);
un
.
setFormatted
(
"Ms. Barbara J Jensen, III"
);
un
.
setGivenName
(
"Barbara"
);
...
...
@@ -49,28 +49,28 @@ public class ScimEnterpriseUserJsonTest {
un
.
setMiddleName
(
"Jane"
);
u
.
setName
(
un
);
List
<
UserPhoneNumber
>
UserPhoneNumberList
=
new
ArrayList
<
UserPhoneNumber
>();
UserPhoneNumber
pn
=
new
UserPhoneNumber
();
List
<
ScimUserPhoneNumber
>
UserPhoneNumberList
=
new
ArrayList
<
Scim
UserPhoneNumber
>();
ScimUserPhoneNumber
pn
=
new
Scim
UserPhoneNumber
();
pn
.
setValue
(
"555-555-8377"
);
pn
.
setType
(
UserPhoneNumber
.
UserPhoneNumberType
.
WORK
);
pn
.
setType
(
Scim
UserPhoneNumber
.
UserPhoneNumberType
.
WORK
);
UserPhoneNumber
pnh
=
new
UserPhoneNumber
();
ScimUserPhoneNumber
pnh
=
new
Scim
UserPhoneNumber
();
pnh
.
setValue
(
"555-555-8377"
);
pnh
.
setType
(
UserPhoneNumber
.
UserPhoneNumberType
.
HOME
);
pnh
.
setType
(
Scim
UserPhoneNumber
.
UserPhoneNumberType
.
HOME
);
UserPhoneNumberList
.
add
(
pnh
);
UserPhoneNumberList
.
add
(
pn
);
u
.
setPhoneNumbers
(
UserPhoneNumberList
);
List
<
UserEmail
>
ueList
=
new
ArrayList
<
UserEmail
>();
UserEmail
ue
=
new
UserEmail
();
List
<
ScimUserEmail
>
ueList
=
new
ArrayList
<
Scim
UserEmail
>();
ScimUserEmail
ue
=
new
Scim
UserEmail
();
ue
.
setValue
(
"bjensen@example.com"
);
ue
.
setType
(
UserEmail
.
UserEmailType
.
WORK
);
ue
.
setType
(
Scim
UserEmail
.
UserEmailType
.
WORK
);
ueList
.
add
(
ue
);
u
.
setEmails
(
ueList
);
Enterprise
ent
=
new
Enterprise
();
ScimEnterprise
ent
=
new
Scim
Enterprise
();
ent
.
setCostCenter
(
"1111"
);
ent
.
setDepartment
(
"de"
);
ent
.
setEmployeeNumber
(
"k200908"
);
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimGroupJsonString2ObjectTest.java
浏览文件 @
2cd04e78
...
...
@@ -23,7 +23,7 @@ import org.maxkey.util.JsonUtils;
public
class
ScimGroupJsonString2ObjectTest
{
public
static
void
main
(
String
[]
args
)
{
String
userJsonString
=
ReadJson2String
.
read
(
"ScimGroupJsonString.json"
);
Group
g
=
JsonUtils
.
json2Object
(
userJsonString
,
Group
.
class
);
ScimGroup
g
=
JsonUtils
.
json2Object
(
userJsonString
,
Scim
Group
.
class
);
System
.
out
.
println
(
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimGroupJsonTest.java
浏览文件 @
2cd04e78
...
...
@@ -26,9 +26,9 @@ import org.maxkey.util.JsonUtils;
public
class
ScimGroupJsonTest
{
public
static
void
main
(
String
[]
args
)
{
Group
g
=
new
Group
();
ScimGroup
g
=
new
Scim
Group
();
Meta
meta
=
new
Meta
();
ScimMeta
meta
=
new
Scim
Meta
();
meta
.
setVersion
(
"W\\/\"f250dd84f0671c3\""
);
meta
.
setCreated
(
new
Date
());
meta
.
setLocation
(
"https://example.com/v2/Users/2819c223..."
);
...
...
@@ -38,16 +38,16 @@ public class ScimGroupJsonTest {
g
.
setDisplayName
(
"Tour Guides"
);
Set
<
MemberRef
>
mrSet
=
new
HashSet
<
MemberRef
>();
MemberRef
mr1
=
new
MemberRef
();
Set
<
ScimMemberRef
>
mrSet
=
new
HashSet
<
Scim
MemberRef
>();
ScimMemberRef
mr1
=
new
Scim
MemberRef
();
mr1
.
setReference
(
"https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646"
);
mr1
.
setValue
(
"2819c223-7f76-453a-919d-413861904646"
);
mr1
.
setDisplay
(
"Babs Jensen"
);
MemberRef
mr2
=
new
MemberRef
();
ScimMemberRef
mr2
=
new
Scim
MemberRef
();
mr2
.
setReference
(
"https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646"
);
mr2
.
setValue
(
"2819c223-7f76-453a-919d-413861904646"
);
mr2
.
setDisplay
(
"Babs Jensen"
);
MemberRef
mr3
=
new
MemberRef
();
ScimMemberRef
mr3
=
new
Scim
MemberRef
();
mr3
.
setReference
(
"https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646"
);
mr3
.
setValue
(
"2819c223-7f76-453a-919d-413861904646"
);
mr3
.
setDisplay
(
"Babs Jensen"
);
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimUserJsonString2ObjectTest.java
浏览文件 @
2cd04e78
...
...
@@ -25,7 +25,7 @@ public class ScimUserJsonString2ObjectTest {
public
static
void
main
(
String
[]
args
)
{
String
userJsonString
=
ReadJson2String
.
read
(
"ScimUserJsonString.json"
);
User
u
=
JsonUtils
.
json2Object
(
userJsonString
,
User
.
class
);
ScimUser
u
=
JsonUtils
.
json2Object
(
userJsonString
,
Scim
User
.
class
);
System
.
out
.
println
(
(
new
JsonPretty
()).
format
(
JsonUtils
.
object2Json
(
u
)));
}
...
...
maxkey-identitys/maxkey-identity-scim/src/test/java/org/maxkey/identity/scim/resources/ScimUserJsonTest.java
浏览文件 @
2cd04e78
...
...
@@ -26,12 +26,12 @@ import org.maxkey.util.JsonUtils;
public
class
ScimUserJsonTest
{
public
static
void
main
(
String
[]
args
)
{
User
u
=
new
User
();
ScimUser
u
=
new
Scim
User
();
u
.
setUserName
(
"UserName"
);
u
.
setExternalId
(
"UserName"
);
u
.
setId
(
"1111111111111"
);
Meta
meta
=
new
Meta
();
ScimMeta
meta
=
new
Scim
Meta
();
meta
.
setVersion
(
"W\\/\"f250dd84f0671c3\""
);
meta
.
setCreated
(
new
Date
());
meta
.
setLocation
(
"https://example.com/v2/Users/2819c223..."
);
...
...
@@ -39,7 +39,7 @@ public class ScimUserJsonTest {
meta
.
setLastModified
(
new
Date
());
u
.
setMeta
(
meta
);
UserName
un
=
new
User
Name
();
ScimFormattedName
un
=
new
ScimFormatted
Name
();
un
.
setFamilyName
(
"Jensen"
);
un
.
setFormatted
(
"Ms. Barbara J Jensen, III"
);
un
.
setGivenName
(
"Barbara"
);
...
...
@@ -48,24 +48,24 @@ public class ScimUserJsonTest {
un
.
setMiddleName
(
"Jane"
);
u
.
setName
(
un
);
List
<
UserPhoneNumber
>
UserPhoneNumberList
=
new
ArrayList
<
UserPhoneNumber
>();
UserPhoneNumber
pn
=
new
UserPhoneNumber
();
List
<
ScimUserPhoneNumber
>
UserPhoneNumberList
=
new
ArrayList
<
Scim
UserPhoneNumber
>();
ScimUserPhoneNumber
pn
=
new
Scim
UserPhoneNumber
();
pn
.
setValue
(
"555-555-8377"
);
pn
.
setType
(
UserPhoneNumber
.
UserPhoneNumberType
.
WORK
);
pn
.
setType
(
Scim
UserPhoneNumber
.
UserPhoneNumberType
.
WORK
);
UserPhoneNumber
pnh
=
new
UserPhoneNumber
();
ScimUserPhoneNumber
pnh
=
new
Scim
UserPhoneNumber
();
pnh
.
setValue
(
"555-555-8377"
);
pnh
.
setType
(
UserPhoneNumber
.
UserPhoneNumberType
.
HOME
);
pnh
.
setType
(
Scim
UserPhoneNumber
.
UserPhoneNumberType
.
HOME
);
UserPhoneNumberList
.
add
(
pnh
);
UserPhoneNumberList
.
add
(
pn
);
u
.
setPhoneNumbers
(
UserPhoneNumberList
);
List
<
UserEmail
>
ueList
=
new
ArrayList
<
UserEmail
>();
UserEmail
ue
=
new
UserEmail
();
List
<
ScimUserEmail
>
ueList
=
new
ArrayList
<
Scim
UserEmail
>();
ScimUserEmail
ue
=
new
Scim
UserEmail
();
ue
.
setValue
(
"bjensen@example.com"
);
ue
.
setType
(
UserEmail
.
UserEmailType
.
WORK
);
ue
.
setType
(
Scim
UserEmail
.
UserEmailType
.
WORK
);
ueList
.
add
(
ue
);
u
.
setEmails
(
ueList
);
...
...
maxkey-lib/mybatis-jpa-extra-2.6.jar
浏览文件 @
2cd04e78
无法预览此类型文件
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/GroupMemberMapper.java
浏览文件 @
2cd04e78
...
...
@@ -25,6 +25,7 @@ import java.util.List;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.maxkey.entity.GroupMember
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.UserInfo
;
/**
* @author Crystal.sea
...
...
@@ -44,6 +45,8 @@ public interface GroupMemberMapper extends IJpaBaseMapper<GroupMember> {
public
int
deleteByGroupId
(
String
groupId
);
public
List
<
UserInfo
>
queryMemberByGroupId
(
String
groupId
);
}
maxkey-persistence/src/main/java/org/maxkey/persistence/mapper/GroupsMapper.java
浏览文件 @
2cd04e78
...
...
@@ -33,4 +33,6 @@ import org.maxkey.entity.Groups;
public
interface
GroupsMapper
extends
IJpaBaseMapper
<
Groups
>
{
public
List
<
Groups
>
queryDynamicGroups
(
Groups
groups
);
public
List
<
Groups
>
queryGroupByUserId
(
String
userId
);
}
maxkey-persistence/src/main/java/org/maxkey/persistence/service/GroupMemberService.java
浏览文件 @
2cd04e78
...
...
@@ -17,9 +17,12 @@
package
org.maxkey.persistence.service
;
import
java.util.List
;
import
org.apache.mybatis.jpa.persistence.JpaBaseService
;
import
org.maxkey.entity.GroupMember
;
import
org.maxkey.entity.Groups
;
import
org.maxkey.entity.UserInfo
;
import
org.maxkey.persistence.mapper.GroupMemberMapper
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -45,8 +48,13 @@ public class GroupMemberService extends JpaBaseService<GroupMember>{
public
int
deleteDynamicGroupMember
(
Groups
dynamicGroup
)
{
return
getMapper
().
deleteDynamicGroupMember
(
dynamicGroup
);
}
public
int
deleteByGroupId
(
String
groupId
)
{
return
getMapper
().
deleteByGroupId
(
groupId
);
}
public
List
<
UserInfo
>
queryMemberByGroupId
(
String
groupId
){
return
getMapper
().
queryMemberByGroupId
(
groupId
);
}
}
maxkey-persistence/src/main/java/org/maxkey/persistence/service/GroupsService.java
浏览文件 @
2cd04e78
...
...
@@ -71,6 +71,10 @@ public class GroupsService extends JpaBaseService<Groups> implements Serializab
return
true
;
}
public
List
<
Groups
>
queryGroupByUserId
(
String
userId
){
return
this
.
getMapper
().
queryGroupByUserId
(
userId
);
}
public
void
refreshDynamicGroups
(
Groups
dynamicGroup
){
if
(
dynamicGroup
.
getDynamic
().
equals
(
ConstantsStatus
.
ACTIVE
+
""
))
{
boolean
isDynamicTimeSupport
=
false
;
...
...
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/GroupMemberMapper.xml
浏览文件 @
2cd04e78
...
...
@@ -244,6 +244,52 @@
)
</delete>
<select
id=
"queryMemberByGroupId"
parameterType=
"string"
resultType=
"UserInfo"
>
select distinct
u.id,
u.username,
u.usertype,
u.windowsaccount,
u.displayname ,
u.nickname ,
u.namezhspell,
u.namezhshortspell,
u.givenname ,
u.middlename ,
u.familyname ,
u.gender,
u.authntype,
u.mobile,
u.email,
u.workemail,
u.workphonenumber,
u.employeenumber,
u.division,
u.costcenter,
u.organization,
u.departmentid,
u.department,
u.jobtitle,
u.joblevel,
gm.createddate,
u.status
from
mxk_userinfo u,
mxk_groups g,
mxk_group_member gm
where 1 = 1
and gm.groupid = #{value}
and g.id = #{value}
and gm.type in( 'USER','USER-DYNAMIC')
and gm.groupid = g.id
and gm.memberid = u.id
</select>
<delete
id=
"deleteByGroupId"
parameterType=
"string"
>
delete from mxk_group_member gm
where gm.groupid=#{value}
...
...
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/GroupsMapper.xml
浏览文件 @
2cd04e78
...
...
@@ -55,4 +55,20 @@
</update>
<select
id=
"queryGroupByUserId"
parameterType=
"string"
resultType=
"Groups"
>
select distinct
g.*
from
mxk_userinfo u,
mxk_groups g,
mxk_group_member gm
where 1 = 1
and gm.memberid = #{value}
and u.id = #{value}
and gm.type in( 'USER','USER-DYNAMIC')
and gm.groupid = g.id
and gm.memberid = u.id
</select>
</mapper>
\ No newline at end of file
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtJobs.java
浏览文件 @
2cd04e78
...
...
@@ -94,7 +94,7 @@ public class MaxKeyMgtJobs implements InitializingBean {
.
build
();
JobDataMap
jobDataMap
=
new
JobDataMap
();
jobDataMap
.
put
(
"
groupsS
ervice"
,
groupsService
);
jobDataMap
.
put
(
"
s
ervice"
,
groupsService
);
CronScheduleBuilder
scheduleBuilder
=
CronScheduleBuilder
.
cronSchedule
(
cronSchedule
);
CronTrigger
cronTrigger
=
...
...
@@ -121,7 +121,7 @@ public class MaxKeyMgtJobs implements InitializingBean {
.
build
();
JobDataMap
jobDataMap
=
new
JobDataMap
();
jobDataMap
.
put
(
"
accountsS
ervice"
,
accountsService
);
jobDataMap
.
put
(
"
s
ervice"
,
accountsService
);
CronScheduleBuilder
scheduleBuilder
=
CronScheduleBuilder
.
cronSchedule
(
cronSchedule
);
CronTrigger
cronTrigger
=
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/MaxKeyMgtMvcConfig.java
浏览文件 @
2cd04e78
...
...
@@ -151,9 +151,15 @@ public class MaxKeyMgtMvcConfig implements WebMvcConfigurer {
_logger
.
debug
(
"add LocaleChangeInterceptor"
);
/*
* api
* idm
* scim
* */
registry
.
addInterceptor
(
restApiPermissionAdapter
)
.
addPathPatterns
(
"/im/api/**"
)
.
addPathPatterns
(
"/api/**"
)
.
addPathPatterns
(
"/api/idm/**"
)
.
addPathPatterns
(
"/api/idm/scim/**"
)
;
_logger
.
debug
(
"add RestApiPermissionAdapter"
);
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/jobs/AccountsStrategyJob.java
浏览文件 @
2cd04e78
...
...
@@ -54,12 +54,14 @@ public class AccountsStrategyJob implements Job , Serializable {
jobStatus
=
JOBSTATUS
.
RUNNING
;
try
{
if
(
accountsService
==
null
)
{
accountsService
=
(
AccountsService
)
context
.
getMergedJobDataMap
().
get
(
"accountsService"
);
}
accountsService
=
(
AccountsService
)
context
.
getMergedJobDataMap
().
get
(
"service"
);
}
else
{
accountsService
.
refreshAllByStrategy
();
Thread
.
sleep
(
10
*
1000
);
}
_logger
.
debug
(
"DynamicGroupsJob is success "
);
}
catch
(
Exception
e
)
{
_logger
.
error
(
"Exception "
,
e
);
...
...
maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/jobs/DynamicGroupsJob.java
浏览文件 @
2cd04e78
...
...
@@ -53,12 +53,14 @@ public class DynamicGroupsJob implements Job , Serializable {
jobStatus
=
JOBSTATUS
.
RUNNING
;
try
{
if
(
groupsService
==
null
)
{
groupsService
=
(
GroupsService
)
context
.
getMergedJobDataMap
().
get
(
"service"
);
}
groupsService
=
(
GroupsService
)
context
.
getMergedJobDataMap
().
get
(
"service"
);
}
else
{
groupsService
.
refreshAllDynamicGroups
();
Thread
.
sleep
(
10
*
1000
);
}
_logger
.
debug
(
"DynamicGroupsJob is success "
);
}
catch
(
Exception
e
)
{
_logger
.
error
(
"Exception "
,
e
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录