Skip to content

Commit 7093f5c

Browse files
committed
Release 1.1.9
1 parent 4fdc162 commit 7093f5c

8 files changed

Lines changed: 43 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## 1.1.9
9+
10+
- Added debug logging for CRM endpoints
11+
12+
## 1.1.8
13+
14+
- Fix: in attribute aggregation for authorization roles ensure the role is a valid CRM role
15+
816
## 1.1.7
917

1018
- Fix: Duplicate key exception for CRM invitations

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.openconext</groupId>
66
<artifactId>invite</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.1.9</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>invite-client</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.openconext</groupId>
55
<artifactId>invite</artifactId>
6-
<version>1.1.8</version>
6+
<version>1.1.9</version>
77
<packaging>pom</packaging>
88
<name>invite</name>
99
<description>SURFconext Invite</description>

provisioning-mock/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.openconext</groupId>
66
<artifactId>invite</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.1.9</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>provisioning-mock</artifactId>

server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.openconext</groupId>
66
<artifactId>invite</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.1.9</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>invite-server</artifactId>

server/src/main/java/invite/crm/CRMController.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,14 @@ public ResponseEntity<ProfileResponse> query(@RequestParam(value = "uid", requir
269269
@PreAuthorize("hasRole('CRM')")
270270
public ResponseEntity<Map<String, ConnectionStatusResponse>> connectionStatus(@RequestBody ConnectionStatus connectionStatus) {
271271
String crmOrganisationId = connectionStatus.organisationId();
272+
if (LOG.isDebugEnabled()) {
273+
LOG.debug(String.format("/crm/api/v1/profiles for crmOrganisationId %s", crmOrganisationId));
274+
}
272275
Optional<Organisation> optionalOrganisation = organisationRepository.findByCrmOrganisationId(crmOrganisationId);
273276
if (optionalOrganisation.isEmpty()) {
277+
if (LOG.isDebugEnabled()) {
278+
LOG.debug(String.format("/crm/api/v1/profiles No organisation found for %s", crmOrganisationId));
279+
}
274280
return ResponseEntity.ok(Map.of());
275281
}
276282
Organisation organisation = optionalOrganisation.get();
@@ -287,6 +293,9 @@ public ResponseEntity<Map<String, ConnectionStatusResponse>> connectionStatus(@R
287293
CRMStatusCode.Paired.getStatus(), CRMStatusCode.Paired.getStatusCode()
288294
)
289295
));
296+
if (LOG.isDebugEnabled()) {
297+
LOG.debug(String.format("/crm/api/v1/profiles connectionStatus.connected is true. Returning %s", responseMap));
298+
}
290299
return ResponseEntity.ok(responseMap);
291300
} else {
292301
Map<String, ConnectionStatusResponse> responseMap = invitationRepository
@@ -313,6 +322,9 @@ public ResponseEntity<Map<String, ConnectionStatusResponse>> connectionStatus(@R
313322
},
314323
(existing, replacement) -> replacement
315324
));
325+
if (LOG.isDebugEnabled()) {
326+
LOG.debug(String.format("/crm/api/v1/profiles connectionStatus.connected is false. Returning %s", responseMap));
327+
}
316328
return ResponseEntity.ok(responseMap);
317329
}
318330
}
@@ -336,6 +348,9 @@ private CRMStatusCode crmStatusCode(Invitation invitation) {
336348
@SecurityRequirement(name = API_HEADER_SCHEME_NAME)
337349
@PreAuthorize("hasRole('CRM')")
338350
public ResponseEntity<ResendInvitationResponse> resendInvitation(@RequestBody ResendInvitation resendInvitation) {
351+
if (LOG.isDebugEnabled()) {
352+
LOG.debug(String.format("/crm/api/v1/invite/resend for %s", resendInvitation));
353+
}
339354
List<Invitation> invitations = invitationRepository.findByCrmContactIdAndCrmOrganisationId(resendInvitation.crmContatcId(),
340355
resendInvitation.crmOrganisationId());
341356
invitations.forEach(invitation -> {
@@ -355,7 +370,11 @@ public ResponseEntity<ResendInvitationResponse> resendInvitation(@RequestBody Re
355370

356371
});
357372
String timestamp = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"));
358-
return ResponseEntity.ok(new ResendInvitationResponse(timestamp, 200, "ok", "Resend invitation"));
373+
ResendInvitationResponse response = new ResendInvitationResponse(timestamp, 200, "ok", "Resend invitation");
374+
if (LOG.isDebugEnabled()) {
375+
LOG.debug(String.format("/crm/api/v1/invite/resend returning %s", response));
376+
}
377+
return ResponseEntity.ok(response);
359378
}
360379

361380
@PostMapping(value = "/crm/api/v1/invite/remove", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -391,6 +410,10 @@ public ResponseEntity<String> remove(@RequestBody RemoveRoles removeRoles) {
391410
@SecurityRequirement(name = API_HEADER_SCHEME_NAME)
392411
@PreAuthorize("hasRole('CRM')")
393412
public ResponseEntity<List<CRMOrganisation>> organisations() {
413+
if (LOG.isDebugEnabled()) {
414+
LOG.debug("/crm/api/v1/organisations called");
415+
}
416+
394417
List<Organisation> organisations = organisationRepository.findByCrmOrganisationIdIsNotNull();
395418
List<CRMOrganisation> crmOrganisations = organisations.stream()
396419
.map(organisation -> new CRMOrganisation(
@@ -399,6 +422,9 @@ public ResponseEntity<List<CRMOrganisation>> organisations() {
399422
organisation.getCrmOrganisationName()
400423
))
401424
.toList();
425+
if (LOG.isDebugEnabled()) {
426+
LOG.debug(String.format("/crm/api/v1/organisations returning %s", crmOrganisations));
427+
}
402428
return ResponseEntity.ok(crmOrganisations);
403429
}
404430

server/src/test/java/invite/AbstractTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,9 @@ protected void seedUserRoleAudits(Instant createdAt) {
834834

835835
@SafeVarargs
836836
protected final <M> void doSave(JpaRepository<M, Long> repository, M... entities) {
837-
repository.saveAll(Arrays.asList(entities));
837+
Arrays.asList(entities).forEach(entity -> {
838+
repository.save(entity);
839+
});
838840
}
839841

840-
841842
}

welcome/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.openconext</groupId>
66
<artifactId>invite</artifactId>
7-
<version>1.1.8</version>
7+
<version>1.1.9</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010
<artifactId>invite-welcome</artifactId>

0 commit comments

Comments
 (0)