diff --git a/examples/edc-example/docker-compose.yml b/examples/edc-example/docker-compose.yml index a8bea651b..50c9c5663 100644 --- a/examples/edc-example/docker-compose.yml +++ b/examples/edc-example/docker-compose.yml @@ -3,7 +3,7 @@ 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 + image: ghcr.io/tno/knowledge-engine/knowledge-directory:1.3.3-SNAPSHOT networks: - tke-edc-manager_default @@ -11,7 +11,7 @@ services: # 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: @@ -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: @@ -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: diff --git a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/edc/EdcConnectorProperties.java b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/edc/EdcConnectorProperties.java index 40be19b63..07fc7c72d 100644 --- a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/edc/EdcConnectorProperties.java +++ b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/edc/EdcConnectorProperties.java @@ -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( @@ -10,7 +10,8 @@ public EdcConnectorProperties(String participantId, String protocolUrl) { "", "tke-dataplane", "", - "", + "", + "", "https://www.knowledge-engine.eu/", "TNO Knowledge Engine Runtime" ); diff --git a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnection.java b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnection.java index f7c3b0cdc..98f58bf88 100644 --- a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnection.java +++ b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnection.java @@ -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; @@ -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(); } } diff --git a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java index 5189fcade..0c89dd182 100644 --- a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java +++ b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java @@ -86,6 +86,7 @@ private List 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(), @@ -94,6 +95,7 @@ private List loadConfig() { "tke-dataplane", dataPlaneControlUrl.getValue(), dataPlanePublicUrl.getValue(), + tokenValidationEndpoint.getValue(), "TNO Knowledge Engine Runtime", "https://www.knowledge-engine.eu/" );