Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/chore/docs: SAST, trivy, charts, LEGAL INFO, CHANGELOG #20

4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,32 @@ 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

### Removed

- Previous EDC Control Plane Extensions regarding SPARQL/HTTP transfer

# Unreleased

## [Unreleased]

## [0.8.6] - 2023-05-19
Expand Down
17 changes: 0 additions & 17 deletions COPYRIGHT.md

This file was deleted.

11 changes: 10 additions & 1 deletion agent-plane/agent-plane-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,19 @@
<directory>../../</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>NOTICE.md</include>
<include>LICENSE</include>
<include>DEPENDENCIES</include>
<include>SECURITY.md</include>
<include>NOTICE.md</include>
</includes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>README.md</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>

<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,27 +478,28 @@ private Map.Entry<String,InputStream> 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) {
Expand Down
11 changes: 10 additions & 1 deletion agent-plane/agentplane-azure-vault/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,19 @@
<directory>../../</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>NOTICE.md</include>
<include>LICENSE</include>
<include>DEPENDENCIES</include>
<include>SECURITY.md</include>
<include>NOTICE.md</include>
</includes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>README.md</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>

<plugins>
Expand Down
11 changes: 10 additions & 1 deletion agent-plane/agentplane-hashicorp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,19 @@
<directory>../../</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>NOTICE.md</include>
<include>LICENSE</include>
<include>DEPENDENCIES</include>
<include>SECURITY.md</include>
<include>NOTICE.md</include>
</includes>
</resource>
<resource>
<directory>.</directory>
<includes>
<include>README.md</include>
</includes>
<targetPath>META-INF</targetPath>
</resource>
</resources>

<plugins>
Expand Down