diff --git a/core/identity-hub-credentials/build.gradle.kts b/core/identity-hub-credentials/build.gradle.kts index 7c86b5865..2b0fbfe15 100644 --- a/core/identity-hub-credentials/build.gradle.kts +++ b/core/identity-hub-credentials/build.gradle.kts @@ -5,24 +5,25 @@ plugins { dependencies { api(project(":spi:identity-hub-spi")) api(project(":spi:identity-hub-store-spi")) - implementation(libs.edc.spi.token) - implementation(libs.edc.spi.vc) + implementation(project(":core:lib:verifiable-presentation-lib")) + implementation(project(":core:lib:accesstoken-lib")) + implementation(project(":core:lib:credential-query-lib")) implementation(libs.edc.spi.iatp) //SignatureSuiteRegistry - implementation(libs.edc.core.token) // for Jwt generation service, token validation service and rule registry impl implementation(libs.edc.core.connector) // for the CriterionToPredicateConverterImpl - implementation(libs.edc.common.crypto) // for the crypto converter implementation(libs.edc.ext.jsonld) // for the JSON-LD mapper - implementation(libs.edc.lib.jws2020) - implementation(libs.edc.vc.ldp) implementation(libs.edc.lib.util) implementation(libs.edc.lib.store) - implementation(libs.nimbus.jwt) implementation(libs.edc.lib.jsonld) implementation(libs.edc.lib.query) + implementation(libs.edc.lib.jws2020) + implementation(libs.edc.spi.token) + implementation(libs.edc.spi.identity.did) + implementation(libs.edc.vc.ldp) + implementation(libs.edc.core.token) + testImplementation(libs.edc.junit) testImplementation(libs.edc.ext.jsonld) - testImplementation(testFixtures(project(":spi:identity-hub-spi"))) testImplementation(testFixtures(project(":spi:identity-hub-store-spi"))) testImplementation(testFixtures(libs.edc.vc.jwt)) // JWT generator } diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/DefaultServicesExtension.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/DefaultServicesExtension.java index 88cc04b38..b017610b3 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/DefaultServicesExtension.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/DefaultServicesExtension.java @@ -15,16 +15,16 @@ package org.eclipse.edc.identityhub; import org.eclipse.edc.iam.identitytrust.spi.verification.SignatureSuiteRegistry; -import org.eclipse.edc.identityhub.defaults.EdcScopeToCriterionTransformer; +import org.eclipse.edc.identityhub.accesstoken.rules.ClaimIsPresentRule; import org.eclipse.edc.identityhub.defaults.InMemoryCredentialStore; import org.eclipse.edc.identityhub.defaults.InMemoryKeyPairResourceStore; import org.eclipse.edc.identityhub.defaults.InMemoryParticipantContextStore; import org.eclipse.edc.identityhub.defaults.InMemorySignatureSuiteRegistry; +import org.eclipse.edc.identityhub.query.EdcScopeToCriterionTransformer; import org.eclipse.edc.identityhub.spi.ScopeToCriterionTransformer; import org.eclipse.edc.identityhub.spi.store.CredentialStore; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; -import org.eclipse.edc.identityhub.token.rules.ClaimIsPresentRule; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.runtime.metamodel.annotation.Provider; @@ -33,15 +33,16 @@ import org.eclipse.edc.token.spi.TokenValidationRulesRegistry; import static org.eclipse.edc.identityhub.DefaultServicesExtension.NAME; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.ACCESS_TOKEN_SCOPE_CLAIM; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_ACCESS_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_SELF_ISSUED_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.TOKEN_CLAIM; @Extension(NAME) public class DefaultServicesExtension implements ServiceExtension { public static final String NAME = "IdentityHub Default Services Extension"; - public static final String IATP_SELF_ISSUED_TOKEN_CONTEXT = "iatp-si"; - public static final String IATP_ACCESS_TOKEN_CONTEXT = "iatp-access-token"; - public static final String TOKEN_CLAIM = "token"; - public static final String ACCESS_TOKEN_SCOPE_CLAIM = "scope"; + @Inject private TokenValidationRulesRegistry registry; @@ -59,7 +60,6 @@ public void initialize(ServiceExtensionContext context) { var scopeIsPresentRule = new ClaimIsPresentRule(ACCESS_TOKEN_SCOPE_CLAIM); registry.addRule(IATP_ACCESS_TOKEN_CONTEXT, scopeIsPresentRule); - } @Provider(isDefault = true) diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CoreServicesExtension.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CoreServicesExtension.java index 82ab12242..de9901914 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CoreServicesExtension.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CoreServicesExtension.java @@ -17,17 +17,20 @@ import org.eclipse.edc.iam.did.spi.resolution.DidPublicKeyResolver; import org.eclipse.edc.iam.identitytrust.spi.verification.SignatureSuiteRegistry; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; -import org.eclipse.edc.identityhub.core.creators.JwtPresentationGenerator; -import org.eclipse.edc.identityhub.core.creators.LdpPresentationGenerator; -import org.eclipse.edc.identityhub.spi.KeyPairService; +import org.eclipse.edc.identithub.verifiablepresentation.PresentationCreatorRegistryImpl; +import org.eclipse.edc.identithub.verifiablepresentation.VerifiablePresentationServiceImpl; +import org.eclipse.edc.identithub.verifiablepresentation.generators.JwtPresentationGenerator; +import org.eclipse.edc.identithub.verifiablepresentation.generators.LdpPresentationGenerator; +import org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenVerifierImpl; +import org.eclipse.edc.identityhub.query.CredentialQueryResolverImpl; import org.eclipse.edc.identityhub.spi.ScopeToCriterionTransformer; -import org.eclipse.edc.identityhub.spi.generator.PresentationCreatorRegistry; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; import org.eclipse.edc.identityhub.spi.model.IdentityHubConstants; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationCreatorRegistry; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; -import org.eclipse.edc.identityhub.token.verification.AccessTokenVerifierImpl; import org.eclipse.edc.jsonld.spi.JsonLd; import org.eclipse.edc.jsonld.util.JacksonJsonLd; import org.eclipse.edc.keys.spi.KeyParserRegistry; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/LocalPublicKeySupplier.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/LocalPublicKeySupplier.java index a0238174f..723b665e9 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/LocalPublicKeySupplier.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/LocalPublicKeySupplier.java @@ -37,7 +37,7 @@ *

* It is NOT intended for general use when resolving arbitrary public keys! */ -public class LocalPublicKeySupplier implements Supplier { +class LocalPublicKeySupplier implements Supplier { public static final String NO_PUBLIC_KEY_CONFIGURED_ERROR = "No public key was configured! Please either configure '%s', '%s' or '%s'." .formatted(PUBLIC_KEY_VAULT_ALIAS_PROPERTY, PUBLIC_KEY_PATH_PROPERTY, PUBLIC_KEY_VAULT_ALIAS_PROPERTY); private String vaultAlias; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/CredentialResourceLookup.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/CredentialResourceLookup.java index 7f627ca2b..fe0222e5a 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/CredentialResourceLookup.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/CredentialResourceLookup.java @@ -15,7 +15,7 @@ package org.eclipse.edc.identityhub.defaults; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.query.ReflectionPropertyLookup; import org.eclipse.edc.util.reflection.PathItem; import org.eclipse.edc.util.reflection.ReflectionUtil; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryCredentialStore.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryCredentialStore.java index ead869194..ffb58b77c 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryCredentialStore.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryCredentialStore.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.defaults; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.store.ReflectionBasedQueryResolver; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryKeyPairResourceStore.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryKeyPairResourceStore.java index 2a6b14c0b..f8d392e7c 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryKeyPairResourceStore.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryKeyPairResourceStore.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.defaults; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.store.ReflectionBasedQueryResolver; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryParticipantContextStore.java b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryParticipantContextStore.java index 1f7dd54c8..84c0fbf3d 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryParticipantContextStore.java +++ b/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/InMemoryParticipantContextStore.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.defaults; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.store.ReflectionBasedQueryResolver; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/DefaultServicesExtensionTest.java b/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/DefaultServicesExtensionTest.java index 3c18628b1..44dbe18a8 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/DefaultServicesExtensionTest.java +++ b/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/DefaultServicesExtensionTest.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub; -import org.eclipse.edc.identityhub.token.rules.ClaimIsPresentRule; +import org.eclipse.edc.identityhub.accesstoken.rules.ClaimIsPresentRule; import org.eclipse.edc.junit.extensions.DependencyInjectionExtension; import org.eclipse.edc.spi.system.ServiceExtensionContext; import org.eclipse.edc.token.spi.TokenValidationRulesRegistry; diff --git a/core/identity-hub-did/build.gradle.kts b/core/identity-hub-did/build.gradle.kts index 0d5fe72a1..e29f74081 100644 --- a/core/identity-hub-did/build.gradle.kts +++ b/core/identity-hub-did/build.gradle.kts @@ -4,8 +4,10 @@ plugins { dependencies { api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) + implementation(project(":spi:keypair-spi")) + implementation(project(":spi:participant-context-spi")) implementation(libs.edc.core.connector) // for the reflection-based query resolver implementation(libs.edc.common.crypto) implementation(libs.edc.lib.store) @@ -15,5 +17,5 @@ dependencies { testImplementation(libs.edc.ext.jsonld) testImplementation(libs.edc.lib.keys) testImplementation(testFixtures(project(":spi:identity-hub-spi"))) - testImplementation(testFixtures(project(":spi:identity-hub-did-spi"))) + testImplementation(testFixtures(project(":spi:did-spi"))) } diff --git a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImpl.java b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImpl.java index 9751fcfae..9750bcf2e 100644 --- a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImpl.java +++ b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImpl.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.did; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisher; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisherRegistry; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisher; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisherRegistry; import java.util.HashMap; import java.util.Map; diff --git a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImpl.java b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImpl.java index 1372f6c5d..6d55d9757 100644 --- a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImpl.java +++ b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImpl.java @@ -17,17 +17,17 @@ import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; import org.eclipse.edc.iam.did.spi.document.VerificationMethod; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisherRegistry; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairAdded; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairRevoked; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextDeleted; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextUpdated; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisherRegistry; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairAdded; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairRevoked; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleted; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextUpdated; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.keys.spi.KeyParserRegistry; import org.eclipse.edc.security.token.jwt.CryptoConverter; import org.eclipse.edc.spi.event.Event; diff --git a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidServicesExtension.java b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidServicesExtension.java index 123c4e422..4f219de85 100644 --- a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidServicesExtension.java +++ b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/DidServicesExtension.java @@ -14,13 +14,13 @@ package org.eclipse.edc.identityhub.did; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisherRegistry; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairAdded; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairRevoked; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextDeleted; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextUpdated; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisherRegistry; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairAdded; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairRevoked; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleted; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextUpdated; import org.eclipse.edc.keys.spi.KeyParserRegistry; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; diff --git a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/DidDefaultServicesExtension.java b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/DidDefaultServicesExtension.java index c9a5cef94..262f2bf60 100644 --- a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/DidDefaultServicesExtension.java +++ b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/DidDefaultServicesExtension.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.did.defaults; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.runtime.metamodel.annotation.Provider; diff --git a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStore.java b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStore.java index a1ce1b9fe..468202600 100644 --- a/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStore.java +++ b/core/identity-hub-did/src/main/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStore.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.did.defaults; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.spi.query.CriterionOperatorRegistry; import org.eclipse.edc.spi.query.QueryResolver; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImplTest.java b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImplTest.java index 0d24f8de2..1b2ff53a1 100644 --- a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImplTest.java +++ b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentPublisherRegistryImplTest.java @@ -14,12 +14,12 @@ package org.eclipse.edc.identityhub.did; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisher; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisher; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.eclipse.edc.identithub.did.spi.DidConstants.DID_WEB_METHOD; +import static org.eclipse.edc.identithub.spi.did.DidConstants.DID_WEB_METHOD; import static org.mockito.Mockito.mock; class DidDocumentPublisherRegistryImplTest { diff --git a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImplTest.java b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImplTest.java index b6a95243d..ea40da204 100644 --- a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImplTest.java +++ b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/DidDocumentServiceImplTest.java @@ -18,11 +18,11 @@ import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; import org.eclipse.edc.iam.did.spi.document.VerificationMethod; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisher; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisherRegistry; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisher; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisherRegistry; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.keys.KeyParserRegistryImpl; import org.eclipse.edc.keys.keyparsers.JwkParser; import org.eclipse.edc.keys.keyparsers.PemParser; diff --git a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStoreTest.java b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStoreTest.java index 3afa44454..24230453f 100644 --- a/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStoreTest.java +++ b/core/identity-hub-did/src/test/java/org/eclipse/edc/identityhub/did/defaults/InMemoryDidResourceStoreTest.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.did.defaults; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.identityhub.did.store.test.DidResourceStoreTestBase; import org.eclipse.edc.query.CriterionOperatorRegistryImpl; diff --git a/core/identity-hub-keypairs/build.gradle.kts b/core/identity-hub-keypairs/build.gradle.kts index bf3dbdb39..ded6f9270 100644 --- a/core/identity-hub-keypairs/build.gradle.kts +++ b/core/identity-hub-keypairs/build.gradle.kts @@ -20,7 +20,7 @@ dependencies { api(project(":spi:identity-hub-spi")) api(project(":spi:identity-hub-store-spi")) api(libs.edc.spi.transaction) - implementation(project(":extensions:common:security")) + implementation(project(":core:lib:keypair-lib")) implementation(libs.edc.common.crypto) implementation(libs.edc.core.connector) testImplementation(libs.edc.junit) diff --git a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairEventPublisher.java b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairEventPublisher.java index a73d0cbe5..3dea19d79 100644 --- a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairEventPublisher.java +++ b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairEventPublisher.java @@ -14,12 +14,12 @@ package org.eclipse.edc.identityhub.keypairs; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairAdded; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairEvent; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairEventListener; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairRevoked; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairRotated; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairAdded; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairEvent; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairEventListener; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairRevoked; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairRotated; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.event.EventRouter; @@ -45,8 +45,8 @@ public void added(KeyPairResource keyPair, String type) { } @Override - public void revoked(KeyPairResource keyPair) { - var event = KeyPairRevoked.Builder.newInstance() + public void rotated(KeyPairResource keyPair) { + var event = KeyPairRotated.Builder.newInstance() .participantId(keyPair.getParticipantId()) .keyId(keyPair.getId()) .build(); @@ -54,15 +54,14 @@ public void revoked(KeyPairResource keyPair) { } @Override - public void rotated(KeyPairResource keyPair) { - var event = KeyPairRotated.Builder.newInstance() + public void revoked(KeyPairResource keyPair) { + var event = KeyPairRevoked.Builder.newInstance() .participantId(keyPair.getParticipantId()) .keyId(keyPair.getId()) .build(); publish(event); } - private void publish(KeyPairEvent event) { var envelope = EventEnvelope.Builder.newInstance() .payload(event) diff --git a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairObservableImpl.java b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairObservableImpl.java index c740bec7c..e47771912 100644 --- a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairObservableImpl.java +++ b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairObservableImpl.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.keypairs; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairEventListener; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairObservable; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairEventListener; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairObservable; import org.eclipse.edc.spi.observe.ObservableImpl; public class KeyPairObservableImpl extends ObservableImpl implements KeyPairObservable { diff --git a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceExtension.java b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceExtension.java index 07c170fff..0bad113bd 100644 --- a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceExtension.java +++ b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceExtension.java @@ -14,9 +14,9 @@ package org.eclipse.edc.identityhub.keypairs; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairObservable; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextDeleted; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairObservable; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleted; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; diff --git a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImpl.java b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImpl.java index db21455af..01c03e3a2 100644 --- a/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImpl.java +++ b/core/identity-hub-keypairs/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImpl.java @@ -14,15 +14,14 @@ package org.eclipse.edc.identityhub.keypairs; -import org.eclipse.edc.identityhub.security.KeyPairGenerator; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairObservable; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextDeleted; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairObservable; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleted; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.security.token.jwt.CryptoConverter; import org.eclipse.edc.spi.event.Event; diff --git a/core/identity-hub-keypairs/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImplTest.java b/core/identity-hub-keypairs/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImplTest.java index 2bb73898b..c69383c2d 100644 --- a/core/identity-hub-keypairs/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImplTest.java +++ b/core/identity-hub-keypairs/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairServiceImplTest.java @@ -17,10 +17,10 @@ import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.Curve; import com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairObservable; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairObservable; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.edc.spi.security.Vault; diff --git a/core/identity-hub-participants/build.gradle.kts b/core/identity-hub-participants/build.gradle.kts index 37b895f36..aae57a91f 100644 --- a/core/identity-hub-participants/build.gradle.kts +++ b/core/identity-hub-participants/build.gradle.kts @@ -4,10 +4,10 @@ plugins { dependencies { api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) api(project(":spi:identity-hub-store-spi")) api(libs.edc.spi.transaction) - implementation(project(":extensions:common:security")) + implementation(project(":core:lib:keypair-lib")) implementation(libs.edc.common.crypto) implementation(libs.edc.core.connector) diff --git a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinator.java b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinator.java index 6ce284aa1..e47705295 100644 --- a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinator.java +++ b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinator.java @@ -15,9 +15,9 @@ package org.eclipse.edc.identityhub.participantcontext; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; import org.eclipse.edc.spi.event.Event; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.event.EventSubscriber; @@ -38,12 +38,12 @@ * For example, once a KeyPair is added, the {@link KeyPairService} will emit a {@link org.eclipse.edc.identityhub.spi.events.keypair.KeyPairAdded} event. The {@link DidDocumentService} * can then react to this event by updating the DID Document. */ -public class ParticipantContextEventCoordinator implements EventSubscriber { +class ParticipantContextEventCoordinator implements EventSubscriber { private final Monitor monitor; private final DidDocumentService didDocumentService; private final KeyPairService keyPairService; - public ParticipantContextEventCoordinator(Monitor monitor, DidDocumentService didDocumentService, KeyPairService keyPairService) { + ParticipantContextEventCoordinator(Monitor monitor, DidDocumentService didDocumentService, KeyPairService keyPairService) { this.monitor = monitor; this.didDocumentService = didDocumentService; this.keyPairService = keyPairService; diff --git a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventPublisher.java b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventPublisher.java index d4320b628..bf7caffd3 100644 --- a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventPublisher.java +++ b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventPublisher.java @@ -14,13 +14,13 @@ package org.eclipse.edc.identityhub.participantcontext; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextDeleted; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextEvent; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextListener; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextUpdated; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextDeleted; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextEvent; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextListener; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextUpdated; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.event.EventRouter; @@ -45,18 +45,18 @@ public void created(ParticipantContext newContext, ParticipantManifest manifest) } @Override - public void deleted(ParticipantContext deletedContext) { - var event = ParticipantContextDeleted.Builder.newInstance() - .participantId(deletedContext.getParticipantId()) + public void updated(ParticipantContext updatedContext) { + var event = ParticipantContextUpdated.Builder.newInstance() + .participantId(updatedContext.getParticipantId()) + .newState(updatedContext.getStateAsEnum()) .build(); publish(event); } @Override - public void updated(ParticipantContext updatedContext) { - var event = ParticipantContextUpdated.Builder.newInstance() - .participantId(updatedContext.getParticipantId()) - .newState(updatedContext.getStateAsEnum()) + public void deleted(ParticipantContext deletedContext) { + var event = ParticipantContextDeleted.Builder.newInstance() + .participantId(deletedContext.getParticipantId()) .build(); publish(event); } diff --git a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextExtension.java b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextExtension.java index 63d613a64..03b80f75f 100644 --- a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextExtension.java +++ b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextExtension.java @@ -14,11 +14,11 @@ package org.eclipse.edc.identityhub.participantcontext; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextObservable; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextObservable; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.keys.spi.KeyParserRegistry; import org.eclipse.edc.runtime.metamodel.annotation.Extension; diff --git a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextObservableImpl.java b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextObservableImpl.java index 27db0d008..21b6d1b2b 100644 --- a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextObservableImpl.java +++ b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextObservableImpl.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.participantcontext; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextListener; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextObservable; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextListener; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextObservable; import org.eclipse.edc.spi.observe.ObservableImpl; public class ParticipantContextObservableImpl extends ObservableImpl implements ParticipantContextObservable { diff --git a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImpl.java b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImpl.java index 3098c32aa..a47156cfb 100644 --- a/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImpl.java +++ b/core/identity-hub-participants/src/main/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImpl.java @@ -14,12 +14,12 @@ package org.eclipse.edc.identityhub.participantcontext; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextObservable; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextObservable; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; diff --git a/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinatorTest.java b/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinatorTest.java index 92d9aa197..bf90eef1b 100644 --- a/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinatorTest.java +++ b/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextEventCoordinatorTest.java @@ -14,11 +14,11 @@ package org.eclipse.edc.identityhub.participantcontext; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.spi.event.Event; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.monitor.Monitor; diff --git a/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImplTest.java b/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImplTest.java index 7c65276d4..25518ed09 100644 --- a/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImplTest.java +++ b/core/identity-hub-participants/src/test/java/org/eclipse/edc/identityhub/participantcontext/ParticipantContextServiceImplTest.java @@ -18,11 +18,11 @@ import com.nimbusds.jose.jwk.Curve; import com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator; import org.assertj.core.api.Assertions; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextObservable; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextObservable; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.keys.KeyParserRegistryImpl; import org.eclipse.edc.keys.keyparsers.PemParser; diff --git a/core/lib/accesstoken-lib/build.gradle.kts b/core/lib/accesstoken-lib/build.gradle.kts new file mode 100644 index 000000000..f825700ef --- /dev/null +++ b/core/lib/accesstoken-lib/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + `java-library` +} + +dependencies { + api(project(":spi:identity-hub-spi")) + implementation(libs.edc.spi.token) + implementation(libs.edc.spi.jwt) + + testImplementation(libs.edc.junit) + testImplementation(libs.edc.core.token) + testImplementation(libs.nimbus.jwt) + testImplementation(testFixtures(project(":spi:verifiable-credential-spi"))) +} diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRule.java b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRule.java similarity index 95% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRule.java rename to core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRule.java index 6febab439..7135f9733 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRule.java +++ b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRule.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.token.rules; +package org.eclipse.edc.identityhub.accesstoken.rules; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; diff --git a/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenConstants.java b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenConstants.java new file mode 100644 index 000000000..38f8f0fe7 --- /dev/null +++ b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenConstants.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Metaform Systems, Inc. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + * + * Contributors: + * Metaform Systems, Inc. - initial API and implementation + * + */ + +package org.eclipse.edc.identityhub.accesstoken.verification; + +public interface AccessTokenConstants { + String IATP_SELF_ISSUED_TOKEN_CONTEXT = "iatp-si"; + String IATP_ACCESS_TOKEN_CONTEXT = "iatp-access-token"; + String TOKEN_CLAIM = "token"; + String ACCESS_TOKEN_SCOPE_CLAIM = "scope"; +} diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImpl.java b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImpl.java similarity index 80% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImpl.java rename to core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImpl.java index 9fc5db910..0a7f666fe 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImpl.java +++ b/core/lib/accesstoken-lib/src/main/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,13 +8,14 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.token.verification; +package org.eclipse.edc.identityhub.accesstoken.verification; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; +import org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames; import org.eclipse.edc.keys.spi.PublicKeyResolver; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; @@ -29,13 +30,10 @@ import java.util.Objects; import java.util.function.Supplier; -import static com.nimbusds.jwt.JWTClaimNames.AUDIENCE; -import static com.nimbusds.jwt.JWTClaimNames.SUBJECT; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.ACCESS_TOKEN_SCOPE_CLAIM; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.IATP_ACCESS_TOKEN_CONTEXT; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.IATP_SELF_ISSUED_TOKEN_CONTEXT; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.TOKEN_CLAIM; -import static org.eclipse.edc.spi.result.Result.success; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.ACCESS_TOKEN_SCOPE_CLAIM; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_ACCESS_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_SELF_ISSUED_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.TOKEN_CLAIM; /** * Default implementation used to verify Self-Issued tokens. The public key is expected to be found in the @@ -43,6 +41,7 @@ */ public class AccessTokenVerifierImpl implements AccessTokenVerifier { + private static final String SCOPE_SEPARATOR = " "; private final TokenValidationService tokenValidationService; private final TokenValidationRulesRegistry tokenValidationRulesRegistry; @@ -69,10 +68,10 @@ public Result> verify(String token, String participantId) { var claimToken = res.getContent(); var accessTokenString = claimToken.getStringClaim(TOKEN_CLAIM); - var subClaim = claimToken.getStringClaim(SUBJECT); + var subClaim = claimToken.getStringClaim(JwtRegisteredClaimNames.SUBJECT); TokenValidationRule audMustMatchParticipantIdRule = (at, additional) -> { - var aud = at.getListClaim(AUDIENCE); + var aud = at.getListClaim(JwtRegisteredClaimNames.AUDIENCE); if (aud == null || aud.isEmpty()) { return Result.failure("Mandatory claim 'aud' on 'token' was null."); } @@ -80,7 +79,7 @@ public Result> verify(String token, String participantId) { }; TokenValidationRule subClaimsMatch = (at, additional) -> { - var atSub = at.getStringClaim(SUBJECT); + var atSub = at.getStringClaim(JwtRegisteredClaimNames.SUBJECT); // correlate sub and access_token.sub if (!Objects.equals(subClaim, atSub)) { monitor.warning("ID token [sub] claim is not equal to [%s.sub] claim: expected '%s', got '%s'. Proof-of-possession could not be established!".formatted(TOKEN_CLAIM, subClaim, atSub)); @@ -100,6 +99,6 @@ public Result> verify(String token, String participantId) { // verify that the access_token contains a scope claim var scope = result.getContent().getStringClaim(ACCESS_TOKEN_SCOPE_CLAIM); - return success(Arrays.asList(scope.split(SCOPE_SEPARATOR))); + return Result.success(Arrays.asList(scope.split(SCOPE_SEPARATOR))); } } diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRuleTest.java b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRuleTest.java similarity index 95% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRuleTest.java rename to core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRuleTest.java index 32089f2e9..15ccea87b 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/rules/ClaimIsPresentRuleTest.java +++ b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/rules/ClaimIsPresentRuleTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.token.rules; +package org.eclipse.edc.identityhub.accesstoken.rules; import org.eclipse.edc.spi.iam.ClaimToken; import org.junit.jupiter.api.Test; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplComponentTest.java b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplComponentTest.java similarity index 82% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplComponentTest.java rename to core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplComponentTest.java index e20fe90b8..9f5118af3 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplComponentTest.java +++ b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplComponentTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.token.verification; +package org.eclipse.edc.identityhub.accesstoken.verification; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSAlgorithm; @@ -21,8 +21,9 @@ import com.nimbusds.jose.jwk.Curve; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; -import org.eclipse.edc.identityhub.token.rules.ClaimIsPresentRule; +import org.eclipse.edc.identityhub.accesstoken.rules.ClaimIsPresentRule; import org.eclipse.edc.junit.annotations.ComponentTest; +import org.eclipse.edc.junit.assertions.AbstractResultAssert; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.token.TokenValidationRulesRegistryImpl; @@ -38,11 +39,10 @@ import java.security.spec.ECGenParameterSpec; import java.util.UUID; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.ACCESS_TOKEN_SCOPE_CLAIM; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.IATP_ACCESS_TOKEN_CONTEXT; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.IATP_SELF_ISSUED_TOKEN_CONTEXT; -import static org.eclipse.edc.identityhub.DefaultServicesExtension.TOKEN_CLAIM; -import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.ACCESS_TOKEN_SCOPE_CLAIM; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_ACCESS_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.IATP_SELF_ISSUED_TOKEN_CONTEXT; +import static org.eclipse.edc.identityhub.accesstoken.verification.AccessTokenConstants.TOKEN_CLAIM; import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -81,7 +81,7 @@ void selfIssuedTokenNotVerified() { var spoofedKey = generator.generateKeyPair().getPrivate(); var selfIssuedIdToken = createSignedJwt(spoofedKey, new JWTClaimsSet.Builder().claim("foo", "bar").jwtID(UUID.randomUUID().toString()).build()); - assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Token verification failed"); } @@ -89,7 +89,7 @@ void selfIssuedTokenNotVerified() { @Test void selfIssuedToken_noAccessTokenClaim() { var selfIssuedIdToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder()/* missing: claims("access_token", "....") */.build()); - assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Required claim 'token' not present on token."); } @@ -100,7 +100,7 @@ void selfIssuedToken_noAccessTokenAudienceClaim() { .build()); var selfIssuedIdToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder().claim("token", accessToken) .build()); - assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(selfIssuedIdToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Mandatory claim 'aud' on 'token' was null."); } @@ -110,7 +110,7 @@ void accessToken_notVerified() { var accessToken = createSignedJwt(spoofedKey, new JWTClaimsSet.Builder().claim("scope", "foobar").claim("foo", "bar").build()); var siToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder().claim("token", accessToken).build()); - assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Token verification failed"); } @@ -123,7 +123,7 @@ void accessToken_noScopeClaim() { var siToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder().claim("token", accessToken) .build()); - assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Required claim 'scope' not present on token."); } @@ -137,7 +137,7 @@ void accessToken_noAudClaim() { var siToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder().claim("token", accessToken) .build()); - assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("Mandatory claim 'aud' on 'token' was null."); } @@ -150,7 +150,7 @@ void assertWarning_whenSubjectClaimsMismatch() { .build()); var siToken = createSignedJwt(providerKeyPair.getPrivate(), new JWTClaimsSet.Builder().claim("token", accessToken).subject("mismatching-subject").build()); - assertThat(verifier.verify(siToken, "did:web:test_participant")).isSucceeded(); + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")).isSucceeded(); verify(monitor).warning(startsWith("ID token [sub] claim is not equal to [token.sub]")); } diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplTest.java b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplTest.java similarity index 62% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplTest.java rename to core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplTest.java index 10e8e01b0..0c1fe53ae 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/token/verification/AccessTokenVerifierImplTest.java +++ b/core/lib/accesstoken-lib/src/test/java/org/eclipse/edc/identityhub/accesstoken/verification/AccessTokenVerifierImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,13 +8,16 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.token.verification; +package org.eclipse.edc.identityhub.accesstoken.verification; import org.assertj.core.api.Assertions; +import org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.JwtCreationUtil; +import org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.VerifiableCredentialTestUtil; +import org.eclipse.edc.junit.assertions.AbstractResultAssert; import org.eclipse.edc.keys.spi.PublicKeyResolver; import org.eclipse.edc.spi.iam.ClaimToken; import org.eclipse.edc.spi.result.Result; @@ -27,13 +30,6 @@ import java.util.Map; import java.util.function.Supplier; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.CONSUMER_KEY; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.PROVIDER_KEY; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.TEST_SCOPE; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.generateJwt; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.generateSiToken; -import static org.eclipse.edc.identityhub.junit.testfixtures.VerifiableCredentialTestUtil.generateEcKey; -import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyString; @@ -59,9 +55,9 @@ class AccessTokenVerifierImplTest { void verify_validSiToken_validAccessToken() { when(tokenValidationSerivce.validate(anyString(), any(), anyList())) .thenReturn(Result.success(idToken)); - assertThat(verifier.verify(generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")) + AbstractResultAssert.assertThat(verifier.verify(JwtCreationUtil.generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")) .isSucceeded() - .satisfies(strings -> Assertions.assertThat(strings).containsOnly(TEST_SCOPE)); + .satisfies(strings -> Assertions.assertThat(strings).containsOnly(JwtCreationUtil.TEST_SCOPE)); verify(tokenValidationSerivce, times(2)).validate(anyString(), any(PublicKeyResolver.class), anyList()); } @@ -70,7 +66,7 @@ void verify_validSiToken_validAccessToken() { void verify_siTokenValidationFails() { when(tokenValidationSerivce.validate(anyString(), any(), anyList())) .thenReturn(Result.failure("test-failure")); - assertThat(verifier.verify(generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(JwtCreationUtil.generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")).isFailed() .detail().contains("test-failure"); } @@ -79,19 +75,19 @@ void verify_noAccessTokenClaim() { when(tokenValidationSerivce.validate(anyString(), any(PublicKeyResolver.class), anyList())) .thenReturn(Result.failure("no access token")); - assertThat(verifier.verify(generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(JwtCreationUtil.generateSiToken(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID), "did:web:test_participant")).isFailed() .detail().contains("no access token"); verify(tokenValidationSerivce).validate(anyString(), any(PublicKeyResolver.class), anyList()); } @Test void verify_accessTokenValidationFails() { - var spoofedKey = generateEcKey("spoofed-key"); - var accessToken = generateJwt(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, Map.of("scope", TEST_SCOPE), spoofedKey); - var siToken = generateJwt(OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID, Map.of("client_id", OTHER_PARTICIPANT_DID, "access_token", accessToken), PROVIDER_KEY); + var spoofedKey = VerifiableCredentialTestUtil.generateEcKey("spoofed-key"); + var accessToken = JwtCreationUtil.generateJwt(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, Map.of("scope", JwtCreationUtil.TEST_SCOPE), spoofedKey); + var siToken = JwtCreationUtil.generateJwt(OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID, Map.of("client_id", OTHER_PARTICIPANT_DID, "access_token", accessToken), JwtCreationUtil.PROVIDER_KEY); when(tokenValidationSerivce.validate(anyString(), any(), anyList())).thenReturn(Result.failure("test-failure")); - assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")).isFailed() .detail().isEqualTo("test-failure"); } @@ -102,13 +98,13 @@ void verify_accessTokenSubNotEqualToSub_shouldFail() { @Test void verify_accessTokenDoesNotContainScopeClaim() { - var accessToken = generateJwt(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, Map.of(/*scope missing*/), CONSUMER_KEY); - var siToken = generateJwt(OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID, Map.of("client_id", OTHER_PARTICIPANT_DID, "access_token", accessToken), PROVIDER_KEY); + var accessToken = JwtCreationUtil.generateJwt(OWN_DID, OWN_DID, OTHER_PARTICIPANT_DID, Map.of(/*scope missing*/), JwtCreationUtil.CONSUMER_KEY); + var siToken = JwtCreationUtil.generateJwt(OWN_DID, OTHER_PARTICIPANT_DID, OTHER_PARTICIPANT_DID, Map.of("client_id", OTHER_PARTICIPANT_DID, "access_token", accessToken), JwtCreationUtil.PROVIDER_KEY); when(tokenValidationSerivce.validate(anyString(), any(), anyList())).thenReturn(Result.success(idToken)); when(tokenValidationSerivce.validate(anyString(), any(), anyList())).thenReturn(Result.failure("test-failure")); - assertThat(verifier.verify(siToken, "did:web:test_participant")) + AbstractResultAssert.assertThat(verifier.verify(siToken, "did:web:test_participant")) .isFailed() .detail().contains("test-failure"); } diff --git a/core/lib/credential-query-lib/build.gradle.kts b/core/lib/credential-query-lib/build.gradle.kts new file mode 100644 index 000000000..446831225 --- /dev/null +++ b/core/lib/credential-query-lib/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + `java-library` +} + +dependencies { + api(project(":spi:identity-hub-store-spi")) + + testImplementation(libs.edc.junit) + testImplementation(libs.edc.core.token) + testImplementation(libs.nimbus.jwt) + testImplementation(testFixtures(project(":spi:identity-hub-spi"))) + +} diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImpl.java b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java similarity index 92% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImpl.java rename to core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java index f29e711aa..126c4bc0a 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImpl.java +++ b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,18 +8,18 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identityhub.query; import org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage; import org.eclipse.edc.identityhub.spi.ScopeToCriterionTransformer; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; -import org.eclipse.edc.identityhub.spi.resolution.QueryResult; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryResult; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.AbstractResult; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformer.java b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformer.java similarity index 92% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformer.java rename to core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformer.java index 94438ff5b..4151ab338 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformer.java +++ b/core/lib/credential-query-lib/src/main/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.defaults; +package org.eclipse.edc.identityhub.query; import org.eclipse.edc.identityhub.spi.ScopeToCriterionTransformer; import org.eclipse.edc.spi.query.Criterion; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImplTest.java b/core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImplTest.java similarity index 96% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImplTest.java rename to core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImplTest.java index fdb427ee6..7841ccbba 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/CredentialQueryResolverImplTest.java +++ b/core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/CredentialQueryResolverImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identityhub.query; import org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; @@ -21,10 +21,9 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; import org.eclipse.edc.iam.verifiablecredentials.spi.model.presentationdefinition.PresentationDefinition; -import org.eclipse.edc.identityhub.defaults.EdcScopeToCriterionTransformer; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; -import org.eclipse.edc.identityhub.spi.resolution.QueryFailure; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryFailure; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; import org.jetbrains.annotations.Nullable; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformerTest.java b/core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformerTest.java similarity index 86% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformerTest.java rename to core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformerTest.java index 6c7fe4878..ff2a36d0e 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/defaults/EdcScopeToCriterionTransformerTest.java +++ b/core/lib/credential-query-lib/src/test/java/org/eclipse/edc/identityhub/query/EdcScopeToCriterionTransformerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.defaults; +package org.eclipse.edc.identityhub.query; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; diff --git a/extensions/common/security/build.gradle.kts b/core/lib/keypair-lib/build.gradle.kts similarity index 100% rename from extensions/common/security/build.gradle.kts rename to core/lib/keypair-lib/build.gradle.kts diff --git a/extensions/common/security/src/main/java/org/eclipse/edc/identityhub/security/KeyPairGenerator.java b/core/lib/keypair-lib/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairGenerator.java similarity index 93% rename from extensions/common/security/src/main/java/org/eclipse/edc/identityhub/security/KeyPairGenerator.java rename to core/lib/keypair-lib/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairGenerator.java index d03e963ae..16b3c98f5 100644 --- a/extensions/common/security/src/main/java/org/eclipse/edc/identityhub/security/KeyPairGenerator.java +++ b/core/lib/keypair-lib/src/main/java/org/eclipse/edc/identityhub/keypairs/KeyPairGenerator.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.security; +package org.eclipse.edc.identityhub.keypairs; import org.eclipse.edc.spi.result.Result; import org.eclipse.edc.util.string.StringUtils; @@ -64,9 +64,11 @@ public static Result generateKeyPair(Map parameters) { algorithm = algorithm.toUpperCase(); if (SUPPORTED_ALGORITHMS.contains(algorithm)) { return switch (algorithm) { - case ALGORITHM_RSA -> generateRsa(Integer.parseInt(parameters.getOrDefault(RSA_PARAM_LENGTH, RSA_DEFAULT_LENGTH).toString())); + case ALGORITHM_RSA -> + generateRsa(Integer.parseInt(parameters.getOrDefault(RSA_PARAM_LENGTH, RSA_DEFAULT_LENGTH).toString())); case ALGORITHM_EC -> generateEc(parameters.getOrDefault(EC_PARAM_CURVE, EC_DEFAULT_CURVE).toString()); - case ALGORITHM_EDDSA -> generateEdDsa(parameters.getOrDefault(EC_PARAM_CURVE, CURVE_ED25519).toString()); + case ALGORITHM_EDDSA -> + generateEdDsa(parameters.getOrDefault(EC_PARAM_CURVE, CURVE_ED25519).toString()); default -> Result.failure(notSupportedError(algorithm)); }; } diff --git a/extensions/common/security/src/test/java/org/eclipse/edc/identityhub/security/KeyPairGeneratorTest.java b/core/lib/keypair-lib/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairGeneratorTest.java similarity index 93% rename from extensions/common/security/src/test/java/org/eclipse/edc/identityhub/security/KeyPairGeneratorTest.java rename to core/lib/keypair-lib/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairGeneratorTest.java index 40c4d76c3..2338da220 100644 --- a/extensions/common/security/src/test/java/org/eclipse/edc/identityhub/security/KeyPairGeneratorTest.java +++ b/core/lib/keypair-lib/src/test/java/org/eclipse/edc/identityhub/keypairs/KeyPairGeneratorTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.security; +package org.eclipse.edc.identityhub.keypairs; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; @@ -57,7 +57,7 @@ void generateKeyPair_rsa_withLength() { } @ParameterizedTest - @ValueSource(ints = {0, 1, -1, Integer.MAX_VALUE}) + @ValueSource(ints = { 0, 1, -1, Integer.MAX_VALUE }) void generateKeyPair_rsa_withInvalidLength(int invalidLength) { Assertions.assertThatThrownBy(() -> KeyPairGenerator.generateKeyPair(Map.of("algorithm", "RSA", "length", invalidLength))).isInstanceOf(InvalidParameterException.class); } @@ -77,7 +77,7 @@ void generateKeyPair_ec_defaultCurve() throws InvalidParameterSpecException, NoS } @ParameterizedTest() - @ValueSource(strings = {"secp256r1", "secp384r1", "secp521r1", "SECP256R1", "SecP521R1"}) + @ValueSource(strings = { "secp256r1", "secp384r1", "secp521r1", "SECP256R1", "SecP521R1" }) void generateKeyPair_ec_withCurve(String curve) { var ecResult = KeyPairGenerator.generateKeyPair(Map.of("algorithm", "EC", "curve", curve)); assertThat(ecResult).isSucceeded() @@ -86,7 +86,7 @@ void generateKeyPair_ec_withCurve(String curve) { } @ParameterizedTest() - @ValueSource(strings = {"secp256k1", "foobar"}) + @ValueSource(strings = { "secp256k1", "foobar" }) @EmptySource void generateKeyPair_ec_withInvalidCurve(String curve) { var ecResult = KeyPairGenerator.generateKeyPair(Map.of("algorithm", "EC", "curve", curve)); @@ -104,7 +104,7 @@ void generateKeyPair_edDsa() { } @ParameterizedTest - @ValueSource(strings = {"Ed25519", "X25519", "ed25519", "x25519", "ED25519"}) + @ValueSource(strings = { "Ed25519", "X25519", "ed25519", "x25519", "ED25519" }) void generateKeyPair_edDsa_withValidCurve(String curve) { var edDsaResult = KeyPairGenerator.generateKeyPair(Map.of("algorithm", "EdDSA", "curve", curve)); assertThat(edDsaResult).isSucceeded() @@ -113,7 +113,7 @@ void generateKeyPair_edDsa_withValidCurve(String curve) { } @ParameterizedTest - @ValueSource(strings = {"Ed448", "x448", "foobar"}) + @ValueSource(strings = { "Ed448", "x448", "foobar" }) void generateKeyPair_edDsa_withInvalidCurve(String invalidCurve) { var edDsaResult = KeyPairGenerator.generateKeyPair(Map.of("algorithm", "EdDSA", "curve", invalidCurve)); assertThat(edDsaResult).isFailed() diff --git a/core/lib/verifiable-presentation-lib/build.gradle.kts b/core/lib/verifiable-presentation-lib/build.gradle.kts new file mode 100644 index 000000000..53b3996c7 --- /dev/null +++ b/core/lib/verifiable-presentation-lib/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + `java-library` +} + +dependencies { + api(project(":spi:identity-hub-spi")) + api(project(":spi:verifiable-credential-spi")) + api(project(":spi:keypair-spi")) + implementation(libs.edc.spi.token) + implementation(libs.edc.spi.vc) + implementation(libs.edc.spi.jsonld) + implementation(libs.edc.core.token) // for Jwt generation service, token validation service and rule registry impl + implementation(libs.edc.common.crypto) // for the CryptoConverter + implementation(libs.edc.lib.jws2020) + implementation(libs.edc.vc.ldp) + + testImplementation(libs.edc.junit) + testImplementation(libs.edc.lib.jsonld) + testImplementation(testFixtures(project(":spi:identity-hub-spi"))) + testImplementation(testFixtures(libs.edc.vc.jwt)) // JWT generator +} diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImpl.java b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImpl.java similarity index 79% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImpl.java rename to core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImpl.java index ff1a03689..c05b691ba 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImpl.java +++ b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,20 +8,20 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identithub.verifiablepresentation; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.generator.PresentationCreatorRegistry; -import org.eclipse.edc.identityhub.spi.generator.PresentationGenerator; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationCreatorRegistry; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationGenerator; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.query.Criterion; diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImpl.java b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImpl.java similarity index 86% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImpl.java rename to core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImpl.java index faa3fd627..e03eb4bc2 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImpl.java +++ b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,19 +8,20 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identithub.verifiablepresentation; import jakarta.json.JsonObject; import org.eclipse.edc.iam.identitytrust.spi.model.PresentationResponseMessage; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; import org.eclipse.edc.iam.verifiablecredentials.spi.model.presentationdefinition.PresentationDefinition; -import org.eclipse.edc.identityhub.spi.generator.PresentationCreatorRegistry; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationCreatorRegistry; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; import org.jetbrains.annotations.Nullable; @@ -35,8 +36,8 @@ import static java.util.Optional.ofNullable; import static org.eclipse.edc.iam.verifiablecredentials.spi.VcConstants.VERIFIABLE_PRESENTATION_TYPE; import static org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat.JSON_LD; -import static org.eclipse.edc.identityhub.core.creators.LdpPresentationGenerator.TYPE_ADDITIONAL_DATA; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.LdpPresentationGenerator.TYPE_ADDITIONAL_DATA; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; public class VerifiablePresentationServiceImpl implements VerifiablePresentationService { private final CredentialFormat defaultFormatVp; @@ -59,7 +60,7 @@ public VerifiablePresentationServiceImpl(CredentialFormat defaultFormatVp, Prese * all JWT-VCs in the list will be packaged in a separate JWT VP, because LDP-VPs cannot contain JWT-VCs. * Note: submitting a {@link PresentationDefinition} is not supported at the moment, and it will be ignored after logging a warning. * - * @param participantContextId The ID of the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} for which the VP is to be generated + * @param participantContextId The ID of the {@link ParticipantContext} for which the VP is to be generated * @param credentials The list of verifiable credentials to include in the presentation. * @param presentationDefinition The optional presentation definition. Not supported at the moment! * @param audience The Participant ID of the entity who the VP is intended for. May be null for some VP formats. diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGenerator.java b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGenerator.java similarity index 70% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGenerator.java rename to core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGenerator.java index 4be51cc95..edecfa36f 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGenerator.java +++ b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,14 +8,18 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; +import org.eclipse.edc.iam.identitytrust.spi.IatpConstants; +import org.eclipse.edc.iam.verifiablecredentials.spi.VcConstants; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; -import org.eclipse.edc.identityhub.spi.generator.PresentationGenerator; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationGenerator; +import org.eclipse.edc.jsonld.spi.JsonLdKeywords; +import org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames; import org.eclipse.edc.keys.spi.PrivateKeyResolver; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.iam.TokenRepresentation; @@ -33,20 +37,9 @@ import java.util.function.Supplier; import java.util.stream.Collectors; -import static org.eclipse.edc.iam.identitytrust.spi.IatpConstants.IATP_CONTEXT_URL; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.VP_TYPE_PROPERTY; -import static org.eclipse.edc.identityhub.spi.model.IdentityHubConstants.PRESENTATION_EXCHANGE_URL; -import static org.eclipse.edc.identityhub.spi.model.IdentityHubConstants.VERIFIABLE_PRESENTATION_TYPE; -import static org.eclipse.edc.identityhub.spi.model.IdentityHubConstants.W3C_CREDENTIALS_URL; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.AUDIENCE; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.EXPIRATION_TIME; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.ISSUED_AT; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.ISSUER; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.JWT_ID; -import static org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames.NOT_BEFORE; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.VP_TYPE_PROPERTY; /** * JwtPresentationCreator is an implementation of the PresentationCreator interface that generates Verifiable Presentations in JWT format. @@ -80,7 +73,7 @@ public JwtPresentationGenerator(PrivateKeyResolver privateKeyResolver, Clock clo */ @Override public String generatePresentation(List credentials, String privateKeyAlias, String publicKeyId) { - throw new UnsupportedOperationException("Must provide additional data: '%s' and '%s'".formatted(AUDIENCE, CONTROLLER_ADDITIONAL_DATA)); + throw new UnsupportedOperationException("Must provide additional data: '%s' and '%s'".formatted(JwtRegisteredClaimNames.AUDIENCE, CONTROLLER_ADDITIONAL_DATA)); } /** @@ -99,8 +92,8 @@ public String generatePresentation(List credentia public String generatePresentation(List credentials, String privateKeyAlias, String publicKeyId, Map additionalData) { // check if expected data is there - if (!additionalData.containsKey(AUDIENCE)) { - throw new IllegalArgumentException("Must provide additional data: '%s'".formatted(AUDIENCE)); + if (!additionalData.containsKey(JwtRegisteredClaimNames.AUDIENCE)) { + throw new IllegalArgumentException("Must provide additional data: '%s'".formatted(JwtRegisteredClaimNames.AUDIENCE)); } if (!additionalData.containsKey(CONTROLLER_ADDITIONAL_DATA)) { @@ -121,18 +114,18 @@ public String generatePresentation(List credentia private TokenDecorator vpDecorator(List rawVcs) { var now = Date.from(clock.instant()); - return tp -> tp.claims(ISSUER, issuerId) - .claims(ISSUED_AT, now) - .claims(NOT_BEFORE, now) - .claims(JWT_ID, UUID.randomUUID().toString()) + return tp -> tp.claims(JwtRegisteredClaimNames.ISSUER, issuerId) + .claims(JwtRegisteredClaimNames.ISSUED_AT, now) + .claims(JwtRegisteredClaimNames.NOT_BEFORE, now) + .claims(JwtRegisteredClaimNames.JWT_ID, UUID.randomUUID().toString()) .claims(VERIFIABLE_PRESENTATION_CLAIM, createVpClaim(rawVcs)) - .claims(EXPIRATION_TIME, Date.from(Instant.now().plusSeconds(60))); + .claims(JwtRegisteredClaimNames.EXPIRATION_TIME, Date.from(Instant.now().plusSeconds(60))); } private Map createVpClaim(List rawVcs) { return Map.of( - CONTEXT, List.of(IATP_CONTEXT_URL, W3C_CREDENTIALS_URL, PRESENTATION_EXCHANGE_URL), - VP_TYPE_PROPERTY, VERIFIABLE_PRESENTATION_TYPE, + JsonLdKeywords.CONTEXT, List.of(IatpConstants.IATP_CONTEXT_URL, VcConstants.W3C_CREDENTIALS_URL, VcConstants.PRESENTATION_EXCHANGE_URL), + VP_TYPE_PROPERTY, VcConstants.VERIFIABLE_PRESENTATION_TYPE, VERIFIABLE_CREDENTIAL_PROPERTY, rawVcs ); } diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGenerator.java b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGenerator.java similarity index 87% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGenerator.java rename to core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGenerator.java index b84134aef..336884344 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGenerator.java +++ b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; import com.apicatalog.vc.suite.SignatureSuite; import com.fasterxml.jackson.core.JsonProcessingException; @@ -21,10 +21,13 @@ import jakarta.json.JsonArray; import jakarta.json.JsonArrayBuilder; import jakarta.json.JsonObject; +import org.eclipse.edc.iam.identitytrust.spi.IatpConstants; import org.eclipse.edc.iam.identitytrust.spi.verification.SignatureSuiteRegistry; +import org.eclipse.edc.iam.verifiablecredentials.spi.VcConstants; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; -import org.eclipse.edc.identityhub.spi.generator.PresentationGenerator; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationGenerator; +import org.eclipse.edc.jsonld.spi.JsonLdKeywords; import org.eclipse.edc.keys.spi.PrivateKeyResolver; import org.eclipse.edc.security.signature.jws2020.JsonWebKeyPair; import org.eclipse.edc.security.signature.jws2020.Jws2020ProofDraft; @@ -42,13 +45,9 @@ import java.util.Map; import java.util.UUID; -import static org.eclipse.edc.iam.identitytrust.spi.IatpConstants.IATP_CONTEXT_URL; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.VP_TYPE_PROPERTY; -import static org.eclipse.edc.identityhub.spi.model.IdentityHubConstants.PRESENTATION_EXCHANGE_URL; -import static org.eclipse.edc.identityhub.spi.model.IdentityHubConstants.W3C_CREDENTIALS_URL; -import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.CONTROLLER_ADDITIONAL_DATA; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.VP_TYPE_PROPERTY; /** * LdpPresentationCreator is a class that implements the PresentationCreator interface to generate Verifiable Presentations based on Verifiable Credential Containers. @@ -129,8 +128,8 @@ public JsonObject generatePresentation(List crede var types = (List) additionalData.get(TYPE_ADDITIONAL_DATA); var presentationObject = Json.createObjectBuilder() - .add(CONTEXT, stringArray(List.of(W3C_CREDENTIALS_URL, PRESENTATION_EXCHANGE_URL))) - .add(ID_PROPERTY, IATP_CONTEXT_URL + "/id/" + UUID.randomUUID()) + .add(JsonLdKeywords.CONTEXT, stringArray(List.of(VcConstants.W3C_CREDENTIALS_URL, VcConstants.PRESENTATION_EXCHANGE_URL))) + .add(ID_PROPERTY, IatpConstants.IATP_CONTEXT_URL + "/id/" + UUID.randomUUID()) .add(VP_TYPE_PROPERTY, stringArray(types)) .add(HOLDER_PROPERTY, issuerId) .add(VERIFIABLE_CREDENTIAL_PROPERTY, toJsonArray(credentials)) diff --git a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorConstants.java b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorConstants.java similarity index 72% rename from core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorConstants.java rename to core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorConstants.java index b7a51a747..aefee5a13 100644 --- a/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorConstants.java +++ b/core/lib/verifiable-presentation-lib/src/main/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; /** * Contains common constants for {@link LdpPresentationGenerator} and {@link JwtPresentationGenerator}. diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImplTest.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImplTest.java similarity index 94% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImplTest.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImplTest.java index d14223542..5e42d58a9 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/PresentationCreatorRegistryImplTest.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/PresentationCreatorRegistryImplTest.java @@ -12,13 +12,13 @@ * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identithub.verifiablepresentation; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.generator.PresentationGenerator; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationGenerator; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.result.ServiceResult; import org.junit.jupiter.api.Test; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImplTest.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImplTest.java similarity index 94% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImplTest.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImplTest.java index 159db04d1..d0ec46ab6 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/VerifiablePresentationServiceImplTest.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/VerifiablePresentationServiceImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core; +package org.eclipse.edc.identithub.verifiablepresentation; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -23,7 +23,7 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; import org.eclipse.edc.iam.verifiablecredentials.spi.model.presentationdefinition.PresentationDefinition; -import org.eclipse.edc.identityhub.spi.generator.PresentationCreatorRegistry; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.PresentationCreatorRegistry; import org.eclipse.edc.jsonld.util.JacksonJsonLd; import org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames; import org.eclipse.edc.spi.monitor.Monitor; @@ -35,9 +35,9 @@ import static org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat.JSON_LD; import static org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat.JWT; -import static org.eclipse.edc.identityhub.core.creators.TestData.EMPTY_LDP_VP; -import static org.eclipse.edc.identityhub.core.creators.TestData.JWT_VP; -import static org.eclipse.edc.identityhub.core.creators.TestData.LDP_VP_WITH_PROOF; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.TestData.EMPTY_LDP_VP; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.TestData.JWT_VP; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.TestData.LDP_VP_WITH_PROOF; import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyList; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGeneratorTest.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGeneratorTest.java similarity index 94% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGeneratorTest.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGeneratorTest.java index 0202afc21..7ba598a3a 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/JwtPresentationGeneratorTest.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/JwtPresentationGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JWSHeader; @@ -40,8 +40,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNoException; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.eclipse.edc.identityhub.core.creators.JwtPresentationGenerator.VERIFIABLE_PRESENTATION_CLAIM; -import static org.eclipse.edc.identityhub.core.creators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.JwtPresentationGenerator.VERIFIABLE_PRESENTATION_CLAIM; +import static org.eclipse.edc.identithub.verifiablepresentation.generators.PresentationGeneratorConstants.VERIFIABLE_CREDENTIAL_PROPERTY; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGeneratorTest.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGeneratorTest.java similarity index 97% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGeneratorTest.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGeneratorTest.java index 2cc1c0942..784c0d7fc 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGeneratorTest.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/LdpPresentationGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; import com.fasterxml.jackson.databind.ObjectMapper; import com.nimbusds.jose.jwk.Curve; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorTest.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorTest.java similarity index 92% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorTest.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorTest.java index 5d4fad1a7..845df86d2 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/PresentationGeneratorTest.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/PresentationGeneratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.Curve; diff --git a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/TestData.java b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/TestData.java similarity index 97% rename from core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/TestData.java rename to core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/TestData.java index d711d3e89..e56efac4a 100644 --- a/core/identity-hub-credentials/src/test/java/org/eclipse/edc/identityhub/core/creators/TestData.java +++ b/core/lib/verifiable-presentation-lib/src/test/java/org/eclipse/edc/identithub/verifiablepresentation/generators/TestData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identityhub.core.creators; +package org.eclipse.edc.identithub.verifiablepresentation.generators; public interface TestData { String LDP_VC_WITH_PROOF = """ diff --git a/core/identity-hub-credentials/src/test/resources/credentials.v1.json b/core/lib/verifiable-presentation-lib/src/test/resources/credentials.v1.json similarity index 100% rename from core/identity-hub-credentials/src/test/resources/credentials.v1.json rename to core/lib/verifiable-presentation-lib/src/test/resources/credentials.v1.json diff --git a/core/identity-hub-credentials/src/test/resources/did.json b/core/lib/verifiable-presentation-lib/src/test/resources/did.json similarity index 100% rename from core/identity-hub-credentials/src/test/resources/did.json rename to core/lib/verifiable-presentation-lib/src/test/resources/did.json diff --git a/core/identity-hub-credentials/src/test/resources/examples.v1.json b/core/lib/verifiable-presentation-lib/src/test/resources/examples.v1.json similarity index 100% rename from core/identity-hub-credentials/src/test/resources/examples.v1.json rename to core/lib/verifiable-presentation-lib/src/test/resources/examples.v1.json diff --git a/core/identity-hub-credentials/src/test/resources/presentation-query.v08.json b/core/lib/verifiable-presentation-lib/src/test/resources/iatp.v08.json similarity index 81% rename from core/identity-hub-credentials/src/test/resources/presentation-query.v08.json rename to core/lib/verifiable-presentation-lib/src/test/resources/iatp.v08.json index 3f5e46ab2..68d33163e 100644 --- a/core/identity-hub-credentials/src/test/resources/presentation-query.v08.json +++ b/core/lib/verifiable-presentation-lib/src/test/resources/iatp.v08.json @@ -1,7 +1,7 @@ { "@context": { "@version": 1.1, - "@protected": false, + "@protected": true, "iatp": "https://w3id.org/tractusx-trust/v0.8/", "cred": "https://www.w3.org/2018/credentials/", "xsd": "http://www.w3.org/2001/XMLSchema/", @@ -86,8 +86,28 @@ "PresentationQueryMessage": { "@id": "iatp:PresentationQueryMessage", "@context": { - "presentationDefinition": "iatp:presentationDefinition", - "scope": "iatp:scope" + "presentationDefinition": { + "@id": "iatp:presentationDefinition", + "@type": "@json" + }, + "scope": { + "@id": "iatp:scope", + "@type": "xsd:string", + "@container": "@set" + } + } + }, + "PresentationResponseMessage": { + "@id": "iatp:PresentationResponseMessage", + "@context": { + "presentation": { + "@id": "iatp:presentation", + "@type": "@json" + }, + "presentationSubmission": { + "@id": "iatp:presentationSubmission", + "@type": "@json" + } } }, "credentials": { @@ -102,15 +122,6 @@ "@id": "iatp:format", "@type": "xsd:string" }, - "presentationDefinition": { - "@id": "iatp:presentationDefinition", - "@type": "@json" - }, - "scope": { - "@id": "iatp:scope", - "@type": "xsd:string", - "@container": "@set" - }, "type": "@type" } -} \ No newline at end of file +} diff --git a/core/identity-hub-credentials/src/test/resources/jws2020.json b/core/lib/verifiable-presentation-lib/src/test/resources/jws2020.json similarity index 100% rename from core/identity-hub-credentials/src/test/resources/jws2020.json rename to core/lib/verifiable-presentation-lib/src/test/resources/jws2020.json diff --git a/core/identity-hub-credentials/src/test/resources/odrl.jsonld b/core/lib/verifiable-presentation-lib/src/test/resources/odrl.jsonld similarity index 100% rename from core/identity-hub-credentials/src/test/resources/odrl.jsonld rename to core/lib/verifiable-presentation-lib/src/test/resources/odrl.jsonld diff --git a/core/identity-hub-credentials/src/test/resources/presentation-exchange.v1.json b/core/lib/verifiable-presentation-lib/src/test/resources/presentation-exchange.v1.json similarity index 100% rename from core/identity-hub-credentials/src/test/resources/presentation-exchange.v1.json rename to core/lib/verifiable-presentation-lib/src/test/resources/presentation-exchange.v1.json diff --git a/core/identity-hub-api/build.gradle.kts b/core/presentation-api/build.gradle.kts similarity index 90% rename from core/identity-hub-api/build.gradle.kts rename to core/presentation-api/build.gradle.kts index 8e35a9c9e..5225ad0d1 100644 --- a/core/identity-hub-api/build.gradle.kts +++ b/core/presentation-api/build.gradle.kts @@ -19,10 +19,11 @@ plugins { } dependencies { + api(project(":spi:identity-hub-spi")) + api(project(":spi:verifiable-credential-spi")) api(libs.edc.spi.jsonld) api(libs.edc.spi.jwt) api(libs.edc.spi.core) - api(project(":spi:identity-hub-spi")) implementation(libs.edc.spi.validator) implementation(libs.edc.spi.web) implementation(libs.edc.spi.iatp) @@ -33,7 +34,7 @@ dependencies { testImplementation(libs.edc.junit) testImplementation(libs.edc.ext.jsonld) testImplementation(testFixtures(libs.edc.core.jersey)) - testImplementation(testFixtures(project(":spi:identity-hub-spi"))) + testImplementation(testFixtures(project(":spi:verifiable-credential-spi"))) testImplementation(libs.nimbus.jwt) } diff --git a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java similarity index 93% rename from core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java rename to core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java index cf7039acd..8ac06a58e 100644 --- a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java +++ b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/PresentationApiExtension.java @@ -19,9 +19,9 @@ import org.eclipse.edc.iam.identitytrust.transform.to.JsonObjectToPresentationQueryTransformer; import org.eclipse.edc.identityhub.api.v1.PresentationApiController; import org.eclipse.edc.identityhub.api.validation.PresentationQueryValidator; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; import org.eclipse.edc.jsonld.spi.JsonLd; import org.eclipse.edc.runtime.metamodel.annotation.Extension; diff --git a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/ApiSchema.java b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/ApiSchema.java similarity index 100% rename from core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/ApiSchema.java rename to core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/ApiSchema.java diff --git a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApi.java b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApi.java similarity index 100% rename from core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApi.java rename to core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApi.java diff --git a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java similarity index 93% rename from core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java rename to core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java index d83dc110f..381846259 100644 --- a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java +++ b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/v1/PresentationApiController.java @@ -24,10 +24,10 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.Response; import org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; import org.eclipse.edc.jwt.spi.JwtRegisteredClaimNames; import org.eclipse.edc.spi.EdcException; @@ -47,7 +47,7 @@ import static jakarta.ws.rs.core.HttpHeaders.AUTHORIZATION; import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import static org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage.PRESENTATION_QUERY_MESSAGE_TYPE_PROPERTY; -import static org.eclipse.edc.identityhub.spi.ParticipantContextId.onEncoded; +import static org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextId.onEncoded; import static org.eclipse.edc.web.spi.exception.ServiceResultHandler.exceptionMapper; @Consumes(APPLICATION_JSON) diff --git a/core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/validation/PresentationQueryValidator.java b/core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/validation/PresentationQueryValidator.java similarity index 100% rename from core/identity-hub-api/src/main/java/org/eclipse/edc/identityhub/api/validation/PresentationQueryValidator.java rename to core/presentation-api/src/main/java/org/eclipse/edc/identityhub/api/validation/PresentationQueryValidator.java diff --git a/core/identity-hub-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/core/presentation-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from core/identity-hub-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to core/presentation-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/core/identity-hub-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java b/core/presentation-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java similarity index 93% rename from core/identity-hub-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java rename to core/presentation-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java index 12f1ec04d..e8bc76db7 100644 --- a/core/identity-hub-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java +++ b/core/presentation-api/src/test/java/org/eclipse/edc/identityservice/api/v1/PresentationApiControllerTest.java @@ -23,11 +23,11 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.credentialservice.PresentationSubmission; import org.eclipse.edc.iam.verifiablecredentials.spi.model.presentationdefinition.PresentationDefinition; import org.eclipse.edc.identityhub.api.v1.PresentationApiController; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; -import org.eclipse.edc.identityhub.spi.resolution.QueryResult; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryResult; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.spi.EdcException; @@ -53,9 +53,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage.PRESENTATION_QUERY_MESSAGE_TYPE_PROPERTY; -import static org.eclipse.edc.identityhub.junit.testfixtures.VerifiableCredentialTestUtil.buildSignedJwt; -import static org.eclipse.edc.identityhub.junit.testfixtures.VerifiableCredentialTestUtil.generateEcKey; -import static org.eclipse.edc.identityhub.spi.resolution.QueryResult.success; +import static org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.VerifiableCredentialTestUtil.buildSignedJwt; +import static org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.VerifiableCredentialTestUtil.generateEcKey; import static org.eclipse.edc.validator.spi.ValidationResult.failure; import static org.eclipse.edc.validator.spi.ValidationResult.success; import static org.eclipse.edc.validator.spi.Violation.violation; @@ -160,7 +159,7 @@ void query_presentationGenerationFails_shouldReturn500() { var presentationQueryBuilder = createPresentationQueryBuilder().build(); when(typeTransformerRegistry.transform(isA(JsonObject.class), eq(PresentationQueryMessage.class))).thenReturn(Result.success(presentationQueryBuilder)); when(accessTokenVerifier.verify(anyString(), anyString())).thenReturn(Result.success(List.of("test-scope1"))); - when(queryResolver.query(anyString(), any(), eq(List.of("test-scope1")))).thenReturn(success(Stream.empty())); + when(queryResolver.query(anyString(), any(), eq(List.of("test-scope1")))).thenReturn(QueryResult.success(Stream.empty())); when(generator.createPresentation(anyString(), anyList(), any(), any())).thenReturn(Result.failure("test-failure")); @@ -175,7 +174,7 @@ void query_success() { var presentationQueryBuilder = createPresentationQueryBuilder().build(); when(typeTransformerRegistry.transform(isA(JsonObject.class), eq(PresentationQueryMessage.class))).thenReturn(Result.success(presentationQueryBuilder)); when(accessTokenVerifier.verify(anyString(), anyString())).thenReturn(Result.success(List.of("test-scope1"))); - when(queryResolver.query(anyString(), any(), eq(List.of("test-scope1")))).thenReturn(success(Stream.empty())); + when(queryResolver.query(anyString(), any(), eq(List.of("test-scope1")))).thenReturn(QueryResult.success(Stream.empty())); var pres = PresentationResponseMessage.Builder.newinstance().presentation(List.of(generateJwt())) .presentationSubmission(new PresentationSubmission("id", "def-id", List.of(new InputDescriptorMapping("id", "ldp_vp", "$.verifiableCredentials[0]")))) diff --git a/core/identity-hub-api/src/test/java/org/eclipse/edc/identityservice/api/validation/PresentationQueryValidatorTest.java b/core/presentation-api/src/test/java/org/eclipse/edc/identityservice/api/validation/PresentationQueryValidatorTest.java similarity index 100% rename from core/identity-hub-api/src/test/java/org/eclipse/edc/identityservice/api/validation/PresentationQueryValidatorTest.java rename to core/presentation-api/src/test/java/org/eclipse/edc/identityservice/api/validation/PresentationQueryValidatorTest.java diff --git a/e2e-tests/api-tests/build.gradle.kts b/e2e-tests/api-tests/build.gradle.kts index 9d5462cb7..0ed2d2fb9 100644 --- a/e2e-tests/api-tests/build.gradle.kts +++ b/e2e-tests/api-tests/build.gradle.kts @@ -12,8 +12,8 @@ dependencies { testImplementation(libs.awaitility) testImplementation(libs.testcontainers.junit) // needed for the Participant + testImplementation(testFixtures(project(":spi:verifiable-credential-spi"))) testImplementation(testFixtures(libs.edc.testfixtures.managementapi)) - testImplementation(testFixtures(project(":spi:identity-hub-spi"))) testImplementation(libs.nimbus.jwt) testImplementation(libs.jakarta.rsApi) } diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/DidManagementApiEndToEndTest.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/DidManagementApiEndToEndTest.java index 4a7b5ea6d..bf4222f20 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/DidManagementApiEndToEndTest.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/DidManagementApiEndToEndTest.java @@ -16,9 +16,9 @@ import io.restassured.http.Header; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentPublished; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentUnpublished; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentPublished; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentUnpublished; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.spi.event.EventRouter; import org.eclipse.edc.spi.event.EventSubscriber; diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/KeyPairResourceApiEndToEndTest.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/KeyPairResourceApiEndToEndTest.java index 8c9993bfc..1f1f1e9b3 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/KeyPairResourceApiEndToEndTest.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/KeyPairResourceApiEndToEndTest.java @@ -16,13 +16,13 @@ import com.nimbusds.jose.jwk.Curve; import io.restassured.http.Header; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairAdded; -import org.eclipse.edc.identityhub.spi.events.keypair.KeyPairRotated; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairAdded; +import org.eclipse.edc.identityhub.spi.keypair.events.KeyPairRotated; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.event.EventRouter; diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ManagementApiEndToEndTest.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ManagementApiEndToEndTest.java index c861cb128..fb14d177f 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ManagementApiEndToEndTest.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ManagementApiEndToEndTest.java @@ -16,15 +16,15 @@ import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; import org.eclipse.edc.identityhub.participantcontext.ApiTokenGenerator; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.identityhub.tests.fixtures.IdentityHubRuntimeConfiguration; diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ParticipantContextApiEndToEndTest.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ParticipantContextApiEndToEndTest.java index 67746ec62..92d10e2da 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ParticipantContextApiEndToEndTest.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ParticipantContextApiEndToEndTest.java @@ -16,12 +16,12 @@ import io.restassured.http.ContentType; import io.restassured.http.Header; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextCreated; -import org.eclipse.edc.identityhub.spi.events.participant.ParticipantContextUpdated; -import org.eclipse.edc.identityhub.spi.model.KeyPairState; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextCreated; +import org.eclipse.edc.identityhub.spi.participantcontext.events.ParticipantContextUpdated; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState; import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.event.EventRouter; diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/PresentationApiComponentTest.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/PresentationApiComponentTest.java index 93625ba4e..52097450c 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/PresentationApiComponentTest.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/PresentationApiComponentTest.java @@ -20,16 +20,16 @@ import org.eclipse.edc.iam.identitytrust.spi.model.PresentationResponseMessage; import org.eclipse.edc.iam.verifiablecredentials.spi.model.credentialservice.InputDescriptorMapping; import org.eclipse.edc.iam.verifiablecredentials.spi.model.credentialservice.PresentationSubmission; -import org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.generator.VerifiablePresentationService; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; -import org.eclipse.edc.identityhub.spi.resolution.CredentialQueryResolver; -import org.eclipse.edc.identityhub.spi.resolution.QueryResult; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.generator.VerifiablePresentationService; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.CredentialQueryResolver; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryResult; import org.eclipse.edc.identityhub.spi.verification.AccessTokenVerifier; import org.eclipse.edc.identityhub.tests.fixtures.IdentityHubRuntimeConfiguration; import org.eclipse.edc.identityhub.tests.fixtures.TestData; +import org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.JwtCreationUtil; import org.eclipse.edc.junit.annotations.ComponentTest; import org.eclipse.edc.junit.extensions.EdcRuntimeExtension; import org.eclipse.edc.spi.result.Result; @@ -45,7 +45,7 @@ import static io.restassured.http.ContentType.JSON; import static jakarta.ws.rs.core.HttpHeaders.AUTHORIZATION; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.identityhub.junit.testfixtures.JwtCreationUtil.generateSiToken; +import static org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.JwtCreationUtil.generateSiToken; import static org.eclipse.edc.spi.result.Result.failure; import static org.eclipse.edc.spi.result.Result.success; import static org.hamcrest.Matchers.equalTo; diff --git a/extensions/api/identityhub-api-authentication/build.gradle.kts b/extensions/api/identityhub-api-authentication/build.gradle.kts index 4f005d85a..f6ebf6c89 100644 --- a/extensions/api/identityhub-api-authentication/build.gradle.kts +++ b/extensions/api/identityhub-api-authentication/build.gradle.kts @@ -20,7 +20,7 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) implementation(libs.edc.spi.web) implementation(libs.edc.core.jerseyproviders) diff --git a/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthenticationExtension.java b/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthenticationExtension.java index 630ffdacf..6a7bbdff8 100644 --- a/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthenticationExtension.java +++ b/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthenticationExtension.java @@ -17,7 +17,7 @@ import org.eclipse.edc.identityhub.api.authentication.filter.RoleBasedAccessFeature; import org.eclipse.edc.identityhub.api.authentication.filter.ServicePrincipalAuthenticationFilter; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.spi.security.Vault; diff --git a/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ParticipantServicePrincipalResolver.java b/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ParticipantServicePrincipalResolver.java index c72874115..5f9b95bf6 100644 --- a/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ParticipantServicePrincipalResolver.java +++ b/extensions/api/identityhub-api-authentication/src/main/java/org/eclipse/edc/identityhub/api/ParticipantServicePrincipalResolver.java @@ -15,10 +15,10 @@ package org.eclipse.edc.identityhub.api; import org.eclipse.edc.identityhub.api.authentication.filter.ServicePrincipalAuthenticationFilter; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipalResolver; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.spi.security.Vault; import org.eclipse.edc.web.spi.exception.AuthenticationFailedException; diff --git a/extensions/api/identityhub-api-authorization/build.gradle.kts b/extensions/api/identityhub-api-authorization/build.gradle.kts index 1d9b1fc81..f5d60568d 100644 --- a/extensions/api/identityhub-api-authorization/build.gradle.kts +++ b/extensions/api/identityhub-api-authorization/build.gradle.kts @@ -20,7 +20,7 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) implementation(libs.edc.spi.web) implementation(libs.edc.core.jerseyproviders) diff --git a/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImpl.java b/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImpl.java index 2a91a8d2f..de739b1be 100644 --- a/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImpl.java +++ b/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImpl.java @@ -17,7 +17,7 @@ import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.spi.result.ServiceResult; import java.util.HashMap; diff --git a/extensions/api/identityhub-api-authorization/src/test/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImplTest.java b/extensions/api/identityhub-api-authorization/src/test/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImplTest.java index fb2fef7a2..9f00309b0 100644 --- a/extensions/api/identityhub-api-authorization/src/test/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImplTest.java +++ b/extensions/api/identityhub-api-authorization/src/test/java/org/eclipse/edc/identityhub/api/authorization/AuthorizationServiceImplTest.java @@ -15,7 +15,7 @@ package org.eclipse.edc.identityhub.api.authorization; import jakarta.ws.rs.core.SecurityContext; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.junit.jupiter.api.Test; import java.security.Principal; diff --git a/extensions/api/identityhub-management-api-configuration/build.gradle.kts b/extensions/api/management-api/api-configuration/build.gradle.kts similarity index 94% rename from extensions/api/identityhub-management-api-configuration/build.gradle.kts rename to extensions/api/management-api/api-configuration/build.gradle.kts index 1fffa62fe..b73c1fc7a 100644 --- a/extensions/api/identityhub-management-api-configuration/build.gradle.kts +++ b/extensions/api/management-api/api-configuration/build.gradle.kts @@ -20,7 +20,7 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) // api(project(":extensions:api:identityhub-api-auth")) implementation(libs.edc.spi.web) implementation(libs.edc.core.jerseyproviders) diff --git a/extensions/api/identityhub-management-api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java b/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java similarity index 95% rename from extensions/api/identityhub-management-api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java rename to extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java index c403d0be8..2c2090a40 100644 --- a/extensions/api/identityhub-management-api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java +++ b/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java @@ -17,8 +17,8 @@ import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.runtime.metamodel.annotation.Provider; diff --git a/extensions/api/identityhub-management-api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationImpl.java b/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationImpl.java similarity index 100% rename from extensions/api/identityhub-management-api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationImpl.java rename to extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationImpl.java diff --git a/extensions/api/identityhub-management-api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/management-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/identityhub-management-api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/management-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/did-mgmt-api/build.gradle.kts b/extensions/api/management-api/did-api/build.gradle.kts similarity index 84% rename from extensions/api/did-mgmt-api/build.gradle.kts rename to extensions/api/management-api/did-api/build.gradle.kts index ede7494e0..9bf74ff23 100644 --- a/extensions/api/did-mgmt-api/build.gradle.kts +++ b/extensions/api/management-api/did-api/build.gradle.kts @@ -21,9 +21,9 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) - implementation(project(":extensions:api:identityhub-management-api-configuration")) - implementation(project(":extensions:api:identityhub-management-api-validators")) + api(project(":spi:did-spi")) + implementation(project(":extensions:api:management-api:api-configuration")) + implementation(project(":extensions:api:management-api:validators")) implementation(libs.edc.spi.validator) implementation(libs.edc.spi.web) implementation(libs.edc.core.jerseyproviders) diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java similarity index 94% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java index d39c4d817..39f0fcad2 100644 --- a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java +++ b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.api.didmanagement; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identithub.did.spi.model.DidResource; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.model.DidResource; import org.eclipse.edc.identityhub.api.didmanagement.v1.DidManagementApiController; import org.eclipse.edc.identityhub.api.didmanagement.v1.GetAllDidsApiController; import org.eclipse.edc.identityhub.spi.AuthorizationService; diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApi.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApi.java similarity index 100% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApi.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApi.java diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java similarity index 96% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java index 5909f52a6..a0a42ed5a 100644 --- a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java +++ b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiController.java @@ -26,9 +26,9 @@ import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidRequestPayload.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidRequestPayload.java similarity index 100% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidRequestPayload.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidRequestPayload.java diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApi.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApi.java similarity index 100% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApi.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApi.java diff --git a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java similarity index 97% rename from extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java rename to extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java index 9a575d603..dbb884089 100644 --- a/extensions/api/did-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java +++ b/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiController.java @@ -23,7 +23,7 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.web.spi.exception.InvalidRequestException; diff --git a/extensions/api/did-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/management-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/did-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/management-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java b/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java similarity index 99% rename from extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java rename to extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java index fd656fbed..08a36c19f 100644 --- a/extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java +++ b/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/DidManagementApiControllerTest.java @@ -17,8 +17,8 @@ import io.restassured.specification.RequestSpecification; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; -import org.eclipse.edc.identithub.did.spi.model.DidResource; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.model.DidResource; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.spi.query.Criterion; diff --git a/extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java b/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java similarity index 96% rename from extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java rename to extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java index 01f5979a3..9330db61f 100644 --- a/extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java +++ b/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/GetAllDidsApiControllerTest.java @@ -15,7 +15,7 @@ package org.eclipse.edc.identityhub.api.didmanagement.v1; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.DidDocumentService; +import org.eclipse.edc.identithub.spi.did.DidDocumentService; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; import org.junit.jupiter.api.Test; diff --git a/extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/TestFunctions.java b/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/TestFunctions.java similarity index 100% rename from extensions/api/did-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/TestFunctions.java rename to extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/TestFunctions.java diff --git a/extensions/api/keypair-mgmt-api/build.gradle.kts b/extensions/api/management-api/keypair-api/build.gradle.kts similarity index 76% rename from extensions/api/keypair-mgmt-api/build.gradle.kts rename to extensions/api/management-api/keypair-api/build.gradle.kts index 0718df53c..a711672f9 100644 --- a/extensions/api/keypair-mgmt-api/build.gradle.kts +++ b/extensions/api/management-api/keypair-api/build.gradle.kts @@ -7,9 +7,10 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) + api(project(":spi:keypair-spi")) api(project(":spi:identity-hub-store-spi")) - implementation(project(":extensions:api:identityhub-management-api-configuration")) - implementation(project(":extensions:api:identityhub-management-api-validators")) + implementation(project(":extensions:api:management-api:api-configuration")) + implementation(project(":extensions:api:management-api:validators")) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) implementation(libs.jakarta.rsApi) diff --git a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java similarity index 92% rename from extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java rename to extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java index eff465282..68d2592e7 100644 --- a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java +++ b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java @@ -18,10 +18,10 @@ import org.eclipse.edc.identityhub.api.keypair.v1.KeyPairResourceApiController; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.KeyPairService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.spi.EdcException; diff --git a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java similarity index 96% rename from extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java rename to extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java index 3b995a17c..5e788f111 100644 --- a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java +++ b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApi.java @@ -23,7 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; import org.eclipse.edc.web.spi.ApiErrorDetail; import java.util.Collection; @@ -38,7 +38,7 @@ public interface GetAllKeyPairsApi { operationId = "getAllKeyPairs", parameters = { @Parameter(name = "offset", description = "the paging offset. defaults to 0"), - @Parameter(name = "limit", description = "the page size. defaults to 50")}, + @Parameter(name = "limit", description = "the page size. defaults to 50") }, responses = { @ApiResponse(responseCode = "200", description = "The list of KeyPair resources.", content = @Content(array = @ArraySchema(schema = @Schema(implementation = KeyPairResource.class)))), diff --git a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java similarity index 93% rename from extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java rename to extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java index a877cc1fa..a365b72da 100644 --- a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java +++ b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/GetAllKeyPairsApiController.java @@ -21,9 +21,9 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; -import org.eclipse.edc.identityhub.spi.KeyPairService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; import org.eclipse.edc.spi.query.QuerySpec; import java.util.Collection; diff --git a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java similarity index 98% rename from extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java rename to extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java index 52398eda2..8314552ee 100644 --- a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java +++ b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApi.java @@ -26,9 +26,9 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.core.SecurityContext; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.web.spi.ApiErrorDetail; import java.util.Collection; diff --git a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java similarity index 92% rename from extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java rename to extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java index 57ef070ca..ca73d3453 100644 --- a/extensions/api/keypair-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java +++ b/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiController.java @@ -26,11 +26,11 @@ import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.spi.EdcException; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; @@ -43,7 +43,7 @@ import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import static org.eclipse.edc.identityhub.spi.AuthorizationResultHandler.exceptionMapper; -import static org.eclipse.edc.identityhub.spi.ParticipantContextId.onEncoded; +import static org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextId.onEncoded; @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) diff --git a/extensions/api/keypair-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/management-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/keypair-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/management-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/keypair-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java b/extensions/api/management-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java similarity index 98% rename from extensions/api/keypair-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java rename to extensions/api/management-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java index 6911446df..833d62cd6 100644 --- a/extensions/api/keypair-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java +++ b/extensions/api/management-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/KeyPairResourceApiControllerTest.java @@ -18,9 +18,9 @@ import io.restassured.specification.RequestSpecification; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.KeyPairService; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; diff --git a/extensions/api/participant-context-mgmt-api/build.gradle.kts b/extensions/api/management-api/participant-context-api/build.gradle.kts similarity index 84% rename from extensions/api/participant-context-mgmt-api/build.gradle.kts rename to extensions/api/management-api/participant-context-api/build.gradle.kts index 0b140a8e0..a74ddcd2e 100644 --- a/extensions/api/participant-context-mgmt-api/build.gradle.kts +++ b/extensions/api/management-api/participant-context-api/build.gradle.kts @@ -21,9 +21,9 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) - implementation(project(":extensions:api:identityhub-management-api-configuration")) - implementation(project(":extensions:api:identityhub-management-api-validators")) + api(project(":spi:did-spi")) + implementation(project(":extensions:api:management-api:api-configuration")) + implementation(project(":extensions:api:management-api:validators")) implementation(libs.edc.spi.validator) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) diff --git a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java similarity index 93% rename from extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java rename to extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java index adb554aa4..95cabda45 100644 --- a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java +++ b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java @@ -18,8 +18,8 @@ import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.spi.monitor.Monitor; diff --git a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java similarity index 94% rename from extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java rename to extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java index db59fce05..c2adf2ae0 100644 --- a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java +++ b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApi.java @@ -25,8 +25,8 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.core.SecurityContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.web.spi.ApiErrorDetail; import java.util.Collection; @@ -72,7 +72,7 @@ public interface ParticipantContextApi { operationId = "regenerateParticipantToken", requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = ParticipantManifest.class), mediaType = "application/json")), responses = { - @ApiResponse(responseCode = "200", description = "The API token was regenerated successfully", content = {@Content(schema = @Schema(implementation = String.class))}), + @ApiResponse(responseCode = "200", description = "The API token was regenerated successfully", content = { @Content(schema = @Schema(implementation = String.class)) }), @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiErrorDetail.class)), mediaType = "application/json")), @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", @@ -86,9 +86,9 @@ public interface ParticipantContextApi { @Operation(description = "Activates a ParticipantContext. This operation is idempotent, i.e. activating an already active ParticipantContext is a NOOP.", operationId = "activateParticipant", requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = ParticipantManifest.class), mediaType = "application/json")), - parameters = {@Parameter(name = "isActive", description = "Whether the participantContext should be activated or deactivated. Defaults to 'false'")}, + parameters = { @Parameter(name = "isActive", description = "Whether the participantContext should be activated or deactivated. Defaults to 'false'") }, responses = { - @ApiResponse(responseCode = "200", description = "The ParticipantContext was activated/deactivated successfully", content = {@Content(schema = @Schema(implementation = String.class))}), + @ApiResponse(responseCode = "200", description = "The ParticipantContext was activated/deactivated successfully", content = { @Content(schema = @Schema(implementation = String.class)) }), @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiErrorDetail.class)), mediaType = "application/json")), @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", @@ -102,7 +102,7 @@ public interface ParticipantContextApi { @Operation(description = "Delete a ParticipantContext.", operationId = "deleteParticipant", responses = { - @ApiResponse(responseCode = "200", description = "The ParticipantContext was deleted successfully", content = {@Content(schema = @Schema(implementation = String.class))}), + @ApiResponse(responseCode = "200", description = "The ParticipantContext was deleted successfully", content = { @Content(schema = @Schema(implementation = String.class)) }), @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiErrorDetail.class)), mediaType = "application/json")), @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", @@ -132,7 +132,7 @@ public interface ParticipantContextApi { operationId = "getAllParticipants", parameters = { @Parameter(name = "offset", description = "the paging offset. defaults to 0"), - @Parameter(name = "limit", description = "the page size. defaults to 50")}, + @Parameter(name = "limit", description = "the page size. defaults to 50") }, responses = { @ApiResponse(responseCode = "200", description = "The list of ParticipantContexts.", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ParticipantContext.class)))), diff --git a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java similarity index 94% rename from extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java rename to extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java index 7e63d166f..95a62b7fa 100644 --- a/extensions/api/participant-context-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java +++ b/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiController.java @@ -29,10 +29,10 @@ import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.web.spi.exception.InvalidRequestException; import org.eclipse.edc.web.spi.exception.ValidationFailureException; @@ -42,7 +42,7 @@ import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import static org.eclipse.edc.identityhub.spi.AuthorizationResultHandler.exceptionMapper; -import static org.eclipse.edc.identityhub.spi.ParticipantContextId.onEncoded; +import static org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextId.onEncoded; @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) diff --git a/extensions/api/participant-context-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/management-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/participant-context-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/management-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java similarity index 96% rename from extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java rename to extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java index 10ea04ee1..54f74e3aa 100644 --- a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java +++ b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/ParticipantContextApiControllerTest.java @@ -21,11 +21,11 @@ import io.restassured.specification.RequestSpecification; import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.ParticipantContextService; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.validator.spi.ValidationResult; diff --git a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java similarity index 94% rename from extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java rename to extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java index ab2fa7f44..be92290f6 100644 --- a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java +++ b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/KeyDescriptorTest.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; import org.junit.jupiter.api.Test; import java.util.Map; diff --git a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java similarity index 91% rename from extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java rename to extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java index e49ec7b93..fcdd3bb4e 100644 --- a/extensions/api/participant-context-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java +++ b/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/model/ParticipantManifestTest.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.junit.jupiter.api.Test; import java.util.Map; diff --git a/extensions/api/identityhub-management-api-validators/build.gradle.kts b/extensions/api/management-api/validators/build.gradle.kts similarity index 82% rename from extensions/api/identityhub-management-api-validators/build.gradle.kts rename to extensions/api/management-api/validators/build.gradle.kts index 3fa534a74..aee3def03 100644 --- a/extensions/api/identityhub-management-api-validators/build.gradle.kts +++ b/extensions/api/management-api/validators/build.gradle.kts @@ -6,7 +6,7 @@ plugins { dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) implementation(libs.edc.lib.util) testImplementation(libs.edc.junit) diff --git a/extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java b/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java similarity index 97% rename from extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java rename to extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java index 29f8e1047..0c346a8a1 100644 --- a/extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java +++ b/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java @@ -15,7 +15,7 @@ package org.eclipse.edc.identityhub.api.v1.validation; import org.eclipse.edc.iam.did.spi.document.DidConstants; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.util.string.StringUtils; import org.eclipse.edc.validator.spi.ValidationResult; diff --git a/extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java b/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java similarity index 96% rename from extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java rename to extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java index f51dc6dad..628026032 100644 --- a/extensions/api/identityhub-management-api-validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java +++ b/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.api.v1.validation; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.util.string.StringUtils; import org.eclipse.edc.validator.spi.ValidationResult; diff --git a/extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java b/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java similarity index 98% rename from extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java rename to extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java index 11fa6f146..0305803ac 100644 --- a/extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java +++ b/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.api.v1.validation; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; import org.eclipse.edc.spi.monitor.ConsoleMonitor; import org.junit.jupiter.api.Test; @@ -111,5 +111,5 @@ void validate_publicKeyPemAndGeneratorParams() { assertThat(validator.validate(descriptor)).isFailed() .detail().isEqualTo("Either the public key is specified (PEM or JWK), or the generator params are provided, not both."); } - + } \ No newline at end of file diff --git a/extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java b/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java similarity index 92% rename from extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java rename to extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java index 85a869cd2..39b76e066 100644 --- a/extensions/api/identityhub-management-api-validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java +++ b/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java @@ -15,8 +15,8 @@ package org.eclipse.edc.identityhub.api.v1.validation; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest; +import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest; import org.eclipse.edc.spi.monitor.ConsoleMonitor; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; @@ -78,7 +78,7 @@ void validate_keyDescriptorInvalid() { } @ParameterizedTest - @ValueSource(strings = {"", " ", "\n"}) + @ValueSource(strings = { "", " ", "\n" }) @NullAndEmptySource void validate_didInvalid(String did) { var manifest = createManifest().did(did).build(); @@ -87,7 +87,7 @@ void validate_didInvalid(String did) { } @ParameterizedTest - @ValueSource(strings = {"", " ", "\n"}) + @ValueSource(strings = { "", " ", "\n" }) @NullAndEmptySource void validate_participantIdNull(String participantId) { var manifest = createManifest().participantId(participantId).build(); diff --git a/extensions/api/verifiable-credential-mgmt-api/build.gradle.kts b/extensions/api/management-api/verifiable-credentials-api/build.gradle.kts similarity index 82% rename from extensions/api/verifiable-credential-mgmt-api/build.gradle.kts rename to extensions/api/management-api/verifiable-credentials-api/build.gradle.kts index a39d19605..328931ea4 100644 --- a/extensions/api/verifiable-credential-mgmt-api/build.gradle.kts +++ b/extensions/api/management-api/verifiable-credentials-api/build.gradle.kts @@ -8,7 +8,8 @@ dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) api(project(":spi:identity-hub-store-spi")) - implementation(project(":extensions:api:identityhub-management-api-configuration")) + api(project(":spi:verifiable-credential-spi")) + implementation(project(":extensions:api:management-api:api-configuration")) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) implementation(libs.jakarta.rsApi) diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java similarity index 93% rename from extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java rename to extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java index 361fe3275..b2c8f68f9 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java @@ -18,9 +18,9 @@ import org.eclipse.edc.identityhub.api.verifiablecredentials.v1.VerifiableCredentialsApiController; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; -import org.eclipse.edc.identityhub.spi.model.ParticipantResource; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.spi.EdcException; diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java similarity index 95% rename from extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java rename to extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java index d1b88282c..b25d7c9d8 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApi.java @@ -23,7 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.web.spi.ApiErrorDetail; import java.util.Collection; @@ -37,7 +37,7 @@ public interface GetAllCredentialsApi { operationId = "getAllCredentials", parameters = { @Parameter(name = "offset", description = "the paging offset. defaults to 0"), - @Parameter(name = "limit", description = "the page size. defaults to 50")}, + @Parameter(name = "limit", description = "the page size. defaults to 50") }, responses = { @ApiResponse(responseCode = "200", description = "The list of VerifiableCredential resources.", content = @Content(array = @ArraySchema(schema = @Schema(implementation = VerifiableCredentialResource.class)))), diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java similarity index 95% rename from extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java rename to extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java index 425adfa7d..bbf5231c8 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/GetAllCredentialsApiController.java @@ -22,8 +22,8 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java similarity index 95% rename from extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java rename to extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java index 01800dd86..3f06663ed 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApi.java @@ -26,8 +26,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.web.spi.ApiErrorDetail; import java.util.Collection; @@ -78,7 +78,7 @@ public interface VerifiableCredentialsApi { @Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH), }, responses = { - @ApiResponse(responseCode = "200", description = "The VerifiableCredential was deleted successfully", content = {@Content(schema = @Schema(implementation = String.class))}), + @ApiResponse(responseCode = "200", description = "The VerifiableCredential was deleted successfully", content = { @Content(schema = @Schema(implementation = String.class)) }), @ApiResponse(responseCode = "400", description = "Request body was malformed, or the request could not be processed", content = @Content(array = @ArraySchema(schema = @Schema(implementation = ApiErrorDetail.class)), mediaType = "application/json")), @ApiResponse(responseCode = "401", description = "The request could not be completed, because either the authentication was missing or was not valid.", diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java similarity index 97% rename from extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java rename to extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java index 83fb9825b..1f2d88ee2 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiController.java @@ -24,8 +24,8 @@ import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.SecurityContext; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; diff --git a/extensions/api/verifiable-credential-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/management-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/verifiable-credential-mgmt-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/management-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/verifiable-credential-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java b/extensions/api/management-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java similarity index 98% rename from extensions/api/verifiable-credential-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java rename to extensions/api/management-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java index 552e9867b..eea1a9bed 100644 --- a/extensions/api/verifiable-credential-mgmt-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java +++ b/extensions/api/management-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/VerifiableCredentialsApiControllerTest.java @@ -21,8 +21,8 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; import org.eclipse.edc.identityhub.spi.AuthorizationService; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.spi.result.StoreResult; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; diff --git a/extensions/did/local-did-publisher/build.gradle.kts b/extensions/did/local-did-publisher/build.gradle.kts index 5ad383df8..30a2c7f5c 100644 --- a/extensions/did/local-did-publisher/build.gradle.kts +++ b/extensions/did/local-did-publisher/build.gradle.kts @@ -22,7 +22,7 @@ val swagger: String by project dependencies { - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) implementation(libs.jakarta.rsApi) implementation(libs.edc.spi.web) diff --git a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentListenerImpl.java b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentListenerImpl.java index a9974b6ca..f3fc01729 100644 --- a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentListenerImpl.java +++ b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentListenerImpl.java @@ -15,10 +15,10 @@ package org.eclipse.edc.identityhub.publisher.did.local; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentEvent; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentListener; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentPublished; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentUnpublished; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentEvent; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentListener; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentPublished; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentUnpublished; import org.eclipse.edc.spi.event.EventEnvelope; import org.eclipse.edc.spi.event.EventRouter; diff --git a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentObservableImpl.java b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentObservableImpl.java index 8025204cc..4901876b2 100644 --- a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentObservableImpl.java +++ b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidDocumentObservableImpl.java @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.publisher.did.local; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentListener; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentListener; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentObservable; import org.eclipse.edc.spi.observe.ObservableImpl; public class DidDocumentObservableImpl extends ObservableImpl implements DidDocumentObservable { diff --git a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebController.java b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebController.java index 6a531c922..4806013ba 100644 --- a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebController.java +++ b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebController.java @@ -21,10 +21,10 @@ import jakarta.ws.rs.container.ContainerRequestContext; import jakarta.ws.rs.core.Context; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.DidWebParser; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.DidWebParser; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.query.Criterion; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisher.java b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisher.java index 3e501d94d..a9491a674 100644 --- a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisher.java +++ b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisher.java @@ -14,15 +14,15 @@ package org.eclipse.edc.identityhub.publisher.did.local; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisher; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisher; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.Result; -import static org.eclipse.edc.identithub.did.spi.DidConstants.DID_WEB_METHOD_REGEX; +import static org.eclipse.edc.identithub.spi.did.DidConstants.DID_WEB_METHOD_REGEX; import static org.eclipse.edc.spi.result.Result.failure; import static org.eclipse.edc.spi.result.Result.success; diff --git a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherExtension.java b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherExtension.java index 4fa711cfa..9e3f0be65 100644 --- a/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherExtension.java +++ b/extensions/did/local-did-publisher/src/main/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherExtension.java @@ -14,11 +14,11 @@ package org.eclipse.edc.identityhub.publisher.did.local; -import org.eclipse.edc.identithub.did.spi.DidConstants; -import org.eclipse.edc.identithub.did.spi.DidDocumentPublisherRegistry; -import org.eclipse.edc.identithub.did.spi.DidWebParser; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.DidConstants; +import org.eclipse.edc.identithub.spi.did.DidDocumentPublisherRegistry; +import org.eclipse.edc.identithub.spi.did.DidWebParser; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; import org.eclipse.edc.runtime.metamodel.annotation.Provider; diff --git a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebControllerTest.java b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebControllerTest.java index e4d3bcf37..9dc0f0656 100644 --- a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebControllerTest.java +++ b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/DidWebControllerTest.java @@ -16,10 +16,10 @@ import io.restassured.specification.RequestSpecification; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.DidWebParser; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.DidWebParser; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; import org.junit.jupiter.api.Test; @@ -42,6 +42,10 @@ class DidWebControllerTest extends RestControllerTestBase { private final DidResourceStore storeMock = mock(); + private static DidResource publishedDid(String did) { + return createDidResource(did).state(DidState.PUBLISHED).build(); + } + @Test void getDidDocument() { when(storeMock.query(any())).thenReturn(List.of(publishedDid("did:web:testdid1"))); @@ -104,8 +108,4 @@ private RequestSpecification baseRequest() { .baseUri("http://localhost:" + port) .when(); } - - private static DidResource publishedDid(String did) { - return createDidResource(did).state(DidState.PUBLISHED).build(); - } } \ No newline at end of file diff --git a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherTest.java b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherTest.java index bc12417cc..d68a56f56 100644 --- a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherTest.java +++ b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/LocalDidPublisherTest.java @@ -14,9 +14,9 @@ package org.eclipse.edc.identityhub.publisher.did.local; -import org.eclipse.edc.identithub.did.spi.model.DidState; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; -import org.eclipse.edc.identityhub.spi.events.diddocument.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.events.DidDocumentObservable; +import org.eclipse.edc.identithub.spi.did.model.DidState; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.junit.assertions.AbstractResultAssert; import org.eclipse.edc.spi.monitor.Monitor; import org.eclipse.edc.spi.result.StoreResult; @@ -39,9 +39,9 @@ class LocalDidPublisherTest { public static final String DID = "did:web:test"; private final DidResourceStore storeMock = mock(); + private final DidDocumentObservable observableMock = mock(); private LocalDidPublisher publisher; private Monitor monitor; - private final DidDocumentObservable observableMock = mock(); @BeforeEach void setUp() { @@ -51,13 +51,13 @@ void setUp() { @ParameterizedTest - @ValueSource(strings = {DID, "DID:web:test", "DID:WEB:TEST"}) + @ValueSource(strings = { DID, "DID:web:test", "DID:WEB:TEST" }) void canHandle(String validDid) { assertThat(publisher.canHandle(validDid)).isTrue(); } @ParameterizedTest - @ValueSource(strings = {"did:web", "DID:web:", "did:indy:whatever", "dod:web:something"}) + @ValueSource(strings = { "did:web", "DID:web:", "did:indy:whatever", "dod:web:something" }) void canHandle_invalid(String validDid) { assertThat(publisher.canHandle(validDid)).isFalse(); } diff --git a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/TestFunctions.java b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/TestFunctions.java index 194e79de0..0ff96a18f 100644 --- a/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/TestFunctions.java +++ b/extensions/did/local-did-publisher/src/test/java/org/eclipse/edc/identityhub/publisher/did/local/TestFunctions.java @@ -15,8 +15,8 @@ package org.eclipse.edc.identityhub.publisher.did.local; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.model.DidState; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidState; public interface TestFunctions { static DidResource.Builder createDidResource() { diff --git a/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/SqlCredentialStore.java b/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/SqlCredentialStore.java index 89d594034..8cc49a78d 100644 --- a/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/SqlCredentialStore.java +++ b/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/SqlCredentialStore.java @@ -18,9 +18,9 @@ import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential; import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer; -import org.eclipse.edc.identityhub.spi.model.VcState; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.spi.store.CredentialStore; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VcState; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.policy.model.Policy; import org.eclipse.edc.spi.persistence.EdcPersistenceException; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/schema/postgres/VerifiableCredentialResourceMapping.java b/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/schema/postgres/VerifiableCredentialResourceMapping.java index ea13297d3..143477b74 100644 --- a/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/schema/postgres/VerifiableCredentialResourceMapping.java +++ b/extensions/store/sql/identity-hub-credentials-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/credentials/schema/postgres/VerifiableCredentialResourceMapping.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.store.sql.credentials.schema.postgres; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.store.sql.credentials.CredentialStoreStatements; import org.eclipse.edc.sql.translation.TranslationMapping; diff --git a/extensions/store/sql/identity-hub-did-store-sql/build.gradle.kts b/extensions/store/sql/identity-hub-did-store-sql/build.gradle.kts index 187a8a97f..40f1252fc 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/build.gradle.kts +++ b/extensions/store/sql/identity-hub-did-store-sql/build.gradle.kts @@ -17,11 +17,11 @@ plugins { } dependencies { - api(project(":spi:identity-hub-did-spi")) + api(project(":spi:did-spi")) implementation(libs.edc.core.sql) // for the SqlStatements implementation(libs.edc.spi.transaction.datasource) - testImplementation(testFixtures(project(":spi:identity-hub-did-spi"))) + testImplementation(testFixtures(project(":spi:did-spi"))) testImplementation(testFixtures(libs.edc.core.sql)) testImplementation(libs.edc.junit) } diff --git a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/DidResourceStatements.java b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/DidResourceStatements.java index 43631248d..8cfca76c3 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/DidResourceStatements.java +++ b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/DidResourceStatements.java @@ -14,12 +14,13 @@ package org.eclipse.edc.identityhub.did.store.sql; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.sql.statement.SqlStatements; import org.eclipse.edc.sql.translation.SqlQueryStatement; /** - * Defines SQL-statements and column names for use with a SQL-based {@link org.eclipse.edc.identithub.did.spi.store.DidResourceStore} + * Defines SQL-statements and column names for use with a SQL-based {@link DidResourceStore} */ public interface DidResourceStatements extends SqlStatements { default String getDidResourceTableName() { diff --git a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStore.java b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStore.java index 7047f3105..ddfa9c535 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStore.java +++ b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStore.java @@ -16,8 +16,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.eclipse.edc.iam.did.spi.document.DidDocument; -import org.eclipse.edc.identithub.did.spi.model.DidResource; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.spi.persistence.EdcPersistenceException; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.StoreResult; diff --git a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreExtension.java b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreExtension.java index 8c6f50108..58fd38bbb 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreExtension.java +++ b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreExtension.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.did.store.sql; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.identityhub.did.store.sql.schema.postgres.PostgresDialectStatements; import org.eclipse.edc.runtime.metamodel.annotation.Extension; import org.eclipse.edc.runtime.metamodel.annotation.Inject; diff --git a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/schema/postgres/DidResourceMapping.java b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/schema/postgres/DidResourceMapping.java index 47585d3f6..ea8eb94fc 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/schema/postgres/DidResourceMapping.java +++ b/extensions/store/sql/identity-hub-did-store-sql/src/main/java/org/eclipse/edc/identityhub/did/store/sql/schema/postgres/DidResourceMapping.java @@ -14,12 +14,13 @@ package org.eclipse.edc.identityhub.did.store.sql.schema.postgres; +import org.eclipse.edc.identithub.spi.did.model.DidResource; import org.eclipse.edc.identityhub.did.store.sql.DidResourceStatements; import org.eclipse.edc.sql.translation.TranslationMapping; /** - * Provides a mapping from the canonical format to SQL column names for a {@link org.eclipse.edc.identithub.did.spi.model.DidResource} + * Provides a mapping from the canonical format to SQL column names for a {@link DidResource} */ public class DidResourceMapping extends TranslationMapping { diff --git a/extensions/store/sql/identity-hub-did-store-sql/src/test/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreTest.java b/extensions/store/sql/identity-hub-did-store-sql/src/test/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreTest.java index 406fc2005..1aa451c00 100644 --- a/extensions/store/sql/identity-hub-did-store-sql/src/test/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreTest.java +++ b/extensions/store/sql/identity-hub-did-store-sql/src/test/java/org/eclipse/edc/identityhub/did/store/sql/SqlDidResourceStoreTest.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.did.store.sql; -import org.eclipse.edc.identithub.did.spi.store.DidResourceStore; +import org.eclipse.edc.identithub.spi.did.store.DidResourceStore; import org.eclipse.edc.identityhub.did.store.sql.schema.postgres.PostgresDialectStatements; import org.eclipse.edc.identityhub.did.store.test.DidResourceStoreTestBase; import org.eclipse.edc.json.JacksonTypeManager; diff --git a/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/KeyPairResourceStoreStatements.java b/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/KeyPairResourceStoreStatements.java index 807fe88e6..ac1e26a2b 100644 --- a/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/KeyPairResourceStoreStatements.java +++ b/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/KeyPairResourceStoreStatements.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.store.sql.keypair; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.sql.statement.SqlStatements; import org.eclipse.edc.sql.translation.SqlQueryStatement; diff --git a/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/SqlKeyPairResourceStore.java b/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/SqlKeyPairResourceStore.java index f46bd8a28..a3147d84f 100644 --- a/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/SqlKeyPairResourceStore.java +++ b/extensions/store/sql/identity-hub-keypair-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/keypair/SqlKeyPairResourceStore.java @@ -15,7 +15,7 @@ package org.eclipse.edc.identityhub.store.sql.keypair; import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.edc.identityhub.spi.model.KeyPairResource; +import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore; import org.eclipse.edc.spi.persistence.EdcPersistenceException; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/ParticipantContextStoreStatements.java b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/ParticipantContextStoreStatements.java index db0bd0e21..ceca59fb8 100644 --- a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/ParticipantContextStoreStatements.java +++ b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/ParticipantContextStoreStatements.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.store.sql.participantcontext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.sql.statement.SqlStatements; import org.eclipse.edc.sql.translation.SqlQueryStatement; diff --git a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/SqlParticipantContextStore.java b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/SqlParticipantContextStore.java index 8e1f1a3ab..7ec34cdac 100644 --- a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/SqlParticipantContextStore.java +++ b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/SqlParticipantContextStore.java @@ -16,8 +16,8 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext; -import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext; +import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState; import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore; import org.eclipse.edc.spi.persistence.EdcPersistenceException; import org.eclipse.edc.spi.query.QuerySpec; diff --git a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/schema/postgres/ParticipantContextMapping.java b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/schema/postgres/ParticipantContextMapping.java index 436c19dca..0c9811db5 100644 --- a/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/schema/postgres/ParticipantContextMapping.java +++ b/extensions/store/sql/identity-hub-participantcontext-store-sql/src/main/java/org/eclipse/edc/identityhub/store/sql/participantcontext/schema/postgres/ParticipantContextMapping.java @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.store.sql.participantcontext.schema.postgres; -import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource; +import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; import org.eclipse.edc.identityhub.store.sql.participantcontext.ParticipantContextStoreStatements; import org.eclipse.edc.sql.translation.TranslationMapping; diff --git a/launcher/build.gradle.kts b/launcher/build.gradle.kts index b2e5a82dd..a50a64bfa 100644 --- a/launcher/build.gradle.kts +++ b/launcher/build.gradle.kts @@ -19,17 +19,17 @@ plugins { } dependencies { - runtimeOnly(project(":core:identity-hub-api")) + runtimeOnly(project(":core:presentation-api")) runtimeOnly(project(":core:identity-hub-did")) runtimeOnly(project(":core:identity-hub-credentials")) runtimeOnly(project(":core:identity-hub-participants")) runtimeOnly(project(":core:identity-hub-keypairs")) runtimeOnly(project(":extensions:did:local-did-publisher")) - runtimeOnly(project(":extensions:api:did-mgmt-api")) - runtimeOnly(project(":extensions:api:participant-context-mgmt-api")) - runtimeOnly(project(":extensions:api:verifiable-credential-mgmt-api")) - runtimeOnly(project(":extensions:api:keypair-mgmt-api")) - runtimeOnly(project(":extensions:api:identityhub-management-api-configuration")) + runtimeOnly(project(":extensions:api:management-api:did-api")) + runtimeOnly(project(":extensions:api:management-api:participant-context-api")) + runtimeOnly(project(":extensions:api:management-api:verifiable-credentials-api")) + runtimeOnly(project(":extensions:api:management-api:keypair-api")) + runtimeOnly(project(":extensions:api:management-api:api-configuration")) runtimeOnly(project(":extensions:api:identityhub-api-authentication")) runtimeOnly(project(":extensions:api:identityhub-api-authorization")) runtimeOnly(libs.edc.identity.did.core) diff --git a/settings.gradle.kts b/settings.gradle.kts index 48e30632e..563e147e7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -24,18 +24,26 @@ dependencyResolutionManagement { } // SPI modules include(":spi:identity-hub-spi") +include(":spi:participant-context-spi") +include(":spi:verifiable-credential-spi") +include(":spi:keypair-spi") include(":spi:identity-hub-store-spi") -include(":spi:identity-hub-did-spi") +include(":spi:did-spi") // core modules -include(":core:identity-hub-api") +include(":core:presentation-api") include(":core:identity-hub-credentials") include(":core:identity-hub-participants") include(":core:identity-hub-keypairs") include(":core:identity-hub-did") +// lib modules +include(":core:lib:verifiable-presentation-lib") +include(":core:lib:keypair-lib") +include(":core:lib:accesstoken-lib") +include(":core:lib:credential-query-lib") + // extension modules -include(":extensions:common:security") include(":extensions:store:sql:identity-hub-did-store-sql") include(":extensions:store:sql:identity-hub-credentials-store-sql") include(":extensions:store:sql:identity-hub-participantcontext-store-sql") @@ -43,15 +51,15 @@ include(":extensions:store:sql:identity-hub-keypair-store-sql") include(":extensions:did:local-did-publisher") // management APIs -include(":extensions:api:identityhub-management-api-validators") -include(":extensions:api:identityhub-management-api-configuration") +include(":extensions:api:management-api:validators") +include(":extensions:api:management-api:api-configuration") include(":extensions:api:identityhub-api-authentication") include(":extensions:api:identityhub-api-authorization") -include(":extensions:api:participant-context-mgmt-api") -include(":extensions:api:verifiable-credential-mgmt-api") -include(":extensions:api:did-mgmt-api") +include(":extensions:api:management-api:participant-context-api") +include(":extensions:api:management-api:verifiable-credentials-api") +include(":extensions:api:management-api:did-api") +include(":extensions:api:management-api:keypair-api") -include(":extensions:api:keypair-mgmt-api") // other modules include(":launcher") diff --git a/spi/identity-hub-did-spi/build.gradle.kts b/spi/did-spi/build.gradle.kts similarity index 89% rename from spi/identity-hub-did-spi/build.gradle.kts rename to spi/did-spi/build.gradle.kts index 05e4c9d93..6ad4e0ce9 100644 --- a/spi/identity-hub-did-spi/build.gradle.kts +++ b/spi/did-spi/build.gradle.kts @@ -21,7 +21,9 @@ plugins { dependencies { api(libs.edc.spi.identity.did) - api(project(":spi:identity-hub-store-spi")) + api(project(":spi:participant-context-spi")) + + testImplementation(libs.edc.lib.json) testFixturesImplementation(libs.edc.spi.identity.did) testFixturesImplementation(libs.junit.jupiter.api) diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidConstants.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidConstants.java similarity index 91% rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidConstants.java rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidConstants.java index 5b7392175..6efff409a 100644 --- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidConstants.java +++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Metaform Systems, Inc. + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identithub.did.spi; +package org.eclipse.edc.identithub.spi.did; import java.util.regex.Pattern; diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisher.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisher.java similarity index 89% rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisher.java rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisher.java index e2cc589ba..528f1bf4a 100644 --- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisher.java +++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,11 +8,11 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identithub.did.spi; +package org.eclipse.edc.identithub.spi.did; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisherRegistry.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisherRegistry.java similarity index 93% rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisherRegistry.java rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisherRegistry.java index 61a09145f..40c870076 100644 --- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentPublisherRegistry.java +++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentPublisherRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Metaform Systems, Inc. + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identithub.did.spi; +package org.eclipse.edc.identithub.spi.did; /** * Registry that hosts multiple {@link DidDocumentPublisher}s to dispatch the publishing of a DID document based on diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentService.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentService.java similarity index 93% rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentService.java rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentService.java index f14d03170..d7f3d103a 100644 --- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidDocumentService.java +++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidDocumentService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -8,15 +8,15 @@ * SPDX-License-Identifier: Apache-2.0 * * Contributors: - * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation + * Metaform Systems, Inc. - initial API and implementation * */ -package org.eclipse.edc.identithub.did.spi; +package org.eclipse.edc.identithub.spi.did; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; -import org.eclipse.edc.identithub.did.spi.model.DidResource; +import org.eclipse.edc.identithub.spi.did.model.DidResource; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidWebParser.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidWebParser.java similarity index 85% rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidWebParser.java rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidWebParser.java index a717d0805..0a5ff5bd3 100644 --- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/DidWebParser.java +++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/DidWebParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Metaform Systems, Inc. + * Copyright (c) 2024 Metaform Systems, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identithub.did.spi; +package org.eclipse.edc.identithub.spi.did; import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint; import org.jetbrains.annotations.NotNull; @@ -22,9 +22,6 @@ import java.net.URLEncoder; import java.nio.charset.Charset; -import static org.eclipse.edc.identithub.did.spi.DidConstants.DID_WEB_DID_DOCUMENT; -import static org.eclipse.edc.identithub.did.spi.DidConstants.WELL_KNOWN; - /** * Converts a URL into a did:web identifier by parsing the authority and the path. For example the following conversion applies: *

@@ -53,11 +50,11 @@ public String parse(URI url, Charset charset) {
         var path = url.getPath();
         path = stripTrailingSlash(path);
 
-        if (path.endsWith(DID_WEB_DID_DOCUMENT)) {
-            path = path.substring(0, path.indexOf(DID_WEB_DID_DOCUMENT));
+        if (path.endsWith(DidConstants.DID_WEB_DID_DOCUMENT)) {
+            path = path.substring(0, path.indexOf(DidConstants.DID_WEB_DID_DOCUMENT));
             path = stripTrailingSlash(path);
         }
-        if (path.endsWith(WELL_KNOWN)) {
+        if (path.endsWith(DidConstants.WELL_KNOWN)) {
             path = path.replace(DidConstants.WELL_KNOWN, "");
             path = stripTrailingSlash(path);
         }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentEvent.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentEvent.java
similarity index 95%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentEvent.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentEvent.java
index bed79dbc9..0efcc5798 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentEvent.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentEvent.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import org.eclipse.edc.spi.event.Event;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentListener.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentListener.java
similarity index 94%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentListener.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentListener.java
index 7df44e80b..a17946cb6 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentListener.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentListener.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import org.eclipse.edc.iam.did.spi.document.DidDocument;
 import org.eclipse.edc.spi.observe.Observable;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentObservable.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentObservable.java
similarity index 91%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentObservable.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentObservable.java
index ce9e7a4bc..67a6d52ea 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentObservable.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentObservable.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import org.eclipse.edc.spi.observe.Observable;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublished.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublished.java
similarity index 95%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublished.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublished.java
index 05cfddf68..d4e93fc71 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublished.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublished.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -35,14 +35,14 @@ private Builder() {
             super(new DidDocumentPublished());
         }
 
-        @Override
-        public Builder self() {
-            return this;
-        }
-
         @JsonCreator
         public static Builder newInstance() {
             return new Builder();
         }
+
+        @Override
+        public Builder self() {
+            return this;
+        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublished.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublished.java
similarity index 95%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublished.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublished.java
index cbb5be192..5de89d923 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublished.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublished.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -35,14 +35,14 @@ private Builder() {
             super(new DidDocumentUnpublished());
         }
 
-        @Override
-        public Builder self() {
-            return this;
-        }
-
         @JsonCreator
         public static Builder newInstance() {
             return new Builder();
         }
+
+        @Override
+        public Builder self() {
+            return this;
+        }
     }
 }
diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidResource.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidResource.java
similarity index 91%
rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidResource.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidResource.java
index 770c1257d..c9c3ad2cd 100644
--- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidResource.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidResource.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,15 +8,15 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identithub.did.spi.model;
+package org.eclipse.edc.identithub.spi.did.model;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import org.eclipse.edc.iam.did.spi.document.DidDocument;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 
 import java.time.Clock;
 import java.util.Objects;
@@ -72,6 +72,10 @@ private Builder() {
             super(new DidResource());
         }
 
+        public static Builder newInstance() {
+            return new Builder();
+        }
+
         public Builder did(String did) {
             this.entity.did = did;
             return this;
@@ -123,10 +127,6 @@ public Builder state(int code) {
             return this;
         }
 
-        public static Builder newInstance() {
-            return new Builder();
-        }
-
 
     }
 }
diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidState.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidState.java
similarity index 84%
rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidState.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidState.java
index d7d8efbd6..38c0c148d 100644
--- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/model/DidState.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/model/DidState.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identithub.did.spi.model;
+package org.eclipse.edc.identithub.spi.did.model;
 
 import java.util.Arrays;
 
@@ -44,11 +44,11 @@ public enum DidState {
         this.code = code;
     }
 
-    public int code() {
-        return code;
-    }
-
     public static DidState from(int code) {
         return Arrays.stream(values()).filter(tps -> tps.code == code).findFirst().orElse(null);
     }
+
+    public int code() {
+        return code;
+    }
 }
diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/package-info.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/package-info.java
similarity index 70%
rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/package-info.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/package-info.java
index 804b7892f..f2a5c6cf7 100644
--- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/package-info.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/package-info.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,7 +8,7 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
@@ -18,6 +18,6 @@
  * DID documents.
  */
 @Spi(value = "Identity Hub DID services")
-package org.eclipse.edc.identithub.did.spi;
+package org.eclipse.edc.identithub.spi.did;
 
 import org.eclipse.edc.runtime.metamodel.annotation.Spi;
diff --git a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/store/DidResourceStore.java b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/store/DidResourceStore.java
similarity index 90%
rename from spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/store/DidResourceStore.java
rename to spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/store/DidResourceStore.java
index 02d96f5e8..ee6219f12 100644
--- a/spi/identity-hub-did-spi/src/main/java/org/eclipse/edc/identithub/did/spi/store/DidResourceStore.java
+++ b/spi/did-spi/src/main/java/org/eclipse/edc/identithub/spi/did/store/DidResourceStore.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,13 +8,13 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identithub.did.spi.store;
+package org.eclipse.edc.identithub.spi.did.store;
 
-import org.eclipse.edc.identithub.did.spi.model.DidResource;
+import org.eclipse.edc.identithub.spi.did.model.DidResource;
 import org.eclipse.edc.runtime.metamodel.annotation.ExtensionPoint;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.StoreResult;
diff --git a/spi/identity-hub-did-spi/src/test/java/org/eclipse/edc/identithub/did/spi/DidWebParserTest.java b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/DidWebParserTest.java
similarity index 96%
rename from spi/identity-hub-did-spi/src/test/java/org/eclipse/edc/identithub/did/spi/DidWebParserTest.java
rename to spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/DidWebParserTest.java
index 16c857eee..10fde01e4 100644
--- a/spi/identity-hub-did-spi/src/test/java/org/eclipse/edc/identithub/did/spi/DidWebParserTest.java
+++ b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/DidWebParserTest.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Metaform Systems, Inc.
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identithub.did.spi;
+package org.eclipse.edc.identithub.spi.did;
 
 import org.junit.jupiter.api.Test;
 
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublishedTest.java b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublishedTest.java
similarity index 94%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublishedTest.java
rename to spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublishedTest.java
index 712c07b53..c999ce93a 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentPublishedTest.java
+++ b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentPublishedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import org.eclipse.edc.json.JacksonTypeManager;
 import org.eclipse.edc.spi.types.TypeManager;
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublishedTest.java b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublishedTest.java
similarity index 94%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublishedTest.java
rename to spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublishedTest.java
index 6a93be6c2..9f426e4f9 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/diddocument/DidDocumentUnpublishedTest.java
+++ b/spi/did-spi/src/test/java/org/eclipse/edc/identithub/spi/did/events/DidDocumentUnpublishedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.diddocument;
+package org.eclipse.edc.identithub.spi.did.events;
 
 import org.eclipse.edc.json.JacksonTypeManager;
 import org.eclipse.edc.spi.types.TypeManager;
diff --git a/spi/identity-hub-did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java b/spi/did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java
similarity index 97%
rename from spi/identity-hub-did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java
rename to spi/did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java
index 3bd89fbf3..4c8dd3ebc 100644
--- a/spi/identity-hub-did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java
+++ b/spi/did-spi/src/testFixtures/java/org/eclipse/edc/identityhub/did/store/test/DidResourceStoreTestBase.java
@@ -18,10 +18,10 @@
 import org.eclipse.edc.iam.did.spi.document.DidDocument;
 import org.eclipse.edc.iam.did.spi.document.Service;
 import org.eclipse.edc.iam.did.spi.document.VerificationMethod;
-import org.eclipse.edc.identithub.did.spi.model.DidResource;
-import org.eclipse.edc.identithub.did.spi.model.DidState;
-import org.eclipse.edc.identithub.did.spi.store.DidResourceStore;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
+import org.eclipse.edc.identithub.spi.did.model.DidResource;
+import org.eclipse.edc.identithub.spi.did.model.DidState;
+import org.eclipse.edc.identithub.spi.did.store.DidResourceStore;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.spi.message.Range;
 import org.eclipse.edc.spi.query.Criterion;
 import org.eclipse.edc.spi.query.QuerySpec;
diff --git a/spi/identity-hub-spi/build.gradle.kts b/spi/identity-hub-spi/build.gradle.kts
index 3b981825a..ebd556c9b 100644
--- a/spi/identity-hub-spi/build.gradle.kts
+++ b/spi/identity-hub-spi/build.gradle.kts
@@ -21,19 +21,13 @@ plugins {
 val swagger: String by project
 
 dependencies {
-
-    api(libs.edc.spi.iatp)
-    api(libs.edc.spi.vc)
-    api(libs.edc.spi.web)
+    api(libs.edc.spi.core)
+    api(libs.edc.spi.web) // ServiceResultHandler, etc.
+    api(libs.edc.spi.vc) // VC Constants
+    api(project(":spi:participant-context-spi"))
     implementation(libs.jackson.databind)
-    implementation(libs.nimbus.jwt)
-    implementation(libs.edc.spi.identity.did)
 
     implementation(libs.swagger.jaxrs) {
         exclude(group = "com.fasterxml.jackson.jaxrs", module = "jackson-jaxrs-json-provider")
     }
-
-    testImplementation(libs.edc.lib.json)
-    testFixturesImplementation(libs.nimbus.jwt)
-    testFixturesImplementation(libs.edc.spi.identity.did)
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/AuthorizationService.java b/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/AuthorizationService.java
index 0a153c691..7969c7291 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/AuthorizationService.java
+++ b/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/AuthorizationService.java
@@ -15,7 +15,7 @@
 package org.eclipse.edc.identityhub.spi;
 
 import jakarta.ws.rs.core.SecurityContext;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.spi.result.ServiceResult;
 
 import java.security.Principal;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/verification/AccessTokenVerifier.java b/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/verification/AccessTokenVerifier.java
index a96d1e1a3..0995ada57 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/verification/AccessTokenVerifier.java
+++ b/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/verification/AccessTokenVerifier.java
@@ -14,6 +14,7 @@
 
 package org.eclipse.edc.identityhub.spi.verification;
 
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 import org.eclipse.edc.spi.result.Result;
 
 import java.util.List;
@@ -33,7 +34,7 @@ public interface AccessTokenVerifier {
      * 
      *
      * @param token         The token to be verified. Must be a JWT in base64 encoding.
-     * @param participantId The ID of the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} who is supposed to present their credentials
+     * @param participantId The ID of the {@link ParticipantContext} who is supposed to present their credentials
      * @return A {@code Result} containing a {@code List} of scope strings.
      */
     Result> verify(String token, String participantId);
diff --git a/spi/identity-hub-store-spi/build.gradle.kts b/spi/identity-hub-store-spi/build.gradle.kts
index 2d3f7c81b..212ad2fbe 100644
--- a/spi/identity-hub-store-spi/build.gradle.kts
+++ b/spi/identity-hub-store-spi/build.gradle.kts
@@ -6,6 +6,9 @@ plugins {
 
 dependencies {
     api(project(":spi:identity-hub-spi"))
+    api(project(":spi:participant-context-spi"))
+    api(project(":spi:verifiable-credential-spi"))
+    api(project(":spi:keypair-spi"))
     api(libs.edc.spi.core)
 
     testFixturesImplementation(testFixtures(project(":spi:identity-hub-spi")))
diff --git a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/CredentialStore.java b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/CredentialStore.java
index 38a8209b9..3bb89aab1 100644
--- a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/CredentialStore.java
+++ b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/CredentialStore.java
@@ -15,7 +15,7 @@
 package org.eclipse.edc.identityhub.spi.store;
 
 
-import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
+import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.StoreResult;
 
diff --git a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/KeyPairResourceStore.java b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/KeyPairResourceStore.java
index d88bcaff9..89b925de4 100644
--- a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/KeyPairResourceStore.java
+++ b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/KeyPairResourceStore.java
@@ -14,12 +14,13 @@
 
 package org.eclipse.edc.identityhub.spi.store;
 
-import org.eclipse.edc.identityhub.spi.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.StoreResult;
 
 import java.util.Collection;
 
+
 /**
  * Stores {@link KeyPairResource} entities in persistent storage.
  */
diff --git a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/ParticipantContextStore.java b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/ParticipantContextStore.java
index 321b1fcc1..085bb72f1 100644
--- a/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/ParticipantContextStore.java
+++ b/spi/identity-hub-store-spi/src/main/java/org/eclipse/edc/identityhub/spi/store/ParticipantContextStore.java
@@ -14,7 +14,7 @@
 
 package org.eclipse.edc.identityhub.spi.store;
 
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.StoreResult;
 
diff --git a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/CredentialStoreTestBase.java b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/CredentialStoreTestBase.java
index a9c922246..d9c4909f4 100644
--- a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/CredentialStoreTestBase.java
+++ b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/CredentialStoreTestBase.java
@@ -20,10 +20,10 @@
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.Issuer;
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredential;
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
-import org.eclipse.edc.identityhub.spi.model.VcState;
-import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.identityhub.spi.store.CredentialStore;
+import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VcState;
+import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource;
 import org.eclipse.edc.spi.query.Criterion;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.jetbrains.annotations.NotNull;
diff --git a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/KeyPairResourceStoreTestBase.java b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/KeyPairResourceStoreTestBase.java
index 7fa0a43c3..f5be22809 100644
--- a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/KeyPairResourceStoreTestBase.java
+++ b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/KeyPairResourceStoreTestBase.java
@@ -15,9 +15,9 @@
 package org.eclipse.edc.identityhub.store.test;
 
 import org.assertj.core.api.Assertions;
-import org.eclipse.edc.identityhub.spi.model.KeyPairResource;
-import org.eclipse.edc.identityhub.spi.model.KeyPairState;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore;
 import org.eclipse.edc.spi.query.Criterion;
 import org.eclipse.edc.spi.query.QuerySpec;
diff --git a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/ParticipantContextStoreTestBase.java b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/ParticipantContextStoreTestBase.java
index 25bdae2b0..b9e86fb7e 100644
--- a/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/ParticipantContextStoreTestBase.java
+++ b/spi/identity-hub-store-spi/src/testFixtures/java/org/eclipse/edc/identityhub/store/test/ParticipantContextStoreTestBase.java
@@ -15,8 +15,8 @@
 package org.eclipse.edc.identityhub.store.test;
 
 import org.assertj.core.api.Assertions;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.identityhub.spi.store.ParticipantContextStore;
 import org.eclipse.edc.spi.query.Criterion;
 import org.eclipse.edc.spi.query.QuerySpec;
@@ -25,9 +25,9 @@
 import java.util.List;
 
 import static java.util.stream.IntStream.range;
-import static org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState.ACTIVATED;
-import static org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState.CREATED;
-import static org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState.DEACTIVATED;
+import static org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState.ACTIVATED;
+import static org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState.CREATED;
+import static org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState.DEACTIVATED;
 import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat;
 
 public abstract class ParticipantContextStoreTestBase {
diff --git a/spi/keypair-spi/build.gradle.kts b/spi/keypair-spi/build.gradle.kts
new file mode 100644
index 000000000..48823ec8d
--- /dev/null
+++ b/spi/keypair-spi/build.gradle.kts
@@ -0,0 +1,28 @@
+/*
+ *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Apache License, Version 2.0 which is available at
+ *  https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Contributors:
+ *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *
+ */
+
+plugins {
+    `java-library`
+    `maven-publish`
+}
+
+val swagger: String by project
+
+dependencies {
+
+    api(project(":spi:participant-context-spi"))
+    api(libs.edc.spi.core)
+
+    testImplementation(libs.edc.lib.json)
+}
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/KeyPairService.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/KeyPairService.java
similarity index 93%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/KeyPairService.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/KeyPairService.java
index 9b2352ce6..bd7e79462 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/KeyPairService.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/KeyPairService.java
@@ -12,11 +12,11 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi;
+package org.eclipse.edc.identityhub.spi.keypair;
 
-import org.eclipse.edc.identityhub.spi.model.KeyPairResource;
-import org.eclipse.edc.identityhub.spi.model.KeyPairState;
-import org.eclipse.edc.identityhub.spi.model.participant.KeyDescriptor;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairState;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.KeyDescriptor;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.ServiceResult;
 import org.eclipse.edc.spi.security.Vault;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAdded.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAdded.java
similarity index 96%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAdded.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAdded.java
index b9949b333..89aef35b3 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAdded.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAdded.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEvent.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEvent.java
similarity index 80%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEvent.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEvent.java
index 1aa13e37e..ea5e8b7b2 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEvent.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEvent.java
@@ -12,8 +12,10 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 import org.eclipse.edc.spi.event.Event;
 
 import java.util.Objects;
@@ -26,14 +28,14 @@ public abstract class KeyPairEvent extends Event {
     protected String keyId;
 
     /**
-     * The ID of the Key stored in the {@link org.eclipse.edc.identityhub.spi.model.KeyPairResource}
+     * The ID of the Key stored in the {@link KeyPairResource}
      */
     public String getKeyId() {
         return keyId;
     }
 
     /**
-     * The ID of the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} that owns the KeyPair resource.
+     * The ID of the {@link ParticipantContext} that owns the KeyPair resource.
      */
     public String getParticipantId() {
         return participantId;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEventListener.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEventListener.java
similarity index 87%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEventListener.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEventListener.java
index 521a0d7ef..fb48d6034 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairEventListener.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairEventListener.java
@@ -12,9 +12,10 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
-import org.eclipse.edc.identityhub.spi.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 import org.eclipse.edc.spi.observe.Observable;
 
 /**
@@ -24,7 +25,7 @@
 public interface KeyPairEventListener {
 
     /**
-     * A {@link KeyPairResource} was added to a particular {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext}. This could happen either
+     * A {@link KeyPairResource} was added to a particular {@link ParticipantContext}. This could happen either
      * by simply adding a keypair, or after a keypair was revoked, and a successor was specified.
      *
      * @param keypair The new (added) key pair
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairObservable.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairObservable.java
similarity index 91%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairObservable.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairObservable.java
index e2211ae5c..6c5325e67 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairObservable.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairObservable.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import org.eclipse.edc.spi.observe.Observable;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevoked.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevoked.java
similarity index 95%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevoked.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevoked.java
index 6424d4a3b..3612551a3 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevoked.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevoked.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -35,14 +35,14 @@ private Builder() {
             super(new KeyPairRevoked());
         }
 
-        @Override
-        public KeyPairRevoked.Builder self() {
-            return this;
-        }
-
         @JsonCreator
         public static KeyPairRevoked.Builder newInstance() {
             return new KeyPairRevoked.Builder();
         }
+
+        @Override
+        public KeyPairRevoked.Builder self() {
+            return this;
+        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotated.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotated.java
similarity index 95%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotated.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotated.java
index ff8771136..7b28ba4d2 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotated.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotated.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -35,14 +35,14 @@ private Builder() {
             super(new KeyPairRotated());
         }
 
-        @Override
-        public KeyPairRotated.Builder self() {
-            return this;
-        }
-
         @JsonCreator
         public static KeyPairRotated.Builder newInstance() {
             return new KeyPairRotated.Builder();
         }
+
+        @Override
+        public KeyPairRotated.Builder self() {
+            return this;
+        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairResource.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairResource.java
similarity index 93%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairResource.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairResource.java
index 9ba94a4a2..db9bc0e81 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairResource.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairResource.java
@@ -12,11 +12,11 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.keypair.model;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
-import org.eclipse.edc.keys.spi.KeyParserRegistry;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource;
 import org.eclipse.edc.spi.security.Vault;
 
 import java.time.Duration;
@@ -82,7 +82,7 @@ public long getRotationDuration() {
     }
 
     /**
-     * The public key in JWK or PEM format. Consider using a {@link KeyParserRegistry} to restore the key.
+     * The public key in JWK or PEM format. Consider using a {@code KeyParserRegistry} to restore the key.
      */
     public String getSerializedPublicKey() {
         return serializedPublicKey;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairState.java b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairState.java
similarity index 96%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairState.java
rename to spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairState.java
index ec4b2952a..8d10d9462 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/KeyPairState.java
+++ b/spi/keypair-spi/src/main/java/org/eclipse/edc/identityhub/spi/keypair/model/KeyPairState.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.keypair.model;
 
 import java.util.Arrays;
 
@@ -44,11 +44,11 @@ public enum KeyPairState {
         this.code = code;
     }
 
-    public int code() {
-        return code;
-    }
-
     public static KeyPairState from(int code) {
         return Arrays.stream(values()).filter(tps -> tps.code == code).findFirst().orElse(null);
     }
+
+    public int code() {
+        return code;
+    }
 }
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAddedTest.java b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAddedTest.java
similarity index 95%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAddedTest.java
rename to spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAddedTest.java
index 891c8e4cf..ed935ed22 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairAddedTest.java
+++ b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairAddedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevokedTest.java b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevokedTest.java
similarity index 85%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevokedTest.java
rename to spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevokedTest.java
index 83ccde34e..0aa2f8c17 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRevokedTest.java
+++ b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRevokedTest.java
@@ -12,9 +12,8 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
 import org.eclipse.edc.spi.types.TypeManager;
 import org.junit.jupiter.api.Test;
@@ -26,7 +25,7 @@ class KeyPairRevokedTest {
     private final TypeManager typeManager = new JacksonTypeManager();
 
     @Test
-    void verify_serDes() throws JsonProcessingException {
+    void verify_serDes() {
         var evt = KeyPairRevoked.Builder.newInstance().keyId("resource-id")
                 .participantId("participant-id")
                 .build();
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotatedTest.java b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotatedTest.java
similarity index 95%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotatedTest.java
rename to spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotatedTest.java
index e8c141505..aef7110c6 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/keypair/KeyPairRotatedTest.java
+++ b/spi/keypair-spi/src/test/java/org/eclipse/edc/identityhub/spi/keypair/events/KeyPairRotatedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.keypair;
+package org.eclipse.edc.identityhub.spi.keypair.events;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
diff --git a/spi/keypair-spi/src/test/resources/cred.json b/spi/keypair-spi/src/test/resources/cred.json
new file mode 100644
index 000000000..ddb7f4693
--- /dev/null
+++ b/spi/keypair-spi/src/test/resources/cred.json
@@ -0,0 +1,20 @@
+{
+  "@context": [
+    "https://www.w3.org/2018/credentials/v1",
+    "https://www.w3.org/2018/credentials/examples/v1"
+  ],
+  "id": "http://example.gov/credentials/3732",
+  "type": [
+    "VerifiableCredential",
+    "UniversityDegreeCredential"
+  ],
+  "issuer": "https://example.edu",
+  "issuanceDate": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "BachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    }
+  }
+}
\ No newline at end of file
diff --git a/spi/participant-context-spi/build.gradle.kts b/spi/participant-context-spi/build.gradle.kts
new file mode 100644
index 000000000..4fdb9aed5
--- /dev/null
+++ b/spi/participant-context-spi/build.gradle.kts
@@ -0,0 +1,26 @@
+/*
+ *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Apache License, Version 2.0 which is available at
+ *  https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Contributors:
+ *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *
+ */
+
+plugins {
+    `java-library`
+    `java-test-fixtures`
+    `maven-publish`
+}
+
+val swagger: String by project
+
+dependencies {
+    implementation(libs.edc.spi.identity.did) // ParticipantManifest#serviceEndpoint
+    testImplementation(libs.edc.lib.json)
+}
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextId.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextId.java
similarity index 83%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextId.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextId.java
index 666c8557c..47d24435c 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextId.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextId.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2024 Amadeus.
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Amadeus - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi;
+package org.eclipse.edc.identityhub.spi.participantcontext;
 
 import org.eclipse.edc.spi.result.Result;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextService.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextService.java
similarity index 92%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextService.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextService.java
index e795cdd58..9d2827609 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/ParticipantContextService.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/ParticipantContextService.java
@@ -12,10 +12,10 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi;
+package org.eclipse.edc.identityhub.spi.participantcontext;
 
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest;
 import org.eclipse.edc.spi.query.QuerySpec;
 import org.eclipse.edc.spi.result.ServiceResult;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreated.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreated.java
similarity index 83%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreated.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreated.java
index 84b4f94b5..9d5ddb108 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreated.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreated.java
@@ -12,15 +12,16 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest;
 
 /**
- * Event that signals that a {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} was created
+ * Event that signals that a {@link ParticipantContext} was created
  */
 @JsonDeserialize(builder = ParticipantContextCreated.Builder.class)
 public class ParticipantContextCreated extends ParticipantContextEvent {
@@ -45,6 +46,11 @@ private Builder() {
             super(new ParticipantContextCreated());
         }
 
+        @JsonCreator
+        public static Builder newInstance() {
+            return new Builder();
+        }
+
         @Override
         public Builder self() {
             return this;
@@ -54,10 +60,5 @@ public Builder manifest(ParticipantManifest manifest) {
             this.event.manifest = manifest;
             return this;
         }
-
-        @JsonCreator
-        public static Builder newInstance() {
-            return new Builder();
-        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeleted.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeleted.java
similarity index 85%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeleted.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeleted.java
index cfc7efa42..d709266d7 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeleted.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeleted.java
@@ -12,14 +12,15 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 
 /**
- * Event that signals that a {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} was deleted
+ * Event that signals that a {@link ParticipantContext} was deleted
  */
 @JsonDeserialize(builder = ParticipantContextDeleted.Builder.class)
 public class ParticipantContextDeleted extends ParticipantContextEvent {
@@ -35,14 +36,14 @@ private Builder() {
             super(new ParticipantContextDeleted());
         }
 
-        @Override
-        public Builder self() {
-            return this;
-        }
-
         @JsonCreator
         public static Builder newInstance() {
             return new Builder();
         }
+
+        @Override
+        public Builder self() {
+            return this;
+        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextEvent.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextEvent.java
similarity index 87%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextEvent.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextEvent.java
index 97cc43d5d..93bd69bc2 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextEvent.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextEvent.java
@@ -12,14 +12,15 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
 import org.eclipse.edc.spi.event.Event;
 
 import java.util.Objects;
 
 /**
- * Base class for all events related to state changes and actions of {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext}s
+ * Base class for all events related to state changes and actions of {@link ParticipantContext}s
  */
 public abstract class ParticipantContextEvent extends Event {
     protected String participantId;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextListener.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextListener.java
similarity index 88%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextListener.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextListener.java
index dc409f1aa..12ab7a102 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextListener.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextListener.java
@@ -12,10 +12,10 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantManifest;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantManifest;
 import org.eclipse.edc.spi.observe.Observable;
 
 /**
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextObservable.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextObservable.java
similarity index 90%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextObservable.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextObservable.java
index dec1ead71..d7352162f 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextObservable.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextObservable.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import org.eclipse.edc.spi.observe.Observable;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdated.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdated.java
similarity index 83%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdated.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdated.java
index 4cb73f814..8c4005bb9 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdated.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdated.java
@@ -12,15 +12,16 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContextState;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContext;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantContextState;
 
 /**
- * Event that signals that a {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} was updated
+ * Event that signals that a {@link ParticipantContext} was updated
  */
 @JsonDeserialize(builder = ParticipantContextUpdated.Builder.class)
 public class ParticipantContextUpdated extends ParticipantContextEvent {
@@ -43,6 +44,11 @@ private Builder() {
             super(new ParticipantContextUpdated());
         }
 
+        @JsonCreator
+        public static Builder newInstance() {
+            return new Builder();
+        }
+
         @Override
         public Builder self() {
             return this;
@@ -52,10 +58,5 @@ public Builder newState(ParticipantContextState state) {
             this.event.newState = state;
             return this;
         }
-
-        @JsonCreator
-        public static Builder newInstance() {
-            return new Builder();
-        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/IdentityResource.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/IdentityResource.java
similarity index 97%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/IdentityResource.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/IdentityResource.java
index 186909725..4c3114c18 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/IdentityResource.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/IdentityResource.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/KeyDescriptor.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/KeyDescriptor.java
similarity index 94%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/KeyDescriptor.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/KeyDescriptor.java
index fe234f426..cacd3a20d 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/KeyDescriptor.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/KeyDescriptor.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -90,8 +90,8 @@ public Map getKeyGeneratorParams() {
     }
 
     /**
-     * Determines whether the new key should be set to {@link org.eclipse.edc.identityhub.spi.model.KeyPairState#ACTIVE}.
-     * If this is set to {@code false}, the key pair will be created in the {@link org.eclipse.edc.identityhub.spi.model.KeyPairState#CREATED} state.
+     * Determines whether the new key should be set to {@code KeyPairState.ACTIVE}.
+     * If this is set to {@code false}, the key pair will be created in the {@code KeyPairState.CREATED} state.
      * Defaults to {@code true}.
      */
     public boolean isActive() {
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContext.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContext.java
similarity index 97%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContext.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContext.java
index ac3c2e5e3..4f09df64e 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContext.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContext.java
@@ -12,13 +12,12 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import org.eclipse.edc.identityhub.spi.model.ParticipantResource;
 
 import java.time.Instant;
 import java.util.ArrayList;
@@ -116,6 +115,11 @@ private Builder() {
             entity.createdAt = Instant.now().toEpochMilli();
         }
 
+        @JsonCreator
+        public static Builder newInstance() {
+            return new Builder();
+        }
+
         public Builder createdAt(long createdAt) {
             this.entity.createdAt = createdAt;
             return this;
@@ -136,6 +140,16 @@ public Builder participantId(String participantId) {
             return this;
         }
 
+        public ParticipantContext build() {
+            Objects.requireNonNull(entity.participantId, "Participant ID cannot be null");
+            Objects.requireNonNull(entity.apiTokenAlias, "API Token Alias cannot be null");
+
+            if (entity.getLastModified() == 0L) {
+                entity.lastModified = entity.getCreatedAt();
+            }
+            return super.build();
+        }
+
         public Builder state(ParticipantContextState state) {
             this.entity.state = state.ordinal();
             return this;
@@ -155,20 +169,5 @@ public Builder did(String did) {
             this.entity.did = did;
             return this;
         }
-
-        public ParticipantContext build() {
-            Objects.requireNonNull(entity.participantId, "Participant ID cannot be null");
-            Objects.requireNonNull(entity.apiTokenAlias, "API Token Alias cannot be null");
-
-            if (entity.getLastModified() == 0L) {
-                entity.lastModified = entity.getCreatedAt();
-            }
-            return super.build();
-        }
-
-        @JsonCreator
-        public static Builder newInstance() {
-            return new Builder();
-        }
     }
 }
\ No newline at end of file
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextState.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextState.java
similarity index 92%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextState.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextState.java
index 54dcb6b78..2deeb2ae6 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextState.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextState.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 /**
  * The state a {@link ParticipantContext} entry is in.
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantManifest.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantManifest.java
similarity index 98%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantManifest.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantManifest.java
index 6c9583d78..53452988b 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantManifest.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantManifest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@@ -89,6 +89,11 @@ private Builder() {
             manifest = new ParticipantManifest();
         }
 
+        @JsonCreator
+        public static Builder newInstance() {
+            return new Builder();
+        }
+
         public Builder serviceEndpoints(Set serviceEndpoints) {
             manifest.serviceEndpoints = serviceEndpoints;
             return this;
@@ -127,10 +132,5 @@ public Builder did(String did) {
         public ParticipantManifest build() {
             return manifest;
         }
-
-        @JsonCreator
-        public static Builder newInstance() {
-            return new Builder();
-        }
     }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/ParticipantResource.java b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantResource.java
similarity index 92%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/ParticipantResource.java
rename to spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantResource.java
index 036bd608f..04e041f6c 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/ParticipantResource.java
+++ b/spi/participant-context-spi/src/main/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantResource.java
@@ -12,9 +12,8 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
-import org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext;
 import org.eclipse.edc.spi.query.Criterion;
 import org.eclipse.edc.spi.query.QuerySpec;
 
@@ -24,6 +23,10 @@
 public abstract class ParticipantResource {
     protected String participantId;
 
+    public static QuerySpec.Builder queryByParticipantId(String participantId) {
+        return QuerySpec.Builder.newInstance().filter(new Criterion("participantId", "=", participantId));
+    }
+
     /**
      * The {@link ParticipantContext} that this resource belongs to.
      */
@@ -32,10 +35,6 @@ public String getParticipantId() {
         return participantId;
     }
 
-    public static QuerySpec.Builder queryByParticipantId(String participantId) {
-        return QuerySpec.Builder.newInstance().filter(new Criterion("participantId", "=", participantId));
-    }
-
     public abstract static class Builder> {
         protected final T entity;
 
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreatedTest.java b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreatedTest.java
similarity index 94%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreatedTest.java
rename to spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreatedTest.java
index 2377043c9..263d010d1 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextCreatedTest.java
+++ b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextCreatedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeletedTest.java b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeletedTest.java
similarity index 94%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeletedTest.java
rename to spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeletedTest.java
index c3c21591d..6082c24fa 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextDeletedTest.java
+++ b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextDeletedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdatedTest.java b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdatedTest.java
similarity index 94%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdatedTest.java
rename to spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdatedTest.java
index 6fc69ae63..e99b2d2b7 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/events/participant/ParticipantContextUpdatedTest.java
+++ b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/events/ParticipantContextUpdatedTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.events.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.events;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.eclipse.edc.json.JacksonTypeManager;
diff --git a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextTest.java b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextTest.java
similarity index 97%
rename from spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextTest.java
rename to spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextTest.java
index b13c71120..92c7c0210 100644
--- a/spi/identity-hub-spi/src/test/java/org/eclipse/edc/identityhub/spi/model/participant/ParticipantContextTest.java
+++ b/spi/participant-context-spi/src/test/java/org/eclipse/edc/identityhub/spi/participantcontext/model/ParticipantContextTest.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model.participant;
+package org.eclipse.edc.identityhub.spi.participantcontext.model;
 
 import org.junit.jupiter.api.Test;
 
diff --git a/spi/participant-context-spi/src/test/resources/cred.json b/spi/participant-context-spi/src/test/resources/cred.json
new file mode 100644
index 000000000..ddb7f4693
--- /dev/null
+++ b/spi/participant-context-spi/src/test/resources/cred.json
@@ -0,0 +1,20 @@
+{
+  "@context": [
+    "https://www.w3.org/2018/credentials/v1",
+    "https://www.w3.org/2018/credentials/examples/v1"
+  ],
+  "id": "http://example.gov/credentials/3732",
+  "type": [
+    "VerifiableCredential",
+    "UniversityDegreeCredential"
+  ],
+  "issuer": "https://example.edu",
+  "issuanceDate": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "BachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    }
+  }
+}
\ No newline at end of file
diff --git a/spi/verifiable-credential-spi/build.gradle.kts b/spi/verifiable-credential-spi/build.gradle.kts
new file mode 100644
index 000000000..f442ac4b0
--- /dev/null
+++ b/spi/verifiable-credential-spi/build.gradle.kts
@@ -0,0 +1,31 @@
+/*
+ *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Apache License, Version 2.0 which is available at
+ *  https://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Contributors:
+ *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *
+ */
+
+plugins {
+    `java-library`
+    `java-test-fixtures`
+    `maven-publish`
+}
+
+val swagger: String by project
+
+dependencies {
+
+    api(project(":spi:participant-context-spi"))
+    api(libs.edc.spi.iatp)
+
+    testImplementation(libs.edc.lib.json)
+    testFixturesImplementation(libs.nimbus.jwt)
+    testFixturesImplementation(libs.edc.spi.identity.did)
+}
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationCreatorRegistry.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationCreatorRegistry.java
similarity index 86%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationCreatorRegistry.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationCreatorRegistry.java
index 77cbbc72c..ec0f7c71a 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationCreatorRegistry.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationCreatorRegistry.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.generator;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.generator;
 
 
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat;
@@ -38,7 +38,7 @@ public interface PresentationCreatorRegistry {
      *
      * @param                   The type of the presentation. Can be {@link String}, when format is {@link CredentialFormat#JWT}, or {@link jakarta.json.JsonObject},
      *                             when the format is {@link CredentialFormat#JSON_LD}
-     * @param participantContextId The ID of the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} who creates the VP
+     * @param participantContextId The ID of the {@code ParticipantContext} who creates the VP
      * @param credentials          The list of verifiable credentials to include in the presentation.
      * @param format               The format for the presentation.
      * @param additionalData       Optional additional data that might be required to create the presentation, such as types, etc.
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationGenerator.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationGenerator.java
similarity index 94%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationGenerator.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationGenerator.java
index 869833efd..40817f770 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/PresentationGenerator.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/PresentationGenerator.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.generator;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.generator;
 
 
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/VerifiablePresentationService.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/VerifiablePresentationService.java
similarity index 81%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/VerifiablePresentationService.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/VerifiablePresentationService.java
index f93cbb401..71221ebe1 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/generator/VerifiablePresentationService.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/generator/VerifiablePresentationService.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.generator;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.generator;
 
 
 import org.eclipse.edc.iam.identitytrust.spi.model.PresentationResponseMessage;
@@ -32,7 +32,7 @@ public interface VerifiablePresentationService {
     /**
      * Creates a presentation based on a list of verifiable credentials and an optional presentation definition.
      *
-     * @param participantContextId   The ID or the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} for whom a VerifiablePresentation is to be created
+     * @param participantContextId   The ID or the {@code ParticipantContext} for whom a VerifiablePresentation is to be created
      * @param credentials            The list of verifiable credentials to include in the presentation.
      * @param presentationDefinition The optional presentation definition.
      * @param audience               The Participant ID of the party who the presentation is intended for. May not be relevant for all VP formats
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VcState.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VcState.java
similarity index 92%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VcState.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VcState.java
index 9b99440d4..cdb68be85 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VcState.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VcState.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.model;
 
 import java.util.Arrays;
 
@@ -33,11 +33,11 @@ public enum VcState {
         this.code = code;
     }
 
-    public int code() {
-        return code;
-    }
-
     public static VcState from(int code) {
         return Arrays.stream(values()).filter(tps -> tps.code == code).findFirst().orElse(null);
     }
+
+    public int code() {
+        return code;
+    }
 }
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VerifiableCredentialResource.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResource.java
similarity index 94%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VerifiableCredentialResource.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResource.java
index 4df825ef0..fd9bb26e3 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/model/VerifiableCredentialResource.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResource.java
@@ -12,10 +12,11 @@
  *
  */
 
-package org.eclipse.edc.identityhub.spi.model;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.model;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
+import org.eclipse.edc.identityhub.spi.participantcontext.model.IdentityResource;
 import org.eclipse.edc.policy.model.Policy;
 
 /**
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/CredentialQueryResolver.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/CredentialQueryResolver.java
similarity index 78%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/CredentialQueryResolver.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/CredentialQueryResolver.java
index 80e8f8015..f58086f8a 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/CredentialQueryResolver.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/CredentialQueryResolver.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.resolution;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution;
 
 
 import org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage;
@@ -30,7 +30,7 @@ public interface CredentialQueryResolver {
      * If a failure is returned, that means that the given query does not match the given issuer scopes, which would be equivalent to an unauthorized access (c.f. HTTP 403 error).
      * The Result could also contain information about any errors or issues the occurred during the query execution.
      *
-     * @param participantContextId The ID of the {@link org.eclipse.edc.identityhub.spi.model.participant.ParticipantContext} whose credentials are to be obtained.
+     * @param participantContextId The ID of the {@code ParticipantContext} whose credentials are to be obtained.
      * @param query                The representation of the query to be executed.
      * @param issuerScopes         The list of issuer scopes to be considered during the query processing.
      */
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryFailure.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryFailure.java
similarity index 76%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryFailure.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryFailure.java
index 93292e557..3b8ec740d 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryFailure.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryFailure.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.resolution;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution;
 
 import org.eclipse.edc.spi.result.Failure;
 
diff --git a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryResult.java b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryResult.java
similarity index 83%
rename from spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryResult.java
rename to spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryResult.java
index 7db8c0379..11dc36639 100644
--- a/spi/identity-hub-spi/src/main/java/org/eclipse/edc/identityhub/spi/resolution/QueryResult.java
+++ b/spi/verifiable-credential-spi/src/main/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/resolution/QueryResult.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,11 +8,11 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.resolution;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution;
 
 import org.eclipse.edc.iam.verifiablecredentials.spi.model.VerifiableCredentialContainer;
 import org.eclipse.edc.spi.result.AbstractResult;
@@ -22,9 +22,9 @@
 import java.util.List;
 import java.util.stream.Stream;
 
-import static org.eclipse.edc.identityhub.spi.resolution.QueryFailure.Reason.INVALID_SCOPE;
-import static org.eclipse.edc.identityhub.spi.resolution.QueryFailure.Reason.STORAGE_FAILURE;
-import static org.eclipse.edc.identityhub.spi.resolution.QueryFailure.Reason.UNAUTHORIZED_SCOPE;
+import static org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryFailure.Reason.INVALID_SCOPE;
+import static org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryFailure.Reason.STORAGE_FAILURE;
+import static org.eclipse.edc.identityhub.spi.verifiablecredentials.resolution.QueryFailure.Reason.UNAUTHORIZED_SCOPE;
 
 /**
  * Represents a query executed by the {@link CredentialQueryResolver}
diff --git a/spi/identity-hub-store-spi/src/test/java/org/eclipse/edc/identityhub/spi/store/model/VerifiableCredentialResourceTest.java b/spi/verifiable-credential-spi/src/test/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResourceTest.java
similarity index 82%
rename from spi/identity-hub-store-spi/src/test/java/org/eclipse/edc/identityhub/spi/store/model/VerifiableCredentialResourceTest.java
rename to spi/verifiable-credential-spi/src/test/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResourceTest.java
index 4b17d4ebd..1be96f6b7 100644
--- a/spi/identity-hub-store-spi/src/test/java/org/eclipse/edc/identityhub/spi/store/model/VerifiableCredentialResourceTest.java
+++ b/spi/verifiable-credential-spi/src/test/java/org/eclipse/edc/identityhub/spi/verifiablecredentials/model/VerifiableCredentialResourceTest.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+ *  Copyright (c) 2024 Metaform Systems, Inc.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Apache License, Version 2.0 which is available at
@@ -8,14 +8,12 @@
  *  SPDX-License-Identifier: Apache-2.0
  *
  *  Contributors:
- *       Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
+ *       Metaform Systems, Inc. - initial API and implementation
  *
  */
 
-package org.eclipse.edc.identityhub.spi.store.model;
+package org.eclipse.edc.identityhub.spi.verifiablecredentials.model;
 
-import org.eclipse.edc.identityhub.spi.model.VcState;
-import org.eclipse.edc.identityhub.spi.model.VerifiableCredentialResource;
 import org.junit.jupiter.api.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/spi/verifiable-credential-spi/src/test/resources/cred.json b/spi/verifiable-credential-spi/src/test/resources/cred.json
new file mode 100644
index 000000000..ddb7f4693
--- /dev/null
+++ b/spi/verifiable-credential-spi/src/test/resources/cred.json
@@ -0,0 +1,20 @@
+{
+  "@context": [
+    "https://www.w3.org/2018/credentials/v1",
+    "https://www.w3.org/2018/credentials/examples/v1"
+  ],
+  "id": "http://example.gov/credentials/3732",
+  "type": [
+    "VerifiableCredential",
+    "UniversityDegreeCredential"
+  ],
+  "issuer": "https://example.edu",
+  "issuanceDate": "2010-01-01T19:23:24Z",
+  "credentialSubject": {
+    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
+    "degree": {
+      "type": "BachelorDegree",
+      "name": "Bachelor of Science and Arts"
+    }
+  }
+}
\ No newline at end of file
diff --git a/spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/JwtCreationUtil.java b/spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/JwtCreationUtil.java
similarity index 91%
rename from spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/JwtCreationUtil.java
rename to spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/JwtCreationUtil.java
index 3821dbf9b..3b0c50684 100644
--- a/spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/JwtCreationUtil.java
+++ b/spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/JwtCreationUtil.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.junit.testfixtures;
+package org.eclipse.edc.identityhub.verifiablecredentials.testfixtures;
 
 import com.nimbusds.jose.jwk.ECKey;
 import com.nimbusds.jwt.JWTClaimsSet;
@@ -22,8 +22,8 @@
 import java.util.Map;
 import java.util.UUID;
 
-import static org.eclipse.edc.identityhub.junit.testfixtures.VerifiableCredentialTestUtil.buildSignedJwt;
-import static org.eclipse.edc.identityhub.junit.testfixtures.VerifiableCredentialTestUtil.generateEcKey;
+import static org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.VerifiableCredentialTestUtil.buildSignedJwt;
+import static org.eclipse.edc.identityhub.verifiablecredentials.testfixtures.VerifiableCredentialTestUtil.generateEcKey;
 
 /**
  * Utility class to generate various JWTs
diff --git a/spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/VerifiableCredentialTestUtil.java b/spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/VerifiableCredentialTestUtil.java
similarity index 96%
rename from spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/VerifiableCredentialTestUtil.java
rename to spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/VerifiableCredentialTestUtil.java
index 4cb0c67aa..e986bb000 100644
--- a/spi/identity-hub-spi/src/testFixtures/java/org/eclipse/edc/identityhub/junit/testfixtures/VerifiableCredentialTestUtil.java
+++ b/spi/verifiable-credential-spi/src/testFixtures/java/org/eclipse/edc/identityhub/verifiablecredentials/testfixtures/VerifiableCredentialTestUtil.java
@@ -12,7 +12,7 @@
  *
  */
 
-package org.eclipse.edc.identityhub.junit.testfixtures;
+package org.eclipse.edc.identityhub.verifiablecredentials.testfixtures;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.nimbusds.jose.JOSEException;