From 870077a1364d77f15b583afe861095bfc790d585 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Wed, 13 Mar 2024 14:23:56 +0100 Subject: [PATCH] Added logging to provisioning --- .../access/provision/ProvisioningServiceDefault.java | 9 +++++++++ server/src/main/java/access/voot/VootController.java | 1 + server/src/main/resources/application.yml | 10 +++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/access/provision/ProvisioningServiceDefault.java b/server/src/main/java/access/provision/ProvisioningServiceDefault.java index 6bb3a48a..4deee1b3 100644 --- a/server/src/main/java/access/provision/ProvisioningServiceDefault.java +++ b/server/src/main/java/access/provision/ProvisioningServiceDefault.java @@ -232,6 +232,12 @@ public void updateGroupRequest(List previousManageIdentifiers, Role newR if (previousManageIdentifiers.equals(newManageIdentifiers)) { return; } + + LOG.info(String.format("Group %s update request with different manage identifiers. Old identifiers %s, new identifiers %s", + newRole.getName(), + previousManageIdentifiers, + newManageIdentifiers)); + List addedManageIdentifiers = newManageIdentifiers.stream().filter(id -> !previousManageIdentifiersSorted.contains(id)).toList(); List deletedManageIdentifiers = previousManageIdentifiers.stream().filter(id -> !newManageIdentifiers.contains(id)).toList(); @@ -250,6 +256,9 @@ public void updateGroupRequest(List previousManageIdentifiers, Role newR this.sendGroupPutRequest(provisioning, provisionedGroup, userRoles, newRole, OperationType.Add); }); }); + + LOG.info(String.format("Deleting existing provisionings %s from group %s", deletedManageIdentifiers, newRole.getName())); + List provisionings = manage.provisioning(deletedManageIdentifiers).stream().map(Provisioning::new).toList(); deleteGroupRequest(newRole, provisionings); } diff --git a/server/src/main/java/access/voot/VootController.java b/server/src/main/java/access/voot/VootController.java index 73c96c4c..e27bc581 100644 --- a/server/src/main/java/access/voot/VootController.java +++ b/server/src/main/java/access/voot/VootController.java @@ -28,6 +28,7 @@ @RequestMapping(value = {"/api/voot", "/api/external/v1/voot"}, produces = MediaType.APPLICATION_JSON_VALUE) @SecurityRequirement(name = VOOT_SCHEME_NAME) public class VootController { + private static final Log LOG = LogFactory.getLog(VootController.class); private final UserRepository userRepository; diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index 3ba2d066..7566a51c 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -65,10 +65,10 @@ spring: port: 3025 crypto: - development-mode: True - private-key-location: classpath:nope -# development-mode: False -# private-key-location: classpath:/private_key_pkcs8.pem +# development-mode: True +# private-key-location: classpath:nope + development-mode: False + private-key-location: classpath:/private_key_pkcs8.pem cron: node-cron-job-responsible: true @@ -136,7 +136,7 @@ email: enabled: false manage: - enabled: False + enabled: True url: "https://manage.test2.surfconext.nl" user: invite password: secret