Skip to content

Commit

Permalink
fix after reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf4ood committed Jul 10, 2023
1 parent e1f9b47 commit a6d66c1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 29 deletions.
6 changes: 3 additions & 3 deletions edc-extensions/control-plane-adapter-api/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Control Plane Adapter API (EDR management)

This module provide a new APIs on top of the EDC management APIs for dealing with EDRs token.
This module provides extensions to the EDC management API for dealing with EDR tokens.

The APIs are mounted in the same context of the `management` APIs. So no additional configuration is required.
The extensions are added to the same context as the management APIs, so no additional configuration is required.

The base path of the API will be `<mgmtContext>/adapter/edrs`
The base path of the API will be `<mgmtContext>/edrs`

This module for now provides three APIs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Path("/adapter/edrs")
@Path("/edrs")
public class AdapterEdrController implements AdapterEdrApi {

private final AdapterTransferProcessService adapterTransferProcessService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
@ApiTest
public class AdapterEdrControllerTest extends RestControllerTestBase {

public static final String ADAPTER_EDR_PATH = "/adapter/edrs";
public static final String ADAPTER_EDR_PATH = "/edrs";
private final JsonLd jsonLdService = new TitaniumJsonLd(monitor);
AdapterTransferProcessService adapterTransferProcessService = mock(AdapterTransferProcessService.class);
TypeTransformerRegistry transformerRegistry = mock(TypeTransformerRegistry.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ public void requestAsset(@Context ContainerRequestContext context, @Suspended As
}

var httpDataAddressResult = extractSourceDataAddress(token, configuration);
HttpDataAddress httpDataAddress = null;
HttpDataAddress httpDataAddress;

if (httpDataAddressResult.succeeded()) {
httpDataAddress = httpDataAddressResult.getContent();
} else {
monitor.debug(join(", ", httpDataAddressResult.getFailureMessages()));
monitor.debug("Request to token validation endpoint failed with errors: " + join(", ", httpDataAddressResult.getFailureMessages()));
response.resume(createMessageResponse(UNAUTHORIZED, "Failed to decode data address", context.getMediaType()));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public String negotiateEdr(Participant other, String assetId, JsonArray callback
var response = baseRequest()
.when()
.body(requestBody)
.post("/adapter/edrs")
.post("/edrs")
.then();

var body = response.extract().body().asString();
Expand Down Expand Up @@ -200,7 +200,7 @@ public String getContractNegotiationError(String negotiationId) {
public JsonObject getEdr(String transferProcessId) {
return baseRequest()
.when()
.get("/adapter/edrs/{id}", transferProcessId)
.get("/edrs/{id}", transferProcessId)
.then()
.statusCode(200)
.extract()
Expand All @@ -211,7 +211,7 @@ public JsonObject getEdr(String transferProcessId) {
public JsonArray getEdrEntriesByAssetId(String assetId) {
return baseRequest()
.when()
.get("/adapter/edrs?assetId={assetId}", assetId)
.get("/edrs?assetId={assetId}", assetId)
.then()
.statusCode(200)
.extract()
Expand All @@ -222,7 +222,7 @@ public JsonArray getEdrEntriesByAssetId(String assetId) {
public JsonArray getEdrEntriesByAgreementId(String agreementId) {
return baseRequest()
.when()
.get("/adapter/edrs?agreementId={agreementId}", agreementId)
.get("/edrs?agreementId={agreementId}", agreementId)
.then()
.statusCode(200)
.extract()
Expand Down
21 changes: 3 additions & 18 deletions resources/openapi/yaml/control-plane-adapter-api.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openapi: 3.0.1
paths:
/adapter/edrs:
/edrs:
get:
description: Returns all EndpointDataReference entry according to a query
operationId: queryEdrs
Expand Down Expand Up @@ -82,7 +82,7 @@ paths:
description: Request body was malformed
tags:
- Control Plane Adapter EDR Api
/adapter/edrs/{id}:
/edrs/{id}:
get:
description: Gets an EDR with the given transfer process ID)
operationId: getEdr
Expand Down Expand Up @@ -139,7 +139,7 @@ components:
example: null
properties:
invalidValue:
type: string
type: object
example: null
message:
type: string
Expand Down Expand Up @@ -196,14 +196,6 @@ components:
example: null
policy:
$ref: '#/components/schemas/Policy'
validity:
type: integer
format: int64
example: null
required:
- assetId
- offerId
- policy
DataAddressDto:
type: object
example: null
Expand All @@ -220,8 +212,6 @@ components:
type: string
example: null
example: null
required:
- properties
Duty:
type: object
example: null
Expand Down Expand Up @@ -334,11 +324,6 @@ components:
providerId:
type: string
example: null
required:
- connectorAddress
- connectorId
- offer
- protocol
Permission:
type: object
example: null
Expand Down

0 comments on commit a6d66c1

Please sign in to comment.