diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28ed874..1873a5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,6 +115,8 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} + type=raw,value=1.9.5-SNAPSHOT,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Agent Plane Hashicorp Container Build and push uses: docker/build-push-action@v3 @@ -151,6 +153,8 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} + type=raw,value=1.9.5-SNAPSHOT,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Agent Plane Azure Vault Container Build and push uses: docker/build-push-action@v3 diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index bf65e68..9c6e13d 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -86,7 +86,15 @@ jobs: steps: - uses: actions/checkout@v3.5.2 - ## This step will fail if the docker images is not found + # We need to login + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + # Use existing DockerHub credentials present as secrets + username: ${{ secrets.DOCKER_HUB_USER }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + ## This step will fail if the docker images is not found - name: "Check if image exists" id: imageCheck run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index d45be9d..99825b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,21 +24,23 @@ All notable changes to this product will be documented in this file. # Released -# Unreleased - -## [1.9.5-SNAPSHOT] - +## [1.9.5] - ### Added -- Matchmaking Agent: Possibility to invoke Skills as Services +- Matchmaking Agent: Possibility to invoke Skills as Services according to KA-MATCH - Matchmaking Agent: Possibility to steer Delegation through Asset Properties +- Matchmaking Agent: Possibility to allow/deny service requests based on URL pattern +- Transfer: Possibility to annotate assets with service request allow/deny patterns +- Transfer: Implement Skill Protocol of KA-TRANSFER +- Federated Data Catalogue: Embedding Shapes Properties as Named Graphs - Skill Store: Implementation using EDC Control Plane/Asset Catalogue ### Changed - Adapted all Catena-X namespaces to https://w3id.org/catenax -- Adapted to Tractus-X EDC 0.4 and the v2 Management API - Adapted to Tractus-X EDC 0.5 and the changed EDR callback +- Adapted to Tractus-X EDC 0.4 and the v2 Management and Catalogue APIs - Upgraded to the latest possible version of dependent libraries - Eclipse Tractus-X standards and migration @@ -46,6 +48,8 @@ All notable changes to this product will be documented in this file. - Previous EDC Control Plane Extensions regarding SPARQL/HTTP transfer +# Unreleased + ## [Unreleased] ## [0.8.6] - 2023-05-19 diff --git a/COPYRIGHT.md b/COPYRIGHT.md deleted file mode 100644 index 1ba4f23..0000000 --- a/COPYRIGHT.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# Copyright Notice - -All artifacts in this repository are (C) 2022-2023 Catena-X Association and others. - -For more information on the contributors see [authors file](AUTHORS.md). \ No newline at end of file diff --git a/agent-plane/agent-plane-protocol/pom.xml b/agent-plane/agent-plane-protocol/pom.xml index ce078dd..d0348fb 100644 --- a/agent-plane/agent-plane-protocol/pom.xml +++ b/agent-plane/agent-plane-protocol/pom.xml @@ -59,10 +59,19 @@ ../../ META-INF - NOTICE.md LICENSE + DEPENDENCIES + SECURITY.md + NOTICE.md + + . + + README.md + + META-INF + diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/AgentController.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/AgentController.java index 474cb99..0947a7b 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/AgentController.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/AgentController.java @@ -304,8 +304,9 @@ public String getRestRepositories( @Context UriInfo uri ) { monitor.debug(String.format("Received a GET Rest Repositories request %s",request)); - String url=uri.toString(); + String url=uri.getAbsolutePath().toString(); url=url.substring(0,url.length()-18); + url=HttpUtils.urlEncode(url); return "[\n" + " {\n" + " \"id\": \"AGENT\",\n" + @@ -337,8 +338,9 @@ public Response getRepositories( @Context UriInfo uri ) { monitor.debug(String.format("Received a GET Repositories request %s",request)); - String url=uri.toString(); + String url=uri.getAbsolutePath().toString(); url=url.substring(0,url.length()-13); + url=HttpUtils.urlEncode(url); Response.ResponseBuilder builder=Response.ok("uri,id,title,readable,writable\n"+url+",AGENT,Catena-X Knowledge Agent Dataspace Endpoint,true,true\n"); builder.type("text/csv;charset=UTF-8"); builder.header("Content-Disposition","attachment; filename=repositories.csv"); diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/HttpUtils.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/HttpUtils.java index 666d582..8a9feda 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/HttpUtils.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/http/HttpUtils.java @@ -34,6 +34,21 @@ public class HttpUtils { /** * ensure that the given parameter string is correctly * encoded + * @param pattern maybe undecoded patterm + * @return a url encoded string + */ + public static String urlEncode(String pattern) { + try { + return URLEncoder.encode(pattern,DEFAULT_ENCODING); + } catch(UnsupportedEncodingException e) { + // this should never happen + return pattern; + } + } + + /** + * ensure that the given parameter string is correctly + * encoded * TODO optimize * @param parameter maybe undecoded parameter * @return a url encoded string which additionally encodes some URL-prefix related symbols @@ -42,7 +57,7 @@ public static String urlEncodeParameter(String parameter) { if(parameter==null || parameter.length()==0) return ""; try { parameter = urlDecodeParameter(parameter); - return encodeParameter(URLEncoder.encode(parameter, DEFAULT_ENCODING)); + return encodeParameter(urlEncode(parameter)); } catch(UnsupportedEncodingException e) { // this should never happen return parameter; diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/sparql/QueryExecutor.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/sparql/QueryExecutor.java index c2dc840..f3a839b 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/sparql/QueryExecutor.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/sparql/QueryExecutor.java @@ -478,27 +478,28 @@ private Map.Entry executeQuery(HttpRequest request) { } StringBuilder nextPart=null; String embeddedContentType=null; - BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream)); - for(String line = reader.readLine(); line!=null; line=reader.readLine()) { - if(boundary.equals(line)) { - if(nextPart!=null && embeddedContentType!=null) { - if(embeddedContentType.equals("application/cx-warnings+json")) { - warnings=Optional.of(nextPart.toString()); + try (BufferedReader reader=new BufferedReader(new InputStreamReader(inputStream))) { + for(String line = reader.readLine(); line!=null; line=reader.readLine()) { + if(boundary.equals(line)) { + if(nextPart!=null && embeddedContentType!=null) { + if(embeddedContentType.equals("application/cx-warnings+json")) { + warnings=Optional.of(nextPart.toString()); + } else { + inputStream=new ByteArrayInputStream(nextPart.toString().getBytes()); + contentType=embeddedContentType; + } + } + nextPart=new StringBuilder(); + String contentLine=reader.readLine(); + if(contentLine!=null && contentLine.startsWith("Content-Type: ")) { + embeddedContentType=contentLine.substring(14); } else { - inputStream=new ByteArrayInputStream(nextPart.toString().getBytes()); - contentType=embeddedContentType; + embeddedContentType=null; } + } else if(nextPart!=null) { + nextPart.append(line); + nextPart.append("\n"); } - nextPart=new StringBuilder(); - String contentLine=reader.readLine(); - if(contentLine!=null && contentLine.startsWith("Content-Type: ")) { - embeddedContentType=contentLine.substring(14); - } else { - embeddedContentType=null; - } - } else if(nextPart!=null) { - nextPart.append(line); - nextPart.append("\n"); } } if(nextPart!=null && embeddedContentType!=null) { diff --git a/agent-plane/agentplane-azure-vault/pom.xml b/agent-plane/agentplane-azure-vault/pom.xml index a95f538..1b947f9 100644 --- a/agent-plane/agentplane-azure-vault/pom.xml +++ b/agent-plane/agentplane-azure-vault/pom.xml @@ -59,10 +59,19 @@ ../../ META-INF - NOTICE.md LICENSE + DEPENDENCIES + SECURITY.md + NOTICE.md + + . + + README.md + + META-INF + diff --git a/agent-plane/agentplane-hashicorp/pom.xml b/agent-plane/agentplane-hashicorp/pom.xml index 7d1c2ae..77d7827 100644 --- a/agent-plane/agentplane-hashicorp/pom.xml +++ b/agent-plane/agentplane-hashicorp/pom.xml @@ -59,10 +59,19 @@ ../../ META-INF - NOTICE.md LICENSE + DEPENDENCIES + SECURITY.md + NOTICE.md + + . + + README.md + + META-INF +