From a3568fdef8a0426e45600625942899b08f292e9a Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger <43503240+paullatzelsperger@users.noreply.github.com> Date: Wed, 5 Jun 2024 13:28:10 +0200 Subject: [PATCH] refactor: rename Management API -> Identity API (#366) * refactor: rename Management API -> Identity API * refactor files, class names, etc. --- .github/workflows/apidoc.yaml | 2 +- .github/workflows/verify.yaml | 2 +- .../identity-and-trust-modules.md | 13 ++++--- .../identity.hub.architecture.md | 12 +++--- .../identity.hub.modules.puml | 4 +- .../architecture/mgmt-api.security.md | 26 ++++++------- .../tests/DidManagementApiEndToEndTest.java | 20 +++++----- ...Test.java => IdentityApiEndToEndTest.java} | 4 +- .../tests/KeyPairResourceApiEndToEndTest.java | 38 +++++++++---------- .../ParticipantContextApiEndToEndTest.java | 32 ++++++++-------- .../IdentityHubRuntimeConfiguration.java | 12 +++--- .../api-configuration/build.gradle.kts | 0 .../eclipse/edc/identityhub/api/Versions.java | 0 .../IdentityApiConfigurationExtension.java} | 18 ++------- ...rg.eclipse.edc.spi.system.ServiceExtension | 2 +- .../did-api/build.gradle.kts | 6 +-- .../DidManagementApiExtension.java | 2 +- .../v1/unstable/DidManagementApi.java | 2 +- .../unstable/DidManagementApiController.java | 0 .../v1/unstable/DidRequestPayload.java | 0 .../v1/unstable/GetAllDidsApi.java | 2 +- .../v1/unstable/GetAllDidsApiController.java | 0 ...rg.eclipse.edc.spi.system.ServiceExtension | 0 .../DidManagementApiControllerTest.java | 0 .../unstable/GetAllDidsApiControllerTest.java | 0 .../v1/unstable/TestFunctions.java | 0 .../keypair-api/build.gradle.kts | 6 +-- ...KeyPairResourceManagementApiExtension.java | 2 +- .../v1/unstable/GetAllKeyPairsApi.java | 2 +- .../unstable/GetAllKeyPairsApiController.java | 0 .../v1/unstable/KeyPairResourceApi.java | 2 +- .../KeyPairResourceApiController.java | 0 ...rg.eclipse.edc.spi.system.ServiceExtension | 0 .../KeyPairResourceApiControllerTest.java | 0 .../participant-context-api/build.gradle.kts | 6 +-- ...ticipantContextManagementApiExtension.java | 2 +- .../v1/unstable/ParticipantContextApi.java | 2 +- .../ParticipantContextApiController.java | 0 ...rg.eclipse.edc.spi.system.ServiceExtension | 0 .../ParticipantContextApiControllerTest.java | 0 .../v1/unstable/model/KeyDescriptorTest.java | 0 .../model/ParticipantManifestTest.java | 0 .../validators/build.gradle.kts | 0 .../v1/validation/KeyDescriptorValidator.java | 0 .../ParticipantManifestValidator.java | 0 .../KeyDescriptorValidatorTest.java | 0 .../ParticipantManifestValidatorTest.java | 0 .../build.gradle.kts | 4 +- .../VerifiableCredentialApiExtension.java | 2 +- .../v1/unstable/GetAllCredentialsApi.java | 2 +- .../GetAllCredentialsApiController.java | 0 .../v1/unstable/VerifiableCredentialsApi.java | 2 +- .../VerifiableCredentialsApiController.java | 0 ...rg.eclipse.edc.spi.system.ServiceExtension | 0 ...erifiableCredentialsApiControllerTest.java | 0 .../api/ApiAuthenticationExtension.java | 2 +- .../ParticipantServicePrincipalResolver.java | 2 +- .../api/ApiAuthorizationExtension.java | 2 +- launcher/build.gradle.kts | 10 ++--- settings.gradle.kts | 14 +++---- 60 files changed, 124 insertions(+), 135 deletions(-) rename e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/{ManagementApiEndToEndTest.java => IdentityApiEndToEndTest.java} (98%) rename extensions/api/{management-api => identity-api}/api-configuration/build.gradle.kts (100%) rename extensions/api/{management-api => identity-api}/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java (100%) rename extensions/api/{management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java => identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/IdentityApiConfigurationExtension.java} (71%) rename extensions/api/{management-api => identity-api}/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension (81%) rename extensions/api/{management-api => identity-api}/did-api/build.gradle.kts (86%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java (96%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java (98%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiController.java (100%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidRequestPayload.java (100%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java (95%) rename extensions/api/{management-api => identity-api}/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiController.java (100%) rename extensions/api/{management-api => identity-api}/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension (100%) rename extensions/api/{management-api => identity-api}/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiControllerTest.java (100%) rename extensions/api/{management-api => identity-api}/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiControllerTest.java (100%) rename extensions/api/{management-api => identity-api}/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/TestFunctions.java (100%) rename extensions/api/{management-api => identity-api}/keypair-api/build.gradle.kts (75%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java (96%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java (93%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApiController.java (100%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java (98%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiController.java (100%) rename extensions/api/{management-api => identity-api}/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension (100%) rename extensions/api/{management-api => identity-api}/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiControllerTest.java (100%) rename extensions/api/{management-api => identity-api}/participant-context-api/build.gradle.kts (86%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java (96%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java (98%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiController.java (100%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension (100%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiControllerTest.java (100%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/KeyDescriptorTest.java (100%) rename extensions/api/{management-api => identity-api}/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/ParticipantManifestTest.java (100%) rename extensions/api/{management-api => identity-api}/validators/build.gradle.kts (100%) rename extensions/api/{management-api => identity-api}/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java (100%) rename extensions/api/{management-api => identity-api}/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java (100%) rename extensions/api/{management-api => identity-api}/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java (100%) rename extensions/api/{management-api => identity-api}/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java (100%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/build.gradle.kts (83%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java (96%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java (93%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApiController.java (100%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java (97%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiController.java (100%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension (100%) rename extensions/api/{management-api => identity-api}/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiControllerTest.java (100%) diff --git a/.github/workflows/apidoc.yaml b/.github/workflows/apidoc.yaml index d80091ba7..98240a7b6 100644 --- a/.github/workflows/apidoc.yaml +++ b/.github/workflows/apidoc.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - apiGroup: [ 'ih-resolution-api', 'ih-management-api' ] + apiGroup: [ 'ih-resolution-api', 'identity-api' ] env: rootDir: resources/openapi/yaml/${{ matrix.apiGroup }} SWAGGERHUB_API_KEY: ${{ secrets.SWAGGERHUB_TOKEN }} diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index cb3039413..40cdadb51 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -54,7 +54,7 @@ jobs: -e "EDC_IH_IAM_PUBLICKEY_PATH=/opt/keys/key.pem" \ -e "EDC_IH_IAM_ID=did:web:test" \ -e "WEB_HTTP_IDENTITY_PORT=8182" \ - -e "WEB_HTTP_IDENTITY_PATH=/api/management" \ + -e "WEB_HTTP_IDENTITY_PATH=/api/identity" \ -e "WEB_HTTP_RESOLUTION_PORT=10001" \ -e "WEB_HTTP_RESOLUTION_PATH=/api/v1/resolution/" \ identity-hub:latest diff --git a/docs/developer/architecture/identity-trust-protocol/identity-and-trust-modules.md b/docs/developer/architecture/identity-trust-protocol/identity-and-trust-modules.md index f25b8fb11..18b73b4e6 100644 --- a/docs/developer/architecture/identity-trust-protocol/identity-and-trust-modules.md +++ b/docs/developer/architecture/identity-trust-protocol/identity-and-trust-modules.md @@ -6,9 +6,10 @@ Contains the `VerifiablePresentationService` and a `CredentialManager`.
Its job is to + - generate and serve VPs (through the [Hub API](#hub-api)) -- CRUD VCs, for example when the Issuer wants to write a VC via the [Hub API](#management-api) or -the [Management API](#management-api) +- CRUD VCs, for example when the Issuer wants to write a VC via the [Hub API](#identity-api) or + the [Identity API](#identity-api) - run the `VerifiableCredentialManager` - exchanges protocol messages with the Issuer, e.g. in response to a credential-offer @@ -18,7 +19,7 @@ is triggered , it moves into the `REISSUE_REQUESTING` state. Generally, renewals 1. an incoming credential offer 2. the state machine detects a nearing expiry (if auto-renewal is active) -3. a manual action via the management API +3. a manual action via the Identity API ## DID Module @@ -28,7 +29,7 @@ Contains the `DidResourceManager`. Its job is to - publish/overwrite DID documents using the publishers - react to key rotation events from the [KeyPair module](#keypair-module): adds new keys to the DID, removes old ones, etc. -- react to manual action via the management API +- react to manual action via the Identity API ## KeyPair Module @@ -37,7 +38,7 @@ Contains the `KeyPairStateMachine`. Its job is to - generate and maintain key pairs using a state machine - check for automatic renewal, e.g. if keys are configured with a max lifetime - send out events when a key is rotated -- react to manual action via the management API +- react to manual action via the Identity API ## Auth/Permission Module @@ -80,7 +81,7 @@ the [Storage API](https://github.com/eclipse-tractusx/identity-trust/blob/main/s Is contains model classes, validators and JSON-LD-transformers. -## Management API +## Identity API This module contains implementations to maintain internal data structures, such as: diff --git a/docs/developer/architecture/identity-trust-protocol/identity.hub.architecture.md b/docs/developer/architecture/identity-trust-protocol/identity.hub.architecture.md index 6741b8368..c7817b923 100644 --- a/docs/developer/architecture/identity-trust-protocol/identity.hub.architecture.md +++ b/docs/developer/architecture/identity-trust-protocol/identity.hub.architecture.md @@ -36,7 +36,7 @@ Two deployment topologies will be supported: A participant context (PC) functions as a unit of management and control for `identity resources` in the Identity Hub. All resources are contained and accessed through a PC. Contexts are tied to the participant identity as defined in the [DSP specifications](https://github.com/International-Data-Spaces-Association/ids-specification) and created through -the [IH Management API](#311-elevated-privilege-operations). +the [Identity API](#311-elevated-privilege-operations). Access control for public client API endpoints is scoped to a specific PC. For example, an access token as defined in the [Base Identity Protocol specification]() is associated with a specific context and may not be used to access @@ -240,9 +240,9 @@ public class AccessDefinition { > Note read access should not since some resources should be public. However, for C-X a read token for most types should > be required. -## 2.5. Management APIs +## 2.5. Identity APIs -The `Management API` executes authorized client requests to perform operational tasks against the Identity Hub +The `Identity API` executes authorized client requests to perform operational tasks against the Identity Hub installation. Operations fall into two groups: those requiring elevated privileges that affect the installation as a whole, and those that are scoped to a specific participant context. @@ -259,10 +259,10 @@ The following diagram depicts the Identity Hub module dependency graph: The term `installation` is used to denote an Identity Hub deployment that is operated as a unit. An `installation` may be a single runtime instance or a cluster of instances. -## 3.1. Management API +## 3.1. Identity API -The `Management API` is executes authorized client requests to perform operational tasks against the Identity Hub -installation. +The `Identity API` executes authorized client requests to perform operational tasks against the Identity Hub +installation such as adding or manipulating key pairs, DID documents etc. ### 3.1.1. Elevated Privilege Operations diff --git a/docs/developer/architecture/identity-trust-protocol/identity.hub.modules.puml b/docs/developer/architecture/identity-trust-protocol/identity.hub.modules.puml index 77787ed36..c7db831e2 100644 --- a/docs/developer/architecture/identity-trust-protocol/identity.hub.modules.puml +++ b/docs/developer/architecture/identity-trust-protocol/identity.hub.modules.puml @@ -20,7 +20,7 @@ title Identity Hub Modules frame "APIs" { component "Hub API" as HubApi <> - component "Management API" as ManagementApi <> + component "Identity API" as IdentityApi <> } component "Aggregate Services Module" as AggregateServices @@ -39,7 +39,7 @@ frame "Libraries" { } AggregateServices -up-> HubApi -AggregateServices -up-> ManagementApi +AggregateServices -up-> IdentityApi AuthModule -up-> AggregateServices diff --git a/docs/developer/architecture/mgmt-api.security.md b/docs/developer/architecture/mgmt-api.security.md index a9926ac33..98825a44f 100644 --- a/docs/developer/architecture/mgmt-api.security.md +++ b/docs/developer/architecture/mgmt-api.security.md @@ -1,4 +1,4 @@ -# On IdentityHub Management API security +# On IdentityHub Identity API security ## 1. Definition of terms @@ -11,10 +11,10 @@ IdentityHub!** - _Participant context_: this is the unit of management, that owns all resources. Its identifier must be equal to the `participantId` that is defined - in [DSP](https://github.com/International-Data-Spaces-Association/ids-specification). For the purposes of management + in [DSP](https://github.com/International-Data-Spaces-Association/ids-specification). For the purposes of Identity API operations, IdentityHub assumes the ID of the `ParticipantContext` to be equal to the ID of the `ServicePrincipal`. -- Management API: collective term for all endpoints that serve the purpose of managing participant contexts and their +- Identity API: collective term for all endpoints that serve the purpose of managing participant contexts and their resources. Also referred to as: mgmt api - API Key: a secret string that is used to authenticate/authorize a request and that is typically sent in the HTTP header. Also referred to as: API token, API secret, credential @@ -25,10 +25,10 @@ ### 2.1 Authentication of ServicePrincipals -When Management API requests are received by the web server, it (or a related function) must be able to derive +When Identity API requests are received by the web server, it (or a related function) must be able to derive the `ServicePrincipal` from the request context. In other words, it must be able to determine which participant sent the request. -For that, the Management API should employ methods that are widely known, such as Basic Auth or API keys. +For that, the Identity API should employ methods that are widely known, such as Basic Auth or API keys. Authentication (=user identification) should happen before the request is matched onto a controller method, so that the handling controller method can inject the `ServicePrincipal` using standard JAX-RS features: @@ -55,7 +55,7 @@ service is needed to perform the resource lookup. ### 2.3 Elevated access -Some operations in the Management API _require_ elevated access rights, for example modifying participant contexts, or +Some operations in the Identity API _require_ elevated access rights, for example modifying participant contexts, or listing resources across multiple participant contexts. The elevated access is tied to a [built-in role](#51-built-in-roles). The super-user has that role. @@ -66,7 +66,7 @@ super-user's `ServicePrincipal` does not technically own a resource, permissions ### 3.1 Authenticating a request -To access the Management API, every request must contain the `x-api-key` header, which contains the API key of the +To access the Identity API, every request must contain the `x-api-key` header, which contains the API key of the participant. This is a string that contains the service principal's ID (=`spId`) followed by a randomly generated character sequence. Both parts are base64-encoded: @@ -94,7 +94,7 @@ inject it for further processing. API keys are generated automatically when a new `ParticipantContext` is created. This API operation requires elevated access and can thus only be done by the super-user, and returns the new API key in the HTTP response. -IdentityHub's Management API does not provide a feature for participant self-registration, as it is not an +IdentityHub's Identity API does not provide a feature for participant self-registration, as it is not an end-user-facing API. This is intentional. New participant contexts must be created by the super-user. > The initial API key must be transmitted to the participant by the super-user in a secure out-of-band channel. @@ -103,7 +103,7 @@ end-user-facing API. This is intentional. New participant contexts must be creat ### 3.3 Regenerating the API key Once the participant has received the initial API key, it is highly recommended that it is immediately regenerated using -the Management API. Note that the initial API Key is required for that operation: +the Identity API. Note that the initial API Key is required for that operation: ```shell curl -X POST -H "x-api-key: " "http://your-identityhub.com/.../v1/participants//token" @@ -157,9 +157,9 @@ a `KeyPairResource` with `id`. As mentioned before, the `AuthorizationService` is responsible to establish the link between service principal and resource. It is a normal service which can be injected into controller classes. -Every management API module then contributes a _lookup function_ and the resource type it handles, which +Every Identity API module then contributes a _lookup function_ and the resource type it handles, which the `AuthorizationService` maintains and to which it dispatches based on resource class. For example the DID document -management API module: +management Identity API module: ```java @@ -259,7 +259,7 @@ permission levels may be required. Thus, the RBAC system used by EDC is extensib 1. role concept 2. access permissions based on roles -#### 5.2.1 Customize roles via Management API +#### 5.2.1 Customize roles via Identity API Roles are just labels that a `ParticipantContext` has attached to them, and there is no need for a complicated rule engine. The super-user can assign arbitrary roles to participants. @@ -315,7 +315,7 @@ However, swapping out the authorization module is possible, and necessary if RBA ## 7. General security considerations -- the Management API is **not** intended for public consumption and thus should **never** be exposed to the internet +- the Identity API is **not** intended for public consumption and thus should **never** be exposed to the internet directly. - if management operations must be accessbile over the internet, additional security measures such as API gateways, firewalls, additional authorization frontends, etc. must be in place. The specifics of that are beyond the scope of an 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 59756f580..99559bed7 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 @@ -37,7 +37,7 @@ import static org.mockito.Mockito.verifyNoInteractions; @EndToEndTest -public class DidManagementApiEndToEndTest extends ManagementApiEndToEndTest { +public class DidManagementApiEndToEndTest extends IdentityApiEndToEndTest { @Test void publishDid_notOwner_expect403() { @@ -60,7 +60,7 @@ void publishDid_notOwner_expect403() { reset(subscriber); // need to reset here, to ignore a previous interaction // attempt to publish user1's DID document, which should fail - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) .body(""" @@ -89,7 +89,7 @@ void publishDid() { assertThat(Arrays.asList(token, superUserKey)) .allSatisfy(t -> { reset(subscriber); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .body(""" @@ -136,7 +136,7 @@ void unpublishDid_notOwner_expect403() { reset(subscriber); // need to reset here, to ignore a previous interaction // attempt to publish user1's DID document, which should fail - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) .body(""" @@ -165,7 +165,7 @@ void unpublishDid() { assertThat(Arrays.asList(token, superUserKey)) .allSatisfy(t -> { reset(subscriber); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .body(""" @@ -198,7 +198,7 @@ void getState_nowOwner_expect403() { var user2 = "user2"; var token2 = createParticipant(user2); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", token2)) .contentType(JSON) .body(""" @@ -217,7 +217,7 @@ void getAll() { var superUserKey = createSuperUser(); range(0, 20).forEach(i -> createParticipant("user-" + i)); - var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var docs = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/dids") @@ -234,7 +234,7 @@ void getAll_withDefaultPaging() { var superUserKey = createSuperUser(); range(0, 70).forEach(i -> createParticipant("user-" + i)); - var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var docs = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/dids") @@ -251,7 +251,7 @@ void getAll_withPaging() { var superUserKey = createSuperUser(); range(0, 20).forEach(i -> createParticipant("user-" + i)); - var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var docs = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/dids?offset=5&limit=10") @@ -268,7 +268,7 @@ void getAll_notAuthorized() { var attackerToken = createParticipant("attacker"); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) .get("/v1alpha/dids") 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/IdentityApiEndToEndTest.java similarity index 98% rename from e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/ManagementApiEndToEndTest.java rename to e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/IdentityApiEndToEndTest.java index fb14d177f..c9cdb593a 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/IdentityApiEndToEndTest.java @@ -41,9 +41,9 @@ import java.util.Map; /** - * Base class for all management API tests + * Base class for all Identity API tests */ -public abstract class ManagementApiEndToEndTest { +public abstract class IdentityApiEndToEndTest { public static final String SUPER_USER = "super-user"; protected static final IdentityHubRuntimeConfiguration RUNTIME_CONFIGURATION = IdentityHubRuntimeConfiguration.Builder.newInstance() .name("identity-hub") 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 846ff397b..d02fea1cf 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 @@ -46,7 +46,7 @@ import static org.mockito.Mockito.verify; @EndToEndTest -public class KeyPairResourceApiEndToEndTest extends ManagementApiEndToEndTest { +public class KeyPairResourceApiEndToEndTest extends IdentityApiEndToEndTest { private static KeyDescriptor.Builder createKeyDescriptor(String participantId) { var id = UUID.randomUUID().toString(); @@ -73,7 +73,7 @@ void findById_notAuthorized() { var key = createKeyPair(user1); // attempt to publish user1's DID document, which should fail - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) .get("/v1alpha/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) @@ -92,7 +92,7 @@ void findById() { var key = createKeyPair(user1); assertThat(Arrays.asList(token, superUserKey)) - .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + .allSatisfy(t -> RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .get("/v1alpha/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) @@ -119,7 +119,7 @@ void findForParticipant_notAuthorized() { createKeyPair(user1); // attempt to publish user1's DID document, which should fail - var res = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var res = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) .get("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) @@ -140,7 +140,7 @@ void findForParticipant() { createKeyPair(user1); assertThat(Arrays.asList(token, superUserKey)) - .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + .allSatisfy(t -> RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .get("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) @@ -163,7 +163,7 @@ void addKeyPair() { assertThat(Arrays.asList(token, superUserKey)) .allSatisfy(t -> { var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) @@ -194,7 +194,7 @@ void addKeyPair_notAuthorized() { // attempt to publish user1's DID document, which should fail var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) @@ -229,7 +229,7 @@ void rotate() { reset(subscriber); // attempt to publish user1's DID document, which should fail var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) @@ -271,7 +271,7 @@ void rotate_notAuthorized() { // attempt to publish user1's DID document, which should fail var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) @@ -301,7 +301,7 @@ void revoke() { assertThat(Arrays.asList(token, superUserKey)) .allSatisfy(t -> { var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) @@ -328,7 +328,7 @@ void revoke_notAuthorized() { // attempt to publish user1's DID document, which should fail var keyDesc = createKeyDescriptor(user1).build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) @@ -347,7 +347,7 @@ void getAll() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/keypairs") @@ -366,7 +366,7 @@ void getAll_withPaging() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/keypairs?offset=2&limit=4") @@ -385,7 +385,7 @@ void getAll_withDefaultPaging() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/keypairs") @@ -405,7 +405,7 @@ void getAll_notAuthorized() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) .get("/v1alpha/keypairs") @@ -423,7 +423,7 @@ void activate() { assertThat(Arrays.asList(token, superUserKey)) .allSatisfy(t -> { - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) @@ -445,7 +445,7 @@ void activate_notAuthorized() { var keyId = createKeyPair(user1); var attackerToken = createParticipant("attacker"); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) @@ -466,7 +466,7 @@ void activate_illegalState() { var keyId = createKeyPair(user1); // first revoke the key, which puts it in the REVOKED state - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token)) .post("/v1alpha/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) @@ -476,7 +476,7 @@ void activate_illegalState() { .body(notNullValue()); // now attempt to activate - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token)) .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) 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 798b37f27..b569fca1f 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 @@ -48,13 +48,13 @@ import static org.mockito.Mockito.verifyNoInteractions; @EndToEndTest -public class ParticipantContextApiEndToEndTest extends ManagementApiEndToEndTest { +public class ParticipantContextApiEndToEndTest extends IdentityApiEndToEndTest { @Test void getUserById() { var apikey = createSuperUser(); - var su = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var su = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", apikey)) .get("/v1alpha/participants/" + toBase64(SUPER_USER)) .then() @@ -82,7 +82,7 @@ void getUserById_notOwner_expect403() { var apiToken2 = storeParticipant(user2Context); //user1 attempts to read user2 -> fail - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", apiToken1)) .contentType(ContentType.JSON) .get("/v1alpha/participants/" + toBase64(user2)) @@ -99,7 +99,7 @@ void createNewUser_principalIsSuperser() { var manifest = createNewParticipant().build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", apikey)) .contentType(ContentType.JSON) .body(manifest) @@ -130,7 +130,7 @@ void createNewUser_verifyKeyPairActive(boolean isActive) { .key(createKeyDescriptor().active(isActive).build()) .build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", apikey)) .contentType(ContentType.JSON) .body(manifest) @@ -164,7 +164,7 @@ void createNewUser_principalIsNotSuperuser_expect403() { var apiToken = storeParticipant(anotherUser); var manifest = createNewParticipant().build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", apiToken)) .contentType(ContentType.JSON) .body(manifest) @@ -186,7 +186,7 @@ void createNewUser_principalIsKnown_expect401() { var manifest = createNewParticipant().build(); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", createTokenFor(principal))) .contentType(ContentType.JSON) .body(manifest) @@ -214,7 +214,7 @@ void activateParticipant_principalIsSuperser() { .build(); storeParticipant(anotherUser); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) .post("/v1alpha/participants/%s/state?isActive=true".formatted(toBase64(participantId))) @@ -240,7 +240,7 @@ void deleteParticipant() { assertThat(getDidForParticipant(participantId)).hasSize(1); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) .delete("/v1alpha/participants/%s".formatted(toBase64(participantId))) @@ -258,7 +258,7 @@ void regenerateToken() { var userToken = createParticipant(participantId); assertThat(Arrays.asList(userToken, superUserKey)) - .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + .allSatisfy(t -> RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", t)) .contentType(ContentType.JSON) .post("/v1alpha/participants/%s/token".formatted(toBase64(participantId))) @@ -274,7 +274,7 @@ void updateRoles() { var participantId = "some-user"; createParticipant(participantId); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) .body(List.of("role1", "role2", "admin")) @@ -292,7 +292,7 @@ void updateRoles_whenNotSuperuser(String role) { var participantId = "some-user"; var userToken = createParticipant(participantId); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .header(new Header("x-api-key", userToken)) .contentType(ContentType.JSON) .body(List.of(role)) @@ -310,7 +310,7 @@ void getAll() { var participantId = "user" + i; createParticipant(participantId); }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/participants") @@ -329,7 +329,7 @@ void getAll_withPaging() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/participants?offset=2&limit=4") @@ -348,7 +348,7 @@ void getAll_withDefaultPaging() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + var found = RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) .get("/v1alpha/participants") @@ -368,7 +368,7 @@ void getAll_notAuthorized() { var participantId = "user" + i; createParticipant(participantId); // implicitly creates a keypair }); - RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() + RUNTIME_CONFIGURATION.getIdentityApiEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) .get("/v1alpha/participants") diff --git a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/fixtures/IdentityHubRuntimeConfiguration.java b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/fixtures/IdentityHubRuntimeConfiguration.java index 0f237db6b..b99b04893 100644 --- a/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/fixtures/IdentityHubRuntimeConfiguration.java +++ b/e2e-tests/api-tests/src/test/java/org/eclipse/edc/identityhub/tests/fixtures/IdentityHubRuntimeConfiguration.java @@ -30,7 +30,7 @@ public class IdentityHubRuntimeConfiguration { private Endpoint resolutionEndpoint; - private Endpoint managementEndpoint; + private Endpoint identityEndpoint; private String id; private String name; @@ -46,16 +46,16 @@ public Map controlPlaneConfiguration() { put("web.http.path", "/api/v1"); put("web.http.resolution.port", String.valueOf(resolutionEndpoint.getUrl().getPort())); put("web.http.resolution.path", resolutionEndpoint.getUrl().getPath()); - put("web.http.identity.port", String.valueOf(managementEndpoint.getUrl().getPort())); - put("web.http.identity.path", managementEndpoint.getUrl().getPath()); + put("web.http.identity.port", String.valueOf(identityEndpoint.getUrl().getPort())); + put("web.http.identity.path", identityEndpoint.getUrl().getPath()); put("edc.runtime.id", name); put("edc.ih.iam.id", "did:web:consumer"); } }; } - public Endpoint getManagementEndpoint() { - return managementEndpoint; + public Endpoint getIdentityApiEndpoint() { + return identityEndpoint; } public static final class Builder { @@ -81,7 +81,7 @@ public Builder name(String name) { public IdentityHubRuntimeConfiguration build() { participant.resolutionEndpoint = new Endpoint(URI.create("http://localhost:" + getFreePort() + "/api/v1/resolution"), Map.of()); - participant.managementEndpoint = new Endpoint(URI.create("http://localhost:" + getFreePort() + "/api/management"), Map.of()); + participant.identityEndpoint = new Endpoint(URI.create("http://localhost:" + getFreePort() + "/api/management"), Map.of()); return participant; } } diff --git a/extensions/api/management-api/api-configuration/build.gradle.kts b/extensions/api/identity-api/api-configuration/build.gradle.kts similarity index 100% rename from extensions/api/management-api/api-configuration/build.gradle.kts rename to extensions/api/identity-api/api-configuration/build.gradle.kts diff --git a/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java b/extensions/api/identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java similarity index 100% rename from extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java rename to extensions/api/identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java diff --git a/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java b/extensions/api/identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/IdentityApiConfigurationExtension.java similarity index 71% rename from extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java rename to extensions/api/identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/IdentityApiConfigurationExtension.java index 54a379a52..1d13f4a0b 100644 --- a/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/ManagementApiConfigurationExtension.java +++ b/extensions/api/identity-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/configuration/IdentityApiConfigurationExtension.java @@ -27,28 +27,16 @@ import org.eclipse.edc.web.spi.WebServer; import org.eclipse.edc.web.spi.WebService; import org.eclipse.edc.web.spi.configuration.WebServiceConfigurer; -import org.eclipse.edc.web.spi.configuration.WebServiceSettings; import java.util.function.Function; -import static org.eclipse.edc.identityhub.api.configuration.ManagementApiConfigurationExtension.NAME; +import static org.eclipse.edc.identityhub.api.configuration.IdentityApiConfigurationExtension.NAME; @Extension(value = NAME) -public class ManagementApiConfigurationExtension implements ServiceExtension { +public class IdentityApiConfigurationExtension implements ServiceExtension { - public static final String NAME = "Management API Extension"; - private static final String MGMT_CONTEXT_ALIAS = "management"; - private static final String DEFAULT_DID_PATH = "/api/management"; - private static final int DEFAULT_DID_PORT = 8182; - public static final WebServiceSettings SETTINGS = WebServiceSettings.Builder.newInstance() - .apiConfigKey("web.http." + MGMT_CONTEXT_ALIAS) - .contextAlias(MGMT_CONTEXT_ALIAS) - .defaultPath(DEFAULT_DID_PATH) - .defaultPort(DEFAULT_DID_PORT) - .useDefaultContext(false) - .name("IdentityHub Management API") - .build(); + public static final String NAME = "Identity API Extension"; @Inject private WebService webService; @Inject diff --git a/extensions/api/management-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/identity-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 81% rename from extensions/api/management-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/identity-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension index bf7162d0f..9b50957b8 100644 --- a/extensions/api/management-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension +++ b/extensions/api/identity-api/api-configuration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension @@ -12,4 +12,4 @@ # # -org.eclipse.edc.identityhub.api.configuration.ManagementApiConfigurationExtension +org.eclipse.edc.identityhub.api.configuration.IdentityApiConfigurationExtension diff --git a/extensions/api/management-api/did-api/build.gradle.kts b/extensions/api/identity-api/did-api/build.gradle.kts similarity index 86% rename from extensions/api/management-api/did-api/build.gradle.kts rename to extensions/api/identity-api/did-api/build.gradle.kts index 9bf74ff23..a659c0851 100644 --- a/extensions/api/management-api/did-api/build.gradle.kts +++ b/extensions/api/identity-api/did-api/build.gradle.kts @@ -22,8 +22,8 @@ dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) api(project(":spi:did-spi")) - implementation(project(":extensions:api:management-api:api-configuration")) - implementation(project(":extensions:api:management-api:validators")) + implementation(project(":extensions:api:identity-api:api-configuration")) + implementation(project(":extensions:api:identity-api:validators")) implementation(libs.edc.spi.validator) implementation(libs.edc.spi.web) implementation(libs.edc.core.jerseyproviders) @@ -40,6 +40,6 @@ dependencies { edcBuild { swagger { - apiGroup.set("ih-management-api") + apiGroup.set("identity-api") } } diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java similarity index 96% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java index de0881028..82b828b0e 100644 --- a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java +++ b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/DidManagementApiExtension.java @@ -31,7 +31,7 @@ @Extension(value = NAME) public class DidManagementApiExtension implements ServiceExtension { - public static final String NAME = "DID Management API Extension"; + public static final String NAME = "DID management Identity API Extension"; @Inject private WebService webService; diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java similarity index 98% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java index 6b8c989fd..fbe15aeff 100644 --- a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java +++ b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApi.java @@ -35,7 +35,7 @@ import java.util.Collection; @OpenAPIDefinition( - info = @Info(description = "This is the Management API for DID documents", title = "DID Management API", version = "1")) + info = @Info(description = "This is the Identity API for manipulating DID documents", title = "DID Identity API", version = "1")) @Tag(name = "DID") public interface DidManagementApi { diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiController.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiController.java similarity index 100% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiController.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiController.java diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidRequestPayload.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidRequestPayload.java similarity index 100% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidRequestPayload.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidRequestPayload.java diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java similarity index 95% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java index 446ffc409..8a89e1ad9 100644 --- a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java +++ b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApi.java @@ -29,7 +29,7 @@ import java.util.Collection; @OpenAPIDefinition( - info = @Info(description = "This is the Management API for DID documents", title = "DID Management API", version = "1")) + info = @Info(description = "This is the Identity API for DID documents", title = "DID Identity API", version = "1")) @Tag(name = "DID") public interface GetAllDidsApi { diff --git a/extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiController.java b/extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiController.java similarity index 100% rename from extensions/api/management-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiController.java rename to extensions/api/identity-api/did-api/src/main/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiController.java diff --git a/extensions/api/management-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/identity-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/management-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/identity-api/did-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiControllerTest.java b/extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiControllerTest.java similarity index 100% rename from extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiControllerTest.java rename to extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/DidManagementApiControllerTest.java diff --git a/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiControllerTest.java b/extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiControllerTest.java similarity index 100% rename from extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiControllerTest.java rename to extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/GetAllDidsApiControllerTest.java diff --git a/extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/TestFunctions.java b/extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/TestFunctions.java similarity index 100% rename from extensions/api/management-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/TestFunctions.java rename to extensions/api/identity-api/did-api/src/test/java/org/eclipse/edc/identityhub/api/didmanagement/v1/unstable/TestFunctions.java diff --git a/extensions/api/management-api/keypair-api/build.gradle.kts b/extensions/api/identity-api/keypair-api/build.gradle.kts similarity index 75% rename from extensions/api/management-api/keypair-api/build.gradle.kts rename to extensions/api/identity-api/keypair-api/build.gradle.kts index a711672f9..78316d4a3 100644 --- a/extensions/api/management-api/keypair-api/build.gradle.kts +++ b/extensions/api/identity-api/keypair-api/build.gradle.kts @@ -9,8 +9,8 @@ dependencies { api(project(":spi:identity-hub-spi")) api(project(":spi:keypair-spi")) api(project(":spi:identity-hub-store-spi")) - implementation(project(":extensions:api:management-api:api-configuration")) - implementation(project(":extensions:api:management-api:validators")) + implementation(project(":extensions:api:identity-api:api-configuration")) + implementation(project(":extensions:api:identity-api:validators")) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) implementation(libs.jakarta.rsApi) @@ -23,6 +23,6 @@ dependencies { edcBuild { swagger { - apiGroup.set("ih-management-api") + apiGroup.set("identity-api") } } \ No newline at end of file diff --git a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java similarity index 96% rename from extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java rename to extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java index 2a1997c0f..1c6d51328 100644 --- a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java +++ b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/KeyPairResourceManagementApiExtension.java @@ -37,7 +37,7 @@ @Extension(NAME) public class KeyPairResourceManagementApiExtension implements ServiceExtension { - public static final String NAME = "KeyPairResource Management API Extension"; + public static final String NAME = "KeyPairResource management Identity API Extension"; @Inject private WebService webService; diff --git a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java similarity index 93% rename from extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java rename to extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java index 0baca876b..47d7b28e7 100644 --- a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java +++ b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApi.java @@ -29,7 +29,7 @@ import java.util.Collection; -@OpenAPIDefinition(info = @Info(description = "This is the Management API for KeyPairResources", title = "KeyPairResources Management API", version = "1")) +@OpenAPIDefinition(info = @Info(description = "This is the Identity API for manipulating KeyPairResources", title = "KeyPairResources Identity API", version = "1")) @Tag(name = "Key Pairs") public interface GetAllKeyPairsApi { diff --git a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApiController.java b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApiController.java similarity index 100% rename from extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApiController.java rename to extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/GetAllKeyPairsApiController.java diff --git a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java similarity index 98% rename from extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java rename to extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java index 3e2576e29..2a3f18b10 100644 --- a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java +++ b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApi.java @@ -33,7 +33,7 @@ import java.util.Collection; -@OpenAPIDefinition(info = @Info(description = "This is the Management API for KeyPairResources", title = "KeyPairResources Management API", version = "1")) +@OpenAPIDefinition(info = @Info(description = "This is the Identity API for manipulating KeyPairResources", title = "KeyPairResources Identity API", version = "1")) @Tag(name = "Key Pairs") public interface KeyPairResourceApi { diff --git a/extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiController.java b/extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiController.java similarity index 100% rename from extensions/api/management-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiController.java rename to extensions/api/identity-api/keypair-api/src/main/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiController.java diff --git a/extensions/api/management-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/identity-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/management-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/identity-api/keypair-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/management-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiControllerTest.java b/extensions/api/identity-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiControllerTest.java similarity index 100% rename from extensions/api/management-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiControllerTest.java rename to extensions/api/identity-api/keypair-api/src/test/java/org/eclipse/edc/identityhub/api/keypair/v1/unstable/KeyPairResourceApiControllerTest.java diff --git a/extensions/api/management-api/participant-context-api/build.gradle.kts b/extensions/api/identity-api/participant-context-api/build.gradle.kts similarity index 86% rename from extensions/api/management-api/participant-context-api/build.gradle.kts rename to extensions/api/identity-api/participant-context-api/build.gradle.kts index a74ddcd2e..5517b5d00 100644 --- a/extensions/api/management-api/participant-context-api/build.gradle.kts +++ b/extensions/api/identity-api/participant-context-api/build.gradle.kts @@ -22,8 +22,8 @@ dependencies { api(libs.edc.spi.core) api(project(":spi:identity-hub-spi")) api(project(":spi:did-spi")) - implementation(project(":extensions:api:management-api:api-configuration")) - implementation(project(":extensions:api:management-api:validators")) + implementation(project(":extensions:api:identity-api:api-configuration")) + implementation(project(":extensions:api:identity-api:validators")) implementation(libs.edc.spi.validator) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) @@ -43,6 +43,6 @@ dependencies { edcBuild { swagger { - apiGroup.set("ih-management-api") + apiGroup.set("identity-api") } } diff --git a/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java b/extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java similarity index 96% rename from extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java rename to extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java index 9ff255314..4ed9d4283 100644 --- a/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java +++ b/extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/ParticipantContextManagementApiExtension.java @@ -33,7 +33,7 @@ @Extension(value = NAME) public class ParticipantContextManagementApiExtension implements ServiceExtension { - public static final String NAME = "ParticipantContext Management API Extension"; + public static final String NAME = "ParticipantContext management Identity API Extension"; @Inject private WebService webService; @Inject diff --git a/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java b/extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java similarity index 98% rename from extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java rename to extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java index 0d0588402..f087aedeb 100644 --- a/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java +++ b/extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApi.java @@ -32,7 +32,7 @@ import java.util.Collection; import java.util.List; -@OpenAPIDefinition(info = @Info(description = "This is the Management API for ParticipantContexts", title = "ParticipantContext Management API", version = "1")) +@OpenAPIDefinition(info = @Info(description = "This is the Identity API for manipulating ParticipantContexts", title = "ParticipantContext Management API", version = "1")) @Tag(name = "Participant Context") public interface ParticipantContextApi { diff --git a/extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiController.java b/extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiController.java similarity index 100% rename from extensions/api/management-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiController.java rename to extensions/api/identity-api/participant-context-api/src/main/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiController.java diff --git a/extensions/api/management-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/identity-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/management-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/identity-api/participant-context-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiControllerTest.java b/extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiControllerTest.java similarity index 100% rename from extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiControllerTest.java rename to extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/ParticipantContextApiControllerTest.java diff --git a/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/KeyDescriptorTest.java b/extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/KeyDescriptorTest.java similarity index 100% rename from extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/KeyDescriptorTest.java rename to extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/KeyDescriptorTest.java diff --git a/extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/ParticipantManifestTest.java b/extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/ParticipantManifestTest.java similarity index 100% rename from extensions/api/management-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/ParticipantManifestTest.java rename to extensions/api/identity-api/participant-context-api/src/test/java/org/eclipse/edc/identityhub/api/participantcontext/v1/unstable/model/ParticipantManifestTest.java diff --git a/extensions/api/management-api/validators/build.gradle.kts b/extensions/api/identity-api/validators/build.gradle.kts similarity index 100% rename from extensions/api/management-api/validators/build.gradle.kts rename to extensions/api/identity-api/validators/build.gradle.kts diff --git a/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java b/extensions/api/identity-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java similarity index 100% rename from extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java rename to extensions/api/identity-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidator.java diff --git a/extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java b/extensions/api/identity-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java similarity index 100% rename from extensions/api/management-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java rename to extensions/api/identity-api/validators/src/main/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidator.java diff --git a/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java b/extensions/api/identity-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java similarity index 100% rename from extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java rename to extensions/api/identity-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/KeyDescriptorValidatorTest.java diff --git a/extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java b/extensions/api/identity-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java similarity index 100% rename from extensions/api/management-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java rename to extensions/api/identity-api/validators/src/test/java/org/eclipse/edc/identityhub/api/v1/validation/ParticipantManifestValidatorTest.java diff --git a/extensions/api/management-api/verifiable-credentials-api/build.gradle.kts b/extensions/api/identity-api/verifiable-credentials-api/build.gradle.kts similarity index 83% rename from extensions/api/management-api/verifiable-credentials-api/build.gradle.kts rename to extensions/api/identity-api/verifiable-credentials-api/build.gradle.kts index 328931ea4..b7b2376bb 100644 --- a/extensions/api/management-api/verifiable-credentials-api/build.gradle.kts +++ b/extensions/api/identity-api/verifiable-credentials-api/build.gradle.kts @@ -9,7 +9,7 @@ dependencies { api(project(":spi:identity-hub-spi")) api(project(":spi:identity-hub-store-spi")) api(project(":spi:verifiable-credential-spi")) - implementation(project(":extensions:api:management-api:api-configuration")) + implementation(project(":extensions:api:identity-api:api-configuration")) implementation(libs.edc.spi.web) implementation(libs.edc.lib.util) implementation(libs.jakarta.rsApi) @@ -22,6 +22,6 @@ dependencies { edcBuild { swagger { - apiGroup.set("ih-management-api") + apiGroup.set("identity-api") } } \ No newline at end of file diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java similarity index 96% rename from extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java rename to extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java index 6b66c3288..a74a7428a 100644 --- a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java +++ b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/VerifiableCredentialApiExtension.java @@ -34,7 +34,7 @@ @Extension(NAME) public class VerifiableCredentialApiExtension implements ServiceExtension { - public static final String NAME = "VerifiableCredentials Management API Extension"; + public static final String NAME = "VerifiableCredentials API Extension"; @Inject private WebService webService; diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java similarity index 93% rename from extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java rename to extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java index 50b9d7cd2..2b4804b4f 100644 --- a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java +++ b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApi.java @@ -28,7 +28,7 @@ import java.util.Collection; -@OpenAPIDefinition(info = @Info(description = "This is the Management API for VerifiableCredentials", title = "VerifiableCredentials Management API", version = "1")) +@OpenAPIDefinition(info = @Info(description = "This is the Identity Identity API for VerifiableCredentials", title = "VerifiableCredentials Identity API", version = "1")) @Tag(name = "Verifiable Credentials") public interface GetAllCredentialsApi { diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApiController.java b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApiController.java similarity index 100% rename from extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApiController.java rename to extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/GetAllCredentialsApiController.java diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java similarity index 97% rename from extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java rename to extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java index 254ec0d44..f2a4475dc 100644 --- a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java +++ b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApi.java @@ -32,7 +32,7 @@ import java.util.Collection; -@OpenAPIDefinition(info = @Info(description = "This is the Management API for VerifiableCredentials", title = "VerifiableCredentials Management API", version = "1")) +@OpenAPIDefinition(info = @Info(description = "This is the Identity API for manipulating VerifiableCredentials", title = "VerifiableCredentials Identity API", version = "1")) @Tag(name = "Verifiable Credentials") public interface VerifiableCredentialsApi { diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiController.java b/extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiController.java similarity index 100% rename from extensions/api/management-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiController.java rename to extensions/api/identity-api/verifiable-credentials-api/src/main/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiController.java diff --git a/extensions/api/management-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/extensions/api/identity-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension similarity index 100% rename from extensions/api/management-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension rename to extensions/api/identity-api/verifiable-credentials-api/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension diff --git a/extensions/api/management-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiControllerTest.java b/extensions/api/identity-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiControllerTest.java similarity index 100% rename from extensions/api/management-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiControllerTest.java rename to extensions/api/identity-api/verifiable-credentials-api/src/test/java/org/eclipse/edc/identityhub/api/verifiablecredentials/v1/unstable/VerifiableCredentialsApiControllerTest.java 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 a910e69e1..4041fcc91 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 @@ -30,7 +30,7 @@ @Extension(NAME) public class ApiAuthenticationExtension implements ServiceExtension { - public static final String NAME = "Management API Authentication Extension"; + public static final String NAME = "Identity API Authentication Extension"; @Inject private WebService webService; @Inject 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 5f9b95bf6..5e6f5d0a0 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 @@ -26,7 +26,7 @@ import java.util.List; /** - * For the purposes of the Management API of the IdentityHub, a {@link ServicePrincipal} is represented by a {@link ParticipantContext}. However, the request filter chain ({@link ServicePrincipalAuthenticationFilter} + * For the purposes of the Identity API of the IdentityHub, a {@link ServicePrincipal} is represented by a {@link ParticipantContext}. However, the request filter chain ({@link ServicePrincipalAuthenticationFilter} * etc.) * do not need to know about that, they only know about {@link ServicePrincipal} and {@link ServicePrincipalResolver}. Thus, this implementation acts as bridge. Other authentication backends like Apache Shiro would call this a _realm_. */ diff --git a/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthorizationExtension.java b/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthorizationExtension.java index deb3f93b2..291761188 100644 --- a/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthorizationExtension.java +++ b/extensions/api/identityhub-api-authorization/src/main/java/org/eclipse/edc/identityhub/api/ApiAuthorizationExtension.java @@ -25,7 +25,7 @@ @Extension(NAME) public class ApiAuthorizationExtension implements ServiceExtension { - public static final String NAME = "Management API Authorization Extension"; + public static final String NAME = "Identity API Authorization Extension"; @Override public String name() { diff --git a/launcher/build.gradle.kts b/launcher/build.gradle.kts index d381ac31e..992699d5c 100644 --- a/launcher/build.gradle.kts +++ b/launcher/build.gradle.kts @@ -26,11 +26,11 @@ dependencies { runtimeOnly(project(":core:identity-hub-keypairs")) runtimeOnly(project(":extensions:did:local-did-publisher")) runtimeOnly(project(":extensions:common:credential-watchdog")) - 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:identity-api:did-api")) + runtimeOnly(project(":extensions:api:identity-api:participant-context-api")) + runtimeOnly(project(":extensions:api:identity-api:verifiable-credentials-api")) + runtimeOnly(project(":extensions:api:identity-api:keypair-api")) + runtimeOnly(project(":extensions:api:identity-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 1e7b92b09..85d7057f8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -51,15 +51,15 @@ include(":extensions:store:sql:identity-hub-keypair-store-sql") include(":extensions:did:local-did-publisher") include(":extensions:common:credential-watchdog") -// management APIs -include(":extensions:api:management-api:validators") -include(":extensions:api:management-api:api-configuration") +// Identity APIs +include(":extensions:api:identity-api:validators") +include(":extensions:api:identity-api:api-configuration") include(":extensions:api:identityhub-api-authentication") include(":extensions:api:identityhub-api-authorization") -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:identity-api:participant-context-api") +include(":extensions:api:identity-api:verifiable-credentials-api") +include(":extensions:api:identity-api:did-api") +include(":extensions:api:identity-api:keypair-api") // other modules include(":launcher")