Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/edc-example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ services:
# This is the knowledge directory, facilitating discovery between different
# runtimes. It exposes its service over port 8282.
knowledge-directory:
image: testkd:1.3.3-SNAPSHOT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer necessary so I took the liberty to replace them with the latest snapshot version of the smart connector docker image. Note that this version (1.3.3-SNAPSHOT) is not available and should be build locally.

When the next version of the knowledge engine is released. these should be set to non-snapshot versions.

image: ghcr.io/tno/knowledge-engine/knowledge-directory:1.3.3-SNAPSHOT
networks:
- tke-edc-manager_default

# These services are seperate Knowledge Engine runtime, which can host
# multiple smart connectors. Note that the REST API port is a DIFFERENT port
# number than the ones configured below. It is still the default 8280.
runtime-1:
image: docker.io/library/testsc:1.3.3-SNAPSHOT
image: ghcr.io/tno/knowledge-engine/smart-connector:1.3.3-SNAPSHOT
networks:
- tke-edc-manager_default
environment:
Expand All @@ -28,7 +28,7 @@ services:
depends_on:
- tke-edc-one
runtime-2:
image: docker.io/library/testsc:1.3.3-SNAPSHOT
image: ghcr.io/tno/knowledge-engine/smart-connector:1.3.3-SNAPSHOT
networks:
- tke-edc-manager_default
environment:
Expand All @@ -45,7 +45,7 @@ services:
depends_on:
- tke-edc-two
runtime-3:
image: docker.io/library/testsc:1.3.3-SNAPSHOT
image: ghcr.io/tno/knowledge-engine/smart-connector:1.3.3-SNAPSHOT
networks:
- tke-edc-manager_default
environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package eu.knowledge.engine.smartconnector.edc;

public record EdcConnectorProperties(String participantId, String protocolUrl, String managementUrl, String dataPlaneId,
String dataPlaneControlUrl, String dataPlanePublicUrl, String tkeAssetUrl, String tkeAssetName) {
String dataPlaneControlUrl, String dataPlanePublicUrl, String tokenValidationEndpoint, String tkeAssetUrl, String tkeAssetName) {

public EdcConnectorProperties(String participantId, String protocolUrl) {
this(
Expand All @@ -10,7 +10,8 @@ public EdcConnectorProperties(String participantId, String protocolUrl) {
"",
"tke-dataplane",
"",
"",
"",
"",
"https://www.knowledge-engine.eu/",
"TNO Knowledge Engine Runtime"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import java.util.List;
import java.util.Properties;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.ConfigValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -127,18 +129,9 @@ protected PasswordAuthentication getPasswordAuthentication() {
.setDateFormat(new RFC3339DateFormat());

if (!(this.edcService == null || this.tokenManager == null)) {
String file = "./edc.properties";
Properties properties = new Properties();
FileInputStream configReader;
try {
configReader = new FileInputStream(file);
properties.load(configReader);
configReader.close();
} catch (IOException e) {
e.printStackTrace();
}

this.validationEndpoint = properties.getProperty("tokenValidationEndpoint");
Config config = ConfigProvider.getConfig();
ConfigValue tokenValidationEndpoint = config.getConfigValue(SmartConnectorConfig.CONF_KEY_KE_EDC_TOKEN_VALIDATION_ENDPOINT);
this.validationEndpoint = tokenValidationEndpoint.getValue();
setupTransferProcess();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private List<EdcConnectorProperties> loadConfig() {
ConfigValue managementUrl = config.getConfigValue(SmartConnectorConfig.CONF_KEY_KE_EDC_MANAGEMENT_URL);
ConfigValue dataPlaneControlUrl = config.getConfigValue(SmartConnectorConfig.CONF_KEY_KE_EDC_DATAPLANE_CONTROL_URL);
ConfigValue dataPlanePublicUrl = config.getConfigValue(SmartConnectorConfig.CONF_KEY_KE_EDC_DATAPLANE_PUBLIC_URL);
ConfigValue tokenValidationEndpoint = config.getConfigValue(SmartConnectorConfig.CONF_KEY_KE_EDC_TOKEN_VALIDATION_ENDPOINT);

EdcConnectorProperties props = new EdcConnectorProperties(
this.myExposedUrl.toString(),
Expand All @@ -94,6 +95,7 @@ private List<EdcConnectorProperties> loadConfig() {
"tke-dataplane",
dataPlaneControlUrl.getValue(),
dataPlanePublicUrl.getValue(),
tokenValidationEndpoint.getValue(),
"TNO Knowledge Engine Runtime",
"https://www.knowledge-engine.eu/"
);
Expand Down
Loading