Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Rename transferblocks to transfer-transactions
Browse files Browse the repository at this point in the history
Signed-off-by: Niels Thykier <[email protected]>
  • Loading branch information
nt-gt committed Jun 19, 2023
1 parent 59506e2 commit c887722
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ While the eBLPlatformIdentifier and legal name are required, it is optional but
This additional information can be used by the receiving platform to perform additional verification. For providing this additional information the DCSA Transaction Party object is used.
The DCSA Transaction Party object allows of the provision of LEI and DID among other as documented in the [DCSA Transaction Party object](https://app.swaggerhub.com/apis/dcsaorg/DCSA_EEC/0.12-alpha#/transactionParty).

### Service discovery
The platform domain part of the eBLPlatformIdentifier being a resolvable domain name can be used for DNS based service discovery.
With this an additional TXT record can be created linking to the API endpoint providing the PUT `/v1/transferblock` operation.

Example:
dcsaeblplatform.org can link to a TXT record containing the full API endpoint -> `api.dcsaeblplatform.org/v1/transferblocks`

## Security considerations

### Transport level security
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ImportController {

private final ImportService importService;

@PutMapping(value = "/transferblocks", // TODO: Rename when we are ready to change the API
@PutMapping(value = "/transfer-transactions",
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> importEBLEnvelope(@RequestBody @Valid EBLEnvelopeTO eblEnvelopeTO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private URI transfereeToPlatformHost(String transferee) {
String host = transferee.substring(transferee.indexOf("@") + 1);
return UriComponentsBuilder.fromHttpUrl("https://" + host)
.scheme("https")
.path("/v1/transferblocks")
.path("/v1/transfer-transactions")
.build()
.toUri();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void testImportController() throws Exception {

when(service.importEbl(isNotNull())).thenReturn(Optional.of("Dummy signature"));

String response = mockMvc.perform(put("/transferblocks").contentType(MediaType.APPLICATION_JSON).content(rawEBLEnvelope))
String response = mockMvc.perform(put("/transfer-transactions").contentType(MediaType.APPLICATION_JSON).content(rawEBLEnvelope))
.andDo(print())
.andExpect(status().isOk())
.andReturn()
Expand All @@ -60,19 +60,19 @@ void testImportControllerError() throws Exception {

when(service.importEbl(isNotNull())).thenReturn(Optional.empty());

mockMvc.perform(put("/transferblocks").contentType(MediaType.APPLICATION_JSON).content(rawEBLEnvelope))
mockMvc.perform(put("/transfer-transactions").contentType(MediaType.APPLICATION_JSON).content(rawEBLEnvelope))
.andDo(print())
.andExpect(status().isBadRequest());

}

@Test
void testImportControllerInvalidInput() throws Exception {
mockMvc.perform(put("/transferblocks").contentType(MediaType.APPLICATION_JSON).content("invalid request"))
mockMvc.perform(put("/transfer-transactions").contentType(MediaType.APPLICATION_JSON).content("invalid request"))
.andDo(print())
.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.httpMethod").value("PUT"))
.andExpect(jsonPath("$.requestUri").value("/transferblocks"))
.andExpect(jsonPath("$.requestUri").value("/transfer-transactions"))
.andExpect(jsonPath("$.errors[0].reason").value("invalidInput"))
.andExpect(
jsonPath("$.errors[0].message")
Expand Down
6 changes: 3 additions & 3 deletions postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
],
"path": [
"v1",
"transferblocks"
"transfer-transactions"
]
}
},
Expand Down Expand Up @@ -538,14 +538,14 @@
}
},
"url": {
"raw": "https://{{BASE_URL}}/{{MAJOR_VERSION}}/transferblocks",
"raw": "https://{{BASE_URL}}/{{MAJOR_VERSION}}/transfer-transactions",
"protocol": "https",
"host": [
"{{BASE_URL}}"
],
"path": [
"{{MAJOR_VERSION}}",
"transferblocks"
"transfer-transactions"
]
}
},
Expand Down

0 comments on commit c887722

Please sign in to comment.