From 98df0a1492a2a743dd3b8ae572db0c492ab61a71 Mon Sep 17 00:00:00 2001 From: Enrico Risa Date: Wed, 16 Nov 2022 17:59:43 +0100 Subject: [PATCH] refactor(buid): apply the edc build plugin and the version catalog --- build.gradle.kts | 202 +++--------------- client-cli/build.gradle.kts | 29 +-- core/identity-hub-client/build.gradle.kts | 27 +-- core/identity-hub/build.gradle.kts | 17 +- extensions/identity-hub-api/build.gradle.kts | 25 +-- .../api/IdentityHubApiExtension.java | 4 +- .../identity-hub-verifier/build.gradle.kts | 25 +-- .../identity-hub-store-sql/build.gradle.kts | 25 +-- gradle.properties | 18 +- launcher/build.gradle.kts | 9 +- resources/openapi/yaml/identity-hub-api.yaml | 186 +++++++++------- settings.gradle.kts | 52 +++++ spi/identity-hub-client-spi/build.gradle.kts | 12 +- spi/identity-hub-spi/build.gradle.kts | 30 +-- spi/identity-hub-store-spi/build.gradle.kts | 22 +- system-tests/build.gradle.kts | 32 +-- 16 files changed, 266 insertions(+), 449 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 107129f9c..b43acfeaf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,188 +13,71 @@ */ plugins { - java `java-library` - signing - `maven-publish` - checkstyle - id("org.gradle.crypto.checksum") version "1.4.0" - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" - jacoco } -repositories { - mavenCentral() -} - -val projectGroup: String by project -val swagger: String by project -val rsApi: String by project -// these values are required for the project POM (for publishing) val edcDeveloperId: String by project val edcDeveloperName: String by project val edcDeveloperEmail: String by project val edcScmConnection: String by project val edcWebsiteUrl: String by project val edcScmUrl: String by project +val edcGroup: String by project +val annotationProcessorVersion: String by project +val metaModelVersion: String by project +val javaVersion: String by project val defaultVersion: String by project // makes the project version overridable using the "-PidentityHubVersion..." flag. Useful for CI builds -val projectVersion: String = (project.findProperty("identityHubVersion") ?: defaultVersion) as String - -var deployUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - -if (projectVersion.contains("SNAPSHOT")) { - deployUrl = "https://oss.sonatype.org/content/repositories/snapshots/" -} +val actualVersion: String = (project.findProperty("identityHubVersion") ?: defaultVersion) as String -subprojects { - afterEvaluate { - publishing { - publications.forEach { i -> - val mp = (i as MavenPublication) - mp.pom { - name.set(project.name) - description.set("edc :: ${project.name}") - url.set(edcWebsiteUrl) - - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - developers { - developer { - id.set(edcDeveloperId) - name.set(edcDeveloperName) - email.set(edcDeveloperEmail) - } - } - scm { - connection.set(edcScmConnection) - url.set(edcScmUrl) - } - } - } - } - } +buildscript { + dependencies { + val edcGradlePluginsVersion: String by project + classpath("org.eclipse.edc.edc-build:org.eclipse.edc.edc-build.gradle.plugin:${edcGradlePluginsVersion}") } } -allprojects { - apply(plugin = "maven-publish") - apply(plugin = "checkstyle") - apply(plugin = "java") - - version = projectVersion - group = projectGroup - - checkstyle { - toolVersion = "9.0" - configFile = rootProject.file("resources/checkstyle-config.xml") - configDirectory.set(rootProject.file("resources")) - maxErrors = 0 // does not tolerate errors - } +allprojects { + apply(plugin = "${edcGroup}.edc-build") - repositories { - mavenCentral() - mavenLocal() - maven { - url = uri("https://maven.iais.fraunhofer.de/artifactory/eis-ids-public/") - } - maven { - url = uri("https://oss.sonatype.org/content/repositories/snapshots/") - } + // configure which version of the annotation processor to use. defaults to the same version as the plugin + configure { + processorVersion.set(annotationProcessorVersion) + outputDirectory.set(project.buildDir) } - pluginManager.withPlugin("io.swagger.core.v3.swagger-gradle-plugin") { + configure { + versions { + // override default dependency versions here + projectVersion.set(actualVersion) + metaModel.set(metaModelVersion) - dependencies { - // this is used to scan the classpath and generate an openapi yaml file - implementation("io.swagger.core.v3:swagger-jaxrs2-jakarta:${swagger}") - implementation("jakarta.ws.rs:jakarta.ws.rs-api:${rsApi}") } - // this is used to scan the classpath and generate an openapi yaml file - tasks.withType { - outputFileName = project.name - outputFormat = io.swagger.v3.plugins.gradle.tasks.ResolveTask.Format.YAML - prettyPrint = true - classpath = java.sourceSets["main"].runtimeClasspath - buildClasspath = classpath - resourcePackages = setOf("org.eclipse.edc") - outputDir = file("${rootProject.projectDir.path}/resources/openapi/yaml") + pom { + projectName.set(project.name) + description.set("edc :: ${project.name}") + projectUrl.set(edcWebsiteUrl) + scmConnection.set(edcScmConnection) + scmUrl.set(edcScmUrl) } - configurations { - all { - exclude(group = "com.fasterxml.jackson.jaxrs", module = "jackson-jaxrs-json-provider") - } + swagger { + title.set("Identity HUB REST API") + description = "Identity HUB REST APIs - merged by OpenApiMerger" + outputFilename.set(project.name) + outputDirectory.set(file("${rootProject.projectDir.path}/resources/openapi/yaml")) } + javaLanguageVersion.set(JavaLanguageVersion.of(javaVersion)) } - pluginManager.withPlugin("java-library") { - if (!project.hasProperty("skip.signing")) { - - apply(plugin = "signing") - publishing { - repositories { - maven { - name = "OSSRH" - setUrl(deployUrl) - credentials { - username = System.getenv("OSSRH_USER") ?: return@credentials - password = System.getenv("OSSRH_PASSWORD") ?: return@credentials - } - } - } - - signing { - useGpgCmd() - sign(publishing.publications) - } - } - } + configure { + configFile = rootProject.file("resources/checkstyle-config.xml") + configDirectory.set(rootProject.file("resources")) } - tasks.test { - // Target all type of test e.g. -DrunAllTests="true" - val runAllTests: String = System.getProperty("runAllTests", "false") - if (runAllTests == "true") { - useJUnitPlatform() - } else { - // Target specific set of tests by specifying junit tags on command-line e.g. -DincludeTags="tag-name1,tag-name2" - val includeTagProperty = System.getProperty("includeTags") - val includeTags: Array = includeTagProperty?.split(",")?.toTypedArray() ?: emptyArray() - - if (includeTags.isNotEmpty()) { - useJUnitPlatform { - includeTags(*includeTags) - } - } else { - useJUnitPlatform { - excludeTags("IntegrationTest") - } - } - } - testLogging { - showStandardStreams = true - } - } - - if (System.getenv("JACOCO") == "true") { - apply(plugin = "jacoco") - tasks.test { - finalizedBy(tasks.jacocoTestReport) - } - tasks.jacocoTestReport { - reports { - // Generate XML report for codecov.io - xml.required.set(true) - } - } - } // EdcRuntimeExtension uses this to determine the runtime classpath of the module to run. tasks.register("printClasspath") { @@ -204,19 +87,4 @@ allprojects { } } -buildscript { - dependencies { - classpath("io.swagger.core.v3:swagger-gradle-plugin:2.1.13") - } -} -nexusPublishing { - repositories { - sonatype { - nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) - username.set(System.getenv("OSSRH_USER") ?: return@sonatype) - password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype) - } - } -} diff --git a/client-cli/build.gradle.kts b/client-cli/build.gradle.kts index d01bef52c..b8bcc578f 100644 --- a/client-cli/build.gradle.kts +++ b/client-cli/build.gradle.kts @@ -5,31 +5,16 @@ plugins { `maven-publish` } -val edcGroup: String by project -val edcVersion: String by project -val jacksonVersion: String by project -val jupiterVersion: String by project -val assertj: String by project -val mockitoVersion: String by project -val okHttpVersion: String by project -val nimbusVersion: String by project -val bouncycastleVersion: String by project -val picoCliVersion: String by project - dependencies { - api("info.picocli:picocli:${picoCliVersion}") - annotationProcessor("info.picocli:picocli-codegen:${picoCliVersion}") + api(libs.picocli.core) + annotationProcessor(libs.picocli.codegen) implementation(project(":core:identity-hub-client")) - implementation("${edcGroup}:identity-did-spi:${edcVersion}") - implementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") - implementation("com.squareup.okhttp3:okhttp:${okHttpVersion}") - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - implementation("org.bouncycastle:bcpkix-jdk15on:${bouncycastleVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") + implementation(edc.spi.identity.did) + implementation(libs.jackson.databind) + implementation(libs.okhttp) + implementation(libs.nimbus.jwt) + implementation(libs.bouncycastle.bcpkix.jdk15on) } repositories { mavenCentral() diff --git a/core/identity-hub-client/build.gradle.kts b/core/identity-hub-client/build.gradle.kts index 9b566008c..289eb48af 100644 --- a/core/identity-hub-client/build.gradle.kts +++ b/core/identity-hub-client/build.gradle.kts @@ -17,33 +17,20 @@ plugins { `maven-publish` } -val jacksonVersion: String by project -val okHttpVersion: String by project -val edcVersion: String by project -val edcGroup: String by project -val jupiterVersion: String by project -val assertj: String by project -val nimbusVersion: String by project -val mockitoVersion: String by project - dependencies { api(project(":spi:identity-hub-spi")) api(project(":spi:identity-hub-client-spi")) - api("${edcGroup}:core-spi:${edcVersion}") - implementation("${edcGroup}:http:${edcVersion}") - implementation("com.squareup.okhttp3:okhttp:${okHttpVersion}") - implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") - implementation("${edcGroup}:core-spi:${edcVersion}") - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") + api(edc.spi.core) + implementation(edc.ext.http) + implementation(libs.okhttp) + implementation(libs.jackson.databind) + implementation(edc.spi.core) + implementation(libs.nimbus.jwt) testImplementation(project(":core:identity-hub")) testImplementation(project(":extensions:identity-hub-api")) testImplementation(testFixtures(project(":spi:identity-hub-spi"))) - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") + testImplementation(edc.core.junit) } publishing { diff --git a/core/identity-hub/build.gradle.kts b/core/identity-hub/build.gradle.kts index 895896745..0789a414e 100644 --- a/core/identity-hub/build.gradle.kts +++ b/core/identity-hub/build.gradle.kts @@ -16,25 +16,14 @@ plugins { `java-library` `maven-publish` } -val assertj: String by project -val edcVersion: String by project -val edcGroup: String by project -val jupiterVersion: String by project -val nimbusVersion: String by project -val mockitoVersion: String by project dependencies { api(project(":spi:identity-hub-spi")) implementation(project(":spi:identity-hub-store-spi")) - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - implementation("${edcGroup}:transaction-spi:${edcVersion}") + implementation(libs.nimbus.jwt) + implementation(edc.spi.transaction) - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") + testImplementation(edc.core.junit) testImplementation(testFixtures(project(":spi:identity-hub-spi"))) testImplementation(testFixtures(project(":spi:identity-hub-store-spi"))) } diff --git a/extensions/identity-hub-api/build.gradle.kts b/extensions/identity-hub-api/build.gradle.kts index fa33a9257..b29dd4efc 100644 --- a/extensions/identity-hub-api/build.gradle.kts +++ b/extensions/identity-hub-api/build.gradle.kts @@ -18,32 +18,19 @@ plugins { `maven-publish` } -val edcVersion: String by project -val edcGroup: String by project -val jupiterVersion: String by project -val restAssured: String by project -val mockitoVersion: String by project -val assertj: String by project -val nimbusVersion: String by project - dependencies { api(project(":spi:identity-hub-spi")) implementation(project(":spi:identity-hub-store-spi")) implementation(project(":core:identity-hub")) - implementation("${edcGroup}:http:${edcVersion}") - implementation("${edcGroup}:transaction-spi:${edcVersion}") - + implementation(edc.ext.http) + implementation(edc.spi.transaction) - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") - testImplementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("io.rest-assured:rest-assured:${restAssured}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") + testImplementation(edc.core.junit) + testImplementation(libs.nimbus.jwt) + testImplementation(libs.restAssured) testImplementation(project(":spi:identity-hub-spi")) + testImplementation(testFixtures(project(":spi:identity-hub-spi"))) testImplementation(testFixtures(project(":spi:identity-hub-store-spi"))) } diff --git a/extensions/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/IdentityHubApiExtension.java b/extensions/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/IdentityHubApiExtension.java index b2094b826..fcfaaffee 100644 --- a/extensions/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/IdentityHubApiExtension.java +++ b/extensions/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/IdentityHubApiExtension.java @@ -17,9 +17,9 @@ import org.eclipse.edc.identityhub.api.controller.IdentityHubController; import org.eclipse.edc.identityhub.selfdescription.SelfDescriptionLoader; import org.eclipse.edc.identityhub.spi.processor.MessageProcessorRegistry; -import org.eclipse.edc.runtime.metamodel.annotation.EdcSetting; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; +import org.eclipse.edc.runtime.metamodel.annotation.Setting; import org.eclipse.edc.spi.system.ServiceExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.transaction.spi.TransactionContext; @@ -34,7 +34,7 @@ public class IdentityHubApiExtension implements ServiceExtension { public static final String NAME = "Identity Hub API"; - @EdcSetting + @Setting private static final String SELF_DESCRIPTION_DOCUMENT_PATH_SETTING = "edc.self.description.document.path"; private static final String DEFAULT_SELF_DESCRIPTION_FILE_NAME = "default-self-description.json"; @Inject diff --git a/extensions/identity-hub-verifier/build.gradle.kts b/extensions/identity-hub-verifier/build.gradle.kts index 9d5d47ef5..967cf75e7 100644 --- a/extensions/identity-hub-verifier/build.gradle.kts +++ b/extensions/identity-hub-verifier/build.gradle.kts @@ -16,32 +16,21 @@ plugins { `java-library` } -val edcVersion: String by project -val edcGroup: String by project -val jupiterVersion: String by project -val nimbusVersion: String by project -val okHttpVersion: String by project -val mockitoVersion: String by project -val assertj: String by project dependencies { implementation(project(":core:identity-hub")) implementation(project(":core:identity-hub-client")) implementation(project(":spi:identity-hub-spi")) - implementation("${edcGroup}:connector-core:${edcVersion}") - implementation("${edcGroup}:boot:${edcVersion}") - implementation("${edcGroup}:identity-did-spi:${edcVersion}") - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - implementation("com.squareup.okhttp3:okhttp:${okHttpVersion}") + + implementation(edc.spi.identity.did) + implementation(libs.nimbus.jwt) + implementation(libs.okhttp) + testImplementation(testFixtures(project(":spi:identity-hub-spi"))) - testImplementation("org.assertj:assertj-core:${assertj}") testImplementation(project(":extensions:identity-hub-api")) - testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("${edcGroup}:identity-did-core:${edcVersion}") - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") + testImplementation(edc.core.identity.did) + testImplementation(edc.core.junit) } publishing { diff --git a/extensions/store/sql/identity-hub-store-sql/build.gradle.kts b/extensions/store/sql/identity-hub-store-sql/build.gradle.kts index 5a1b5f758..57bcaf903 100644 --- a/extensions/store/sql/identity-hub-store-sql/build.gradle.kts +++ b/extensions/store/sql/identity-hub-store-sql/build.gradle.kts @@ -2,29 +2,16 @@ plugins { `java-library` } -val edcVersion: String by project -val edcGroup: String by project -val assertj: String by project -val jupiterVersion: String by project -val mockitoVersion: String by project -val postgresVersion: String by project - - dependencies { api(project(":spi:identity-hub-store-spi")) - implementation("${edcGroup}:transaction-spi:${edcVersion}") - implementation("${edcGroup}:transaction-datasource-spi:${edcVersion}") - implementation("${edcGroup}:sql-core:${edcVersion}") + implementation(edc.spi.transaction) + implementation(edc.spi.transaction.datasource) + implementation(edc.core.sql) - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("${edcGroup}:sql-core:${edcVersion}:test-fixtures") + testImplementation(edc.core.junit) + testImplementation(testFixtures(edc.core.sql)) testImplementation(testFixtures(project(":spi:identity-hub-store-spi"))) - testImplementation("org.postgresql:postgresql:${postgresVersion}") + testImplementation(libs.postgres) } publishing { diff --git a/gradle.properties b/gradle.properties index a2158734c..a1b9ce730 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,23 +1,13 @@ projectGroup=org.eclipse.edc +javaVersion=11 # defaultVersion is used when "-PidentityHubVersion...." is no supplied. Should always be equal to edcVersion! defaultVersion=0.0.1-SNAPSHOT edcGroup=org.eclipse.edc edcVersion=0.0.1-20221113-SNAPSHOT -assertj=3.23.1 -jupiterVersion=5.9.0 -storageBlobVersion=12.11.0 -mockitoVersion=4.8.0 -awaitility=4.1.1 -rsApi=3.1.0 +edcGradlePluginsVersion=0.0.1-SNAPSHOT +annotationProcessorVersion=0.0.1-SNAPSHOT +metaModelVersion=0.0.1-SNAPSHOT swagger=2.1.13 -jacksonVersion=2.13.4 -restAssured=4.5.0 -okHttpVersion=4.10.0 -jetBrainsAnnotationsVersion=15.0 -nimbusVersion=8.23 -bouncycastleVersion=1.70 -picoCliVersion=4.6.3 -postgresVersion=42.4.0 # information required for publishing artifacts: edcDeveloperId=mspiekermann edcDeveloperName=Markus Spiekermann diff --git a/launcher/build.gradle.kts b/launcher/build.gradle.kts index 26b694db5..dc1c8eab4 100644 --- a/launcher/build.gradle.kts +++ b/launcher/build.gradle.kts @@ -18,16 +18,13 @@ plugins { id("com.github.johnrengelman.shadow") version "7.0.0" } -val edcVersion: String by project -val edcGroup: String by project - dependencies { implementation(project(":core:identity-hub")) implementation(project(":extensions:identity-hub-api")) implementation(project(":extensions:identity-hub-verifier")) - implementation("${edcGroup}:api-observability:${edcVersion}") - implementation("${edcGroup}:identity-did-core:${edcVersion}") - implementation("${edcGroup}:identity-did-web:${edcVersion}") + implementation(edc.ext.observability) + implementation(edc.ext.identity.did.core) + implementation(edc.ext.identity.did.web) } application { diff --git a/resources/openapi/yaml/identity-hub-api.yaml b/resources/openapi/yaml/identity-hub-api.yaml index bd301536b..21d6fdff2 100644 --- a/resources/openapi/yaml/identity-hub-api.yaml +++ b/resources/openapi/yaml/identity-hub-api.yaml @@ -3,24 +3,8 @@ info: title: Eclipse Dataspace Connector Identity Hub version: 0.0.1 paths: - /identity-hub/self-description: - get: - tags: - - IdentityHub - description: Serve Self-Description document as defined in Gaia-X Trust Framework - (https://gaia-x.gitlab.io/policy-rules-committee/trust-framework/) - operationId: getSelfDescription - responses: - default: - description: default response - content: - application/json: - schema: - $ref: '#/components/schemas/JsonNode' /identity-hub: post: - tags: - - IdentityHub description: A Decentralized Web Node (https://identity.foundation/decentralized-web-node/spec) compatible endpoint supporting operations to read and write Verifiable Credentials into an Identity Hub @@ -32,114 +16,158 @@ paths: $ref: '#/components/schemas/RequestObject' responses: default: - description: default response content: application/json: schema: $ref: '#/components/schemas/ResponseObject' + description: default response + tags: + - IdentityHub + /identity-hub/self-description: + get: + description: Serve Self-Description document as defined in Gaia-X Trust Framework + (https://gaia-x.gitlab.io/policy-rules-committee/trust-framework/) + operationId: getSelfDescription + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/JsonNode' + description: default response + tags: + - IdentityHub components: schemas: + Descriptor: + type: object + example: null + properties: + dataCid: + type: string + description: "[UNSUPPORTED] If data is available, this field should contain\ + \ stringified Version 1 CID of the DAG PB encoded data" + example: null + dataFormat: + type: string + description: "[UNSUPPORTED] if data is available, this field should contain\ + \ a registered IANA Media Type data format. Use 'application/vc+ldp' for\ + \ Verifiable Credentials." + example: null + dateCreated: + type: integer + format: int64 + description: Unix epoch timestamp interpreted as the time the logical entry + was created by the DID owner or another permitted party + example: null + method: + type: string + description: A string that matches a Decentralized Web Node Interface method + example: null + nonce: + type: string + description: "[UNSUPPORTED] Cryptographically random string that ensures\ + \ each object is unique" + example: null + recordId: + type: string + description: Unique identifier of the record + example: null JsonNode: type: object + example: null + MessageRequestObject: + type: object + example: null + properties: + data: + type: array + description: Optional base64Url encoded string of the message data + example: null + items: + type: string + format: byte + description: Optional base64Url encoded string of the message data + example: null + descriptor: + $ref: '#/components/schemas/Descriptor' MessageResponseObject: type: object + example: null properties: - messageId: - type: string - description: "[UNSUPPORTED] Stringified Version 1 CID of the associated\ - \ message" - status: - $ref: '#/components/schemas/MessageStatus' entries: type: array description: Resulting message entries returned from the invocation of the corresponding message as free form objects + example: null items: type: object description: Resulting message entries returned from the invocation of the corresponding message as free form objects + example: null + messageId: + type: string + description: "[UNSUPPORTED] Stringified Version 1 CID of the associated\ + \ message" + example: null + status: + $ref: '#/components/schemas/MessageStatus' MessageStatus: type: object + example: null properties: code: type: integer + format: int32 description: An integer set to the HTTP Status Code appropriate for the status of the response - format: int32 + example: null detail: type: string description: A string that describes a terse summary of the status + example: null + RequestObject: + type: object + example: null + properties: + messages: + type: array + example: null + items: + $ref: '#/components/schemas/MessageRequestObject' + requestId: + type: string + example: null + target: + type: string + description: "[UNSUPPORTED] Decentralized Identifier base URI of the DID-relative\ + \ URL" + example: null RequestStatus: type: object + example: null properties: code: type: integer + format: int32 description: An integer set to the HTTP Status Code appropriate for the status of the response - format: int32 + example: null detail: type: string description: A string that describes a terse summary of the status + example: null ResponseObject: type: object + example: null properties: - requestId: - type: string - status: - $ref: '#/components/schemas/RequestStatus' replies: type: array + example: null items: $ref: '#/components/schemas/MessageResponseObject' - Descriptor: - type: object - properties: - method: - type: string - description: A string that matches a Decentralized Web Node Interface method - nonce: - type: string - description: "[UNSUPPORTED] Cryptographically random string that ensures\ - \ each object is unique" - dateCreated: - type: integer - description: Unix epoch timestamp interpreted as the time the logical entry - was created by the DID owner or another permitted party - format: int64 - recordId: - type: string - description: Unique identifier of the record - dataCid: - type: string - description: "[UNSUPPORTED] If data is available, this field should contain\ - \ stringified Version 1 CID of the DAG PB encoded data" - dataFormat: - type: string - description: "[UNSUPPORTED] if data is available, this field should contain\ - \ a registered IANA Media Type data format. Use 'application/vc+ldp' for\ - \ Verifiable Credentials." - MessageRequestObject: - type: object - properties: - descriptor: - $ref: '#/components/schemas/Descriptor' - data: - type: array - description: Optional base64Url encoded string of the message data - items: - type: string - description: Optional base64Url encoded string of the message data - format: byte - RequestObject: - type: object - properties: requestId: type: string - target: - type: string - description: "[UNSUPPORTED] Decentralized Identifier base URI of the DID-relative\ - \ URL" - messages: - type: array - items: - $ref: '#/components/schemas/MessageRequestObject' + example: null + status: + $ref: '#/components/schemas/RequestStatus' diff --git a/settings.gradle.kts b/settings.gradle.kts index ca0fa4d79..233b28195 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,57 @@ rootProject.name = "identity-hub" + +// this is needed to have access to snapshot builds of plugins +pluginManagement { + repositories { + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } + mavenCentral() + mavenLocal() + } + versionCatalogs { + create("libs") { + from("org.eclipse.edc:edc-versions:0.0.1-SNAPSHOT") + version("picocli", "4.6.3") + version("bouncycastle", "1.70") + + library("picocli-core", "info.picocli", "picocli").versionRef("picocli") + library("picocli-codegen", "info.picocli", "picocli-codegen").versionRef("picocli") + library("bouncycastle-bcpkix-jdk15on", "org.bouncycastle", "bcpkix-jdk15on").versionRef("bouncycastle") + + + } + create("edc") { + version("edc", "0.0.1-SNAPSHOT") + library("spi-core", "org.eclipse.edc", "core-spi").versionRef("edc") + library("spi-transaction", "org.eclipse.edc", "transaction-spi").versionRef("edc") + library("spi-transaction-datasource", "org.eclipse.edc", "transaction-datasource-spi").versionRef("edc") + library("spi-identity-did", "org.eclipse.edc", "identity-did-spi").versionRef("edc") + library("core-connector", "org.eclipse.edc", "connector-core").versionRef("edc") + library("core-sql", "org.eclipse.edc", "sql-core").versionRef("edc") + library("core-identity-did", "org.eclipse.edc", "identity-did-core").versionRef("edc") + library("core-junit", "org.eclipse.edc", "junit").versionRef("edc") + library("ext-identity-did-crypto", "org.eclipse.edc", "identity-did-crypto").versionRef("edc") + library("ext-identity-did-core", "org.eclipse.edc", "identity-did-core").versionRef("edc") + library("ext-identity-did-web", "org.eclipse.edc", "identity-did-web").versionRef("edc") + library("ext-http", "org.eclipse.edc", "http").versionRef("edc") + library("ext-observability", "org.eclipse.edc", "api-observability").versionRef("edc") + + } + } +} + include(":spi:identity-hub-spi") include(":spi:identity-hub-store-spi") include(":spi:identity-hub-client-spi") diff --git a/spi/identity-hub-client-spi/build.gradle.kts b/spi/identity-hub-client-spi/build.gradle.kts index a92a33f8b..5ff22f33a 100644 --- a/spi/identity-hub-client-spi/build.gradle.kts +++ b/spi/identity-hub-client-spi/build.gradle.kts @@ -18,17 +18,9 @@ plugins { `maven-publish` } - -val edcVersion: String by project -val edcGroup: String by project -val nimbusVersion: String by project - - dependencies { - - - implementation("${edcGroup}:core-spi:${edcVersion}") - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") + api(edc.spi.core) + implementation(libs.nimbus.jwt) } diff --git a/spi/identity-hub-spi/build.gradle.kts b/spi/identity-hub-spi/build.gradle.kts index b98c0c0fe..db2492092 100644 --- a/spi/identity-hub-spi/build.gradle.kts +++ b/spi/identity-hub-spi/build.gradle.kts @@ -18,33 +18,23 @@ plugins { `maven-publish` } -val jetBrainsAnnotationsVersion: String by project -val jacksonVersion: String by project -val nimbusVersion: String by project -val edcGroup: String by project -val edcVersion: String by project -val jupiterVersion: String by project -val assertj: String by project -val mockitoVersion: String by project val swagger: String by project dependencies { - api("org.jetbrains:annotations:${jetBrainsAnnotationsVersion}") - implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") - implementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - implementation("${edcGroup}:identity-did-spi:${edcVersion}") - implementation("${edcGroup}:identity-did-crypto:${edcVersion}") + + implementation(libs.jackson.databind) + implementation(libs.nimbus.jwt) + implementation(edc.spi.identity.did) + implementation(edc.ext.identity.did.crypto) + + implementation("io.swagger.core.v3:swagger-jaxrs2-jakarta:${swagger}") { exclude(group = "com.fasterxml.jackson.jaxrs", module = "jackson-jaxrs-json-provider") } - testFixturesImplementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - testFixturesImplementation("${edcGroup}:identity-did-spi:${edcVersion}") - testFixturesImplementation("${edcGroup}:identity-did-crypto:${edcVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") + testFixturesImplementation(libs.nimbus.jwt) + testFixturesImplementation(edc.spi.identity.did) + testFixturesImplementation(edc.ext.identity.did.crypto) } publishing { diff --git a/spi/identity-hub-store-spi/build.gradle.kts b/spi/identity-hub-store-spi/build.gradle.kts index aea5510f8..fa2a6a11f 100644 --- a/spi/identity-hub-store-spi/build.gradle.kts +++ b/spi/identity-hub-store-spi/build.gradle.kts @@ -4,25 +4,15 @@ plugins { `maven-publish` } -val edcGroup: String by project -val edcVersion: String by project -val jupiterVersion: String by project -val assertj: String by project -val nimbusVersion: String by project -val jacksonVersion: String by project - dependencies { api(project(":spi:identity-hub-spi")) - api("${edcGroup}:core-spi:${edcVersion}") - - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") + api(edc.spi.core) + - testFixturesImplementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") - testFixturesImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testFixturesImplementation("org.assertj:assertj-core:${assertj}") - testFixturesImplementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") + testFixturesImplementation(libs.junit.jupiter.api) + testFixturesImplementation(libs.assertj) + testFixturesImplementation(libs.nimbus.jwt) + testFixturesImplementation(libs.jackson.databind) } publishing { diff --git a/system-tests/build.gradle.kts b/system-tests/build.gradle.kts index b072e84c9..93ae4ef79 100644 --- a/system-tests/build.gradle.kts +++ b/system-tests/build.gradle.kts @@ -16,33 +16,19 @@ plugins { `java-library` } -val edcVersion: String by project -val edcGroup: String by project -val jacksonVersion: String by project -val jupiterVersion: String by project -val assertj: String by project -val mockitoVersion: String by project -val okHttpVersion: String by project -val nimbusVersion: String by project -val bouncycastleVersion: String by project -val picoCliVersion: String by project - dependencies { api(project(":spi:identity-hub-spi")) - api("${edcGroup}:identity-did-spi:${edcVersion}") + api(edc.spi.identity.did) testImplementation(project(":launcher")) testImplementation(project(":client-cli")) - testImplementation("${edcGroup}:junit:${edcVersion}") - testImplementation("info.picocli:picocli:${picoCliVersion}") - testImplementation("info.picocli:picocli-codegen:${picoCliVersion}") - testImplementation("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") - testImplementation("com.squareup.okhttp3:okhttp:${okHttpVersion}") - testImplementation("com.nimbusds:nimbus-jose-jwt:${nimbusVersion}") - testImplementation("org.bouncycastle:bcpkix-jdk15on:${bouncycastleVersion}") - testImplementation("org.assertj:assertj-core:${assertj}") - testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${jupiterVersion}") + testImplementation(edc.core.junit) + + testImplementation(libs.picocli.core) + testImplementation(libs.picocli.codegen) + testImplementation(libs.jackson.databind) + testImplementation(libs.okhttp) + testImplementation(libs.nimbus.jwt) + testImplementation(libs.bouncycastle.bcpkix.jdk15on) }