From 490588c541bc5b64375d0232d7ed0d8efba45786 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Tue, 3 Mar 2026 15:43:21 +0100 Subject: [PATCH] chore: bump to edc api v5alpha --- .github/workflows/e2e.yaml | 2 +- .../management/ManagementApiClientImpl.java | 38 +++++++++---------- .../client/management/dto/CelExpression.java | 3 +- .../DataAccessServiceIntegrationTest.java | 6 +-- .../ManagementApiClientIntegrationTest.java | 4 +- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index d47ddbf..a93f9fa 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -103,7 +103,7 @@ jobs: kubectl wait --namespace edc-v \ --selector=type=edcv-job \ --for=condition=complete job --all \ - --timeout=120s + --timeout=300s diff --git a/src/main/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientImpl.java b/src/main/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientImpl.java index 8a130de..15cf78d 100644 --- a/src/main/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientImpl.java +++ b/src/main/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientImpl.java @@ -72,7 +72,7 @@ public void createAsset(String participantContextId, Asset asset) { var token = getToken(participantContextId); controlPlaneWebClient.post() - .uri("/v4alpha/participants/%s/assets".formatted(participantContextId)) + .uri("/v5alpha/participants/%s/assets".formatted(participantContextId)) .header("Authorization", "Bearer %s".formatted(token)) .bodyValue(asset) .retrieve() @@ -83,7 +83,7 @@ public void createAsset(String participantContextId, Asset asset) { @Override public List> queryAssets(String participantContextId, QuerySpec query) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/assets/request", encode(participantContextId)) + .uri("/v5alpha/participants/{participantContextId}/assets/request", encode(participantContextId)) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(query) .retrieve() @@ -95,7 +95,7 @@ public List> queryAssets(String participantContextId, QueryS @Override public void deleteAsset(String participantContextId, String assetId) { controlPlaneWebClient.delete() - .uri("/v4alpha/participants/{participantContextId}/assets/{assetId}", encode(participantContextId), assetId) + .uri("/v5alpha/participants/{participantContextId}/assets/{assetId}", encode(participantContextId), assetId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .toBodilessEntity() @@ -105,7 +105,7 @@ public void deleteAsset(String participantContextId, String assetId) { @Override public void createPolicy(String participantContextId, NewPolicyDefinition policy) { controlPlaneWebClient.post() - .uri("/v4alpha/participants/%s/policydefinitions".formatted(participantContextId)) + .uri("/v5alpha/participants/%s/policydefinitions".formatted(participantContextId)) .header("Authorization", "Bearer %s".formatted(getToken(participantContextId))) .bodyValue(policy) .retrieve() @@ -116,7 +116,7 @@ public void createPolicy(String participantContextId, NewPolicyDefinition policy @Override public List> queryPolicyDefinitions(String participantContextId, QuerySpec query) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/policydefinitions/request", encode(participantContextId)) + .uri("/v5alpha/participants/{participantContextId}/policydefinitions/request", encode(participantContextId)) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(query) .retrieve() @@ -128,7 +128,7 @@ public List> queryPolicyDefinitions(String participantContex @Override public void deletePolicyDefinition(String participantContextId, String policyId) { controlPlaneWebClient.delete() - .uri("/v4alpha/participants/{participantContextId}/policydefinitions/{policyId}", encode(participantContextId), policyId) + .uri("/v5alpha/participants/{participantContextId}/policydefinitions/{policyId}", encode(participantContextId), policyId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .toBodilessEntity() @@ -137,7 +137,7 @@ public void deletePolicyDefinition(String participantContextId, String policyId) public void createContractDefinition(String participantContextId, NewContractDefinition contractDefinition) { controlPlaneWebClient.post() - .uri("/v4alpha/participants/%s/contractdefinitions".formatted(participantContextId)) + .uri("/v5alpha/participants/%s/contractdefinitions".formatted(participantContextId)) .header("Authorization", "Bearer %s".formatted(getToken(participantContextId))) .bodyValue(contractDefinition) .retrieve() @@ -148,7 +148,7 @@ public void createContractDefinition(String participantContextId, NewContractDef @Override public List> queryContractDefinitions(String participantContextId, QuerySpec query) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/contractdefinitions/request", participantContextId) + .uri("/v5alpha/participants/{participantContextId}/contractdefinitions/request", participantContextId) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(query) .retrieve() @@ -160,7 +160,7 @@ public List> queryContractDefinitions(String participantCont @Override public void deleteContractDefinition(String participantContextId, String contractDefinitionId) { controlPlaneWebClient.delete() - .uri("/v4alpha/participants/{participantContextId}/contractdefinitions/{id}", participantContextId, contractDefinitionId) + .uri("/v5alpha/participants/{participantContextId}/contractdefinitions/{id}", participantContextId, contractDefinitionId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .toBodilessEntity() @@ -177,7 +177,7 @@ public String initiateContractNegotiation(String participantContextId, ContractR throw new RuntimeException(e); } var response = controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/contractnegotiations", participantContextId) + .uri("/v5alpha/participants/{participantContextId}/contractnegotiations", participantContextId) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(negotiationRequest) .retrieve() @@ -191,7 +191,7 @@ public String initiateContractNegotiation(String participantContextId, ContractR @Override public ContractNegotiation getContractNegotiation(String participantContextId, String negotiationId) { return controlPlaneWebClient.get() - .uri("/v4alpha/participants/{participantContextId}/contractnegotiations/{id}", participantContextId, negotiationId) + .uri("/v5alpha/participants/{participantContextId}/contractnegotiations/{id}", participantContextId, negotiationId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .bodyToMono(new ParameterizedTypeReference() { @@ -202,7 +202,7 @@ public ContractNegotiation getContractNegotiation(String participantContextId, S @Override public List> queryContractNegotiations(String participantContextId, QuerySpec query) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/contractnegotiations/request", encode(participantContextId)) + .uri("/v5alpha/participants/{participantContextId}/contractnegotiations/request", encode(participantContextId)) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(query) .retrieve() @@ -216,7 +216,7 @@ public void createCelExpression(CelExpression celExpression) { var token = tokenProvider.getToken(adminCredentials.clientId(), adminCredentials.clientSecret(), "management-api:write management-api:read"); controlPlaneWebClient.post() - .uri("/v4alpha/celexpressions") + .uri("/v5alpha/celexpressions") .header("Authorization", "Bearer %s".formatted(token)) .bodyValue(celExpression) .retrieve() @@ -241,7 +241,7 @@ public Map setupTransfer(String participantContextId, String pol @Override public List listTransferProcesses(String participantContextId) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/transferprocesses/request", participantContextId) + .uri("/v5alpha/participants/{participantContextId}/transferprocesses/request", participantContextId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .bodyToMono(new ParameterizedTypeReference>() { @@ -252,7 +252,7 @@ public List listTransferProcesses(String participantContextId) @Override public String initiateTransferProcess(String participantContextId, TransferRequest request) { var response = controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/transferprocesses", participantContextId) + .uri("/v5alpha/participants/{participantContextId}/transferprocesses", participantContextId) .header("Authorization", "Bearer " + getToken(participantContextId)) .bodyValue(request) .retrieve() @@ -266,7 +266,7 @@ public String initiateTransferProcess(String participantContextId, TransferReque @Override public TransferProcess getTransferProcess(String participantContextId, String transferProcessId) { return controlPlaneWebClient.get() - .uri("/v4alpha/participants/{participantContextId}/transferprocesses/{transferProcessId}", participantContextId, transferProcessId) + .uri("/v5alpha/participants/{participantContextId}/transferprocesses/{transferProcessId}", participantContextId, transferProcessId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .bodyToMono(TransferProcess.class) @@ -288,7 +288,7 @@ public Catalog getCatalog(String participantContextId, String counterPartyDid) { @Override public void prepareDataplane(String participantContextId, DataplaneRegistration dataplaneRegistration) { controlPlaneWebClient.post() - .uri("/v4alpha/dataplanes/%s".formatted(participantContextId)) + .uri("/v5alpha/dataplanes/%s".formatted(participantContextId)) .header("Authorization", "Bearer %s".formatted(getToken(participantContextId))) .bodyValue(dataplaneRegistration) .retrieve() @@ -313,7 +313,7 @@ public Object getData(String participantContextId, String counterPartyId, String @Override public List listContracts(String participantContextId) { return controlPlaneWebClient.post() - .uri("/v4alpha/participants/{participantContextId}/contractnegotiations/request", participantContextId) + .uri("/v5alpha/participants/{participantContextId}/contractnegotiations/request", participantContextId) .header("Authorization", "Bearer " + getToken(participantContextId)) .contentType(MediaType.APPLICATION_JSON) .retrieve() @@ -325,7 +325,7 @@ public List listContracts(String participantContextId) { @Override public ContractAgreement getAgreement(String participantContextId, String negotiationId) { return controlPlaneWebClient.get() - .uri("/v4alpha/participants/{participantContextId}/contractnegotiations/{negotiationId}/agreement", participantContextId, negotiationId) + .uri("/v5alpha/participants/{participantContextId}/contractnegotiations/{negotiationId}/agreement", participantContextId, negotiationId) .header("Authorization", "Bearer " + getToken(participantContextId)) .retrieve() .bodyToMono(ContractAgreement.class) diff --git a/src/main/java/com/metaformsystems/redline/infrastructure/client/management/dto/CelExpression.java b/src/main/java/com/metaformsystems/redline/infrastructure/client/management/dto/CelExpression.java index 579cd7a..981e25f 100644 --- a/src/main/java/com/metaformsystems/redline/infrastructure/client/management/dto/CelExpression.java +++ b/src/main/java/com/metaformsystems/redline/infrastructure/client/management/dto/CelExpression.java @@ -21,8 +21,7 @@ public class CelExpression { @JsonProperty("@context") private final String[] context = new String[]{ - "https://w3id.org/edc/connector/management/v2", - "https://w3id.org/edc/virtual-connector/management/v2" + "https://w3id.org/edc/connector/management/v2" }; @JsonProperty("@type") diff --git a/src/test/java/com/metaformsystems/redline/domain/service/DataAccessServiceIntegrationTest.java b/src/test/java/com/metaformsystems/redline/domain/service/DataAccessServiceIntegrationTest.java index 0ab6541..1f5800f 100644 --- a/src/test/java/com/metaformsystems/redline/domain/service/DataAccessServiceIntegrationTest.java +++ b/src/test/java/com/metaformsystems/redline/domain/service/DataAccessServiceIntegrationTest.java @@ -276,11 +276,11 @@ void shouldListContracts() throws InterruptedException { assertThat(result.stream().filter(cn -> cn.getId().equals("negotiation-2")).findFirst().orElseThrow().getContractAgreement()).isNull(); var contractsRequest = mockWebServer.takeRequest(); - assertThat(contractsRequest.getPath()).isEqualTo("/cp/v4alpha/participants/ctx-4/contractnegotiations/request"); + assertThat(contractsRequest.getPath()).isEqualTo("/cp/v5alpha/participants/ctx-4/contractnegotiations/request"); assertThat(contractsRequest.getMethod()).isEqualTo("POST"); var agreementRequest = mockWebServer.takeRequest(); - assertThat(agreementRequest.getPath()).isEqualTo("/cp/v4alpha/participants/ctx-4/contractnegotiations/negotiation-1/agreement"); + assertThat(agreementRequest.getPath()).isEqualTo("/cp/v5alpha/participants/ctx-4/contractnegotiations/negotiation-1/agreement"); assertThat(agreementRequest.getMethod()).isEqualTo("GET"); } @@ -342,7 +342,7 @@ void shouldInitiateContractNegotiation() throws InterruptedException { assertThat(result).isEqualTo("negotiation-123"); var request = mockWebServer.takeRequest(); - assertThat(request.getPath()).isEqualTo("/cp/v4alpha/participants/ctx-6/contractnegotiations"); + assertThat(request.getPath()).isEqualTo("/cp/v5alpha/participants/ctx-6/contractnegotiations"); assertThat(request.getMethod()).isEqualTo("POST"); } diff --git a/src/test/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientIntegrationTest.java b/src/test/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientIntegrationTest.java index ac56f64..4126e00 100644 --- a/src/test/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientIntegrationTest.java +++ b/src/test/java/com/metaformsystems/redline/infrastructure/client/management/ManagementApiClientIntegrationTest.java @@ -438,7 +438,7 @@ void shouldCreateCelExpression() throws InterruptedException { // Assert var celRequest = mockWebServer.takeRequest(); - assertThat(celRequest.getPath()).isEqualTo("/v4alpha/celexpressions"); + assertThat(celRequest.getPath()).isEqualTo("/v5alpha/celexpressions"); assertThat(celRequest.getHeader("Authorization")).isEqualTo("Bearer test-token"); assertThat(celRequest.getBody().readUtf8()).contains("cel-123"); } @@ -462,7 +462,7 @@ void shouldPrepareDataplane() throws InterruptedException { // Assert var dataplaneRequest = mockWebServer.takeRequest(); - assertThat(dataplaneRequest.getPath()).isEqualTo("/v4alpha/dataplanes/" + participantContextId); + assertThat(dataplaneRequest.getPath()).isEqualTo("/v5alpha/dataplanes/" + participantContextId); assertThat(dataplaneRequest.getHeader("Authorization")).isEqualTo("Bearer test-token"); }