Skip to content

Commit c92f29f

Browse files
authored
Merge pull request #88 from Fraunhofer-AISEC/daps-adaptations
DAPS adaptations
2 parents c846e6c + 44f84ec commit c92f29f

File tree

8 files changed

+39
-20
lines changed

8 files changed

+39
-20
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
java
1717

1818
// Spring Boot
19-
id("org.springframework.boot") version "2.6.1" apply false
19+
id("org.springframework.boot") version "2.5.8" apply false
2020
id("io.spring.dependency-management") version "1.0.11.RELEASE"
2121

2222
// Other needed plugins

examples/etc/settings.mapdb

0 Bytes
Binary file not shown.

examples/etc/settings2.mapdb

0 Bytes
Binary file not shown.

ids-api/src/main/java/de/fhg/aisec/ids/api/settings/ConnectorConfig.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ package de.fhg.aisec.ids.api.settings
2121

2222
import java.io.Serializable
2323

24-
class ConnectorConfig : Serializable {
25-
val appstoreUrl = "https://raw.githubusercontent.com/industrial-data-space/templates/master/templates.json"
26-
val brokerUrl = ""
27-
val ttpHost = ""
28-
val ttpPort = 443
29-
val acmeServerWebcon = ""
30-
val acmeDnsWebcon = ""
31-
val acmePortWebcon = 80
32-
val tosAcceptWebcon = false
33-
val dapsUrl = "https://daps.aisec.fraunhofer.de"
34-
val keystoreName = "provider-keystore.p12"
35-
val keystorePassword = "password"
36-
val keystoreAliasName = "1"
37-
val truststoreName = "truststore.p12"
38-
24+
data class ConnectorConfig(
25+
val appstoreUrl: String = "https://raw.githubusercontent.com/industrial-data-space/templates/master/templates.json",
26+
val brokerUrl: String = "",
27+
val ttpHost: String = "",
28+
val ttpPort: Int = 443,
29+
val acmeServerWebcon: String = "",
30+
val acmeDnsWebcon: String = "",
31+
val acmePortWebcon: Int = 80,
32+
val tosAcceptWebcon: Boolean = false,
33+
val dapsUrl: String = "https://daps.aisec.fraunhofer.de/v2",
34+
val keystoreName: String = "provider-keystore.p12",
35+
val keystorePassword: String = "password",
36+
val keystoreAliasName: String = "1",
37+
val truststoreName: String = "truststore.p12"
38+
) : Serializable {
3939
companion object {
4040
private const val serialVersionUID = 1L
4141
}

ids-connector/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ val copyProjectJars = tasks.create<Copy>("copyProjectJars") {
6767

6868
tasks.withType<Jar> {
6969
enabled = true
70+
// Always execute!
71+
outputs.upToDateWhen { false }
7072
dependsOn(copyLibraryJars)
7173
dependsOn(copyProjectJars)
7274
// Copy the resulting JAR to internal libraries

ids-connector/src/main/kotlin/de/fhg/aisec/ids/ConnectorConfiguration.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ class ConnectorConfiguration {
5555
settings.connectorProfile.maintainerUrl
5656
?: URI.create("http://connector-maintainer.ids")
5757
}
58-
Utils.dapsUrlProducer = { settings.connectorConfig.dapsUrl }
58+
Utils.dapsUrlProducer = {
59+
System.getenv("TC_DAPS_URL")?.also {
60+
TrustedConnector.LOG.info("Found DAPS_URL env var, DAPS URL is overridden with $it")
61+
} ?: settings.connectorConfig.dapsUrl
62+
}
5963
TrustedConnector.LOG.info("Information model {} loaded", BuildConfig.INFOMODEL_VERSION)
6064
Utils.infomodelVersion = BuildConfig.INFOMODEL_VERSION
6165

ids-settings/src/main/kotlin/de/fhg/aisec/ids/settings/SettingsComponent.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ class SettingsComponent : Settings {
8383
settingsStore -= DAT_KEY
8484
dbVersion = 3
8585
}
86+
3 -> {
87+
if (connectorConfig.dapsUrl == "https://daps.aisec.fraunhofer.de") {
88+
connectorConfig.let {
89+
connectorConfig = ConnectorConfig(
90+
it.appstoreUrl, it.brokerUrl, it.ttpHost, it.ttpPort, it.acmeServerWebcon,
91+
it.acmeDnsWebcon, it.acmePortWebcon, it.tosAcceptWebcon,
92+
"https://daps.aisec.fraunhofer.de/v2",
93+
it.keystoreName, it.keystorePassword, it.keystoreAliasName, it.truststoreName
94+
)
95+
}
96+
}
97+
dbVersion = 4
98+
}
8699
}
87100
settingsStore[DB_VERSION_KEY] = dbVersion
88101
mapDB.commit()
@@ -155,7 +168,7 @@ class SettingsComponent : Settings {
155168

156169
companion object {
157170
internal const val DB_VERSION_KEY = "db_version"
158-
internal const val CURRENT_DB_VERSION = 3
171+
internal const val CURRENT_DB_VERSION = 4
159172
internal const val CONNECTOR_SETTINGS_KEY = "main_config"
160173
internal const val CONNECTOR_PROFILE_KEY = "connector_profile"
161174
internal const val CONNECTOR_JSON_LD_KEY = "connector_json_ld"

libraryVersions.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
idscp2: "0.8.1"
1+
idscp2: "0.9.0"
22
ktlint: "0.43.2"
33

44
# Pinning
@@ -68,5 +68,5 @@ auth0Jwt: "3.8.2"
6868
swagger: "1.5.18"
6969
jose4j: "0.7.6"
7070

71-
springBoot: "2.6.1"
71+
springBoot: "2.5.8"
7272
bouncyCastle: "1.68"

0 commit comments

Comments
 (0)