From b9d13e69d0027b5916f444e27adb09753d4440ee Mon Sep 17 00:00:00 2001 From: MaxKey Date: Tue, 11 Apr 2023 10:00:23 +0800 Subject: [PATCH] SCIM Rest logs --- .../web/apis/identity/rest/RestOrganizationController.java | 1 + .../maxkey/web/apis/identity/rest/RestUserInfoController.java | 2 +- .../maxkey/web/apis/identity/scim/ScimGroupController.java | 4 ++++ .../web/apis/identity/scim/ScimOrganizationController.java | 4 ++++ .../org/maxkey/web/apis/identity/scim/ScimUserController.java | 4 ++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java index 9e55a9816..db96e529e 100644 --- a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java +++ b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestOrganizationController.java @@ -47,6 +47,7 @@ public class RestOrganizationController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public Organizations getUser(@PathVariable String id, @RequestParam(required = false) String attributes) { + _logger.debug("Organizations id {} , attributes {}", id , attributes); Organizations org = organizationsService.get(id); return org; } diff --git a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java index dc70dec3f..a1aafcb72 100644 --- a/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java +++ b/maxkey-web-apis/maxkey-web-api-rest/src/main/java/org/maxkey/web/apis/identity/rest/RestUserInfoController.java @@ -52,7 +52,7 @@ public class RestUserInfoController { public UserInfo getUser( @PathVariable String id, @RequestParam(required = false) String attributes) { - + _logger.debug("UserInfo id {} , attributes {}", id , attributes); UserInfo loadUserInfo = userInfoService.get(id); loadUserInfo.setDecipherable(null); return loadUserInfo; diff --git a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimGroupController.java b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimGroupController.java index d6e74830b..e2e1ec1ba 100644 --- a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimGroupController.java +++ b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimGroupController.java @@ -64,6 +64,7 @@ public class ScimGroupController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public MappingJacksonValue get(@PathVariable String id, @RequestParam(required = false) String attributes) { + _logger.debug("ScimGroup id {} , attributes {}", id , attributes); Roles role = rolesService.get(id); ScimGroup scimGroup = role2ScimGroup(role); List userList = roleMemberService.queryMemberByRoleId(id); @@ -81,6 +82,7 @@ public class ScimGroupController { public MappingJacksonValue create(@RequestBody ScimGroup scimGroup, @RequestParam(required = false) String attributes, UriComponentsBuilder builder) throws IOException { + _logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes); Roles role =scimGroup2Role(scimGroup); rolesService.insert(role); return get(role.getId(),attributes); @@ -91,6 +93,7 @@ public class ScimGroupController { @RequestBody ScimGroup scimGroup, @RequestParam(required = false) String attributes) throws IOException { + _logger.debug("ScimGroup content {} , attributes {}", scimGroup , attributes); Roles role =scimGroup2Role(scimGroup); rolesService.update(role); return get(role.getId(),attributes); @@ -99,6 +102,7 @@ public class ScimGroupController { @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void delete(@PathVariable final String id) { + _logger.debug("ScimGroup id {} " , id); rolesService.remove(id); } diff --git a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimOrganizationController.java b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimOrganizationController.java index 6a776eb48..199bfc294 100644 --- a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimOrganizationController.java +++ b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimOrganizationController.java @@ -65,6 +65,7 @@ public class ScimOrganizationController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public MappingJacksonValue get(@PathVariable String id, @RequestParam(required = false) String attributes) { + _logger.debug("ScimOrganization id {} , attributes {}", id , attributes); Organizations org = organizationsService.get(id); ScimOrganization scimOrg = org2ScimOrg(org); @@ -75,6 +76,7 @@ public class ScimOrganizationController { public MappingJacksonValue create(@RequestBody ScimOrganization scimOrg, @RequestParam(required = false) String attributes, UriComponentsBuilder builder) throws IOException { + _logger.debug("ScimOrganization content {} , attributes {}", scimOrg , attributes); Organizations createOrg = scimOrg2Org(scimOrg); organizationsService.insert(createOrg); return get(createOrg.getId(), attributes); @@ -84,6 +86,7 @@ public class ScimOrganizationController { public MappingJacksonValue replace(@PathVariable String id, @RequestBody ScimOrganization scimOrg, @RequestParam(required = false) String attributes)throws IOException { + _logger.debug("ScimOrganization content {} , attributes {}", scimOrg , attributes); Organizations updateOrg = scimOrg2Org(scimOrg); organizationsService.update(updateOrg); return get(id, attributes); @@ -92,6 +95,7 @@ public class ScimOrganizationController { @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void delete(@PathVariable final String id) { + _logger.debug("ScimOrganization id {}", id ); organizationsService.remove(id); } diff --git a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimUserController.java b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimUserController.java index b37c4e27d..bb7bcd7c3 100644 --- a/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimUserController.java +++ b/maxkey-web-apis/maxkey-web-api-scim/src/main/java/org/maxkey/web/apis/identity/scim/ScimUserController.java @@ -77,6 +77,7 @@ public class ScimUserController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public MappingJacksonValue get(@PathVariable String id, @RequestParam(required = false) String attributes) { + _logger.debug("ScimUser id {} , attributes {}", id , attributes); UserInfo userInfo = userInfoService.get(id); ScimUser scimUser = userInfo2ScimUser(userInfo); return new MappingJacksonValue(scimUser); @@ -86,6 +87,7 @@ public class ScimUserController { public MappingJacksonValue create(@RequestBody ScimUser user, @RequestParam(required = false) String attributes, UriComponentsBuilder builder) throws IOException { + _logger.debug("ScimUser {} , attributes {}", user , attributes); UserInfo userInfo = scimUser2UserInfo(user); userInfoService.insert(userInfo); return get(userInfo.getId(),attributes); @@ -96,6 +98,7 @@ public class ScimUserController { @RequestBody ScimUser user, @RequestParam(required = false) String attributes) throws IOException { + _logger.debug("ScimUser {} , attributes {}", user , attributes); UserInfo userInfo = scimUser2UserInfo(user); userInfoService.update(userInfo); return get(id,attributes); @@ -104,6 +107,7 @@ public class ScimUserController { @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void delete(@PathVariable final String id) { + _logger.debug("ScimUser id {} ", id ); userInfoService.remove(id); }