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 bf4222f20..59756f580 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 @@ -68,7 +68,7 @@ void publishDid_notOwner_expect403() { "did": "did:web:user1" } """) - .post("/v1/participants/%s/dids/publish".formatted(user1)) + .post("/v1alpha/participants/%s/dids/publish".formatted(user1)) .then() .log().ifValidationFails() .statusCode(403) @@ -97,7 +97,7 @@ void publishDid() { "did": "did:web:test-user" } """) - .post("/v1/participants/%s/dids/publish".formatted(user)) + .post("/v1alpha/participants/%s/dids/publish".formatted(user)) .then() .log().ifValidationFails() .statusCode(204) @@ -144,7 +144,7 @@ void unpublishDid_notOwner_expect403() { "did": "did:web:user1" } """) - .post("/v1/participants/%s/dids/unpublish".formatted(user1)) + .post("/v1alpha/participants/%s/dids/unpublish".formatted(user1)) .then() .log().ifValidationFails() .statusCode(403) @@ -173,7 +173,7 @@ void unpublishDid() { "did": "did:web:test-user" } """) - .post("/v1/participants/%s/dids/unpublish".formatted(user)) + .post("/v1alpha/participants/%s/dids/unpublish".formatted(user)) .then() .log().ifValidationFails() .statusCode(204) @@ -206,7 +206,7 @@ void getState_nowOwner_expect403() { "did": "did:web:user1" } """) - .post("/v1/participants/%s/dids/state".formatted(user1)) + .post("/v1alpha/participants/%s/dids/state".formatted(user1)) .then() .log().ifValidationFails() .statusCode(403); @@ -220,7 +220,7 @@ void getAll() { var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/dids") + .get("/v1alpha/dids") .then() .log().ifValidationFails() .statusCode(200) @@ -237,7 +237,7 @@ void getAll_withDefaultPaging() { var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/dids") + .get("/v1alpha/dids") .then() .log().ifValidationFails() .statusCode(200) @@ -254,7 +254,7 @@ void getAll_withPaging() { var docs = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/dids?offset=5&limit=10") + .get("/v1alpha/dids?offset=5&limit=10") .then() .log().ifValidationFails() .statusCode(200) @@ -271,7 +271,7 @@ void getAll_notAuthorized() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) - .get("/v1/dids") + .get("/v1alpha/dids") .then() .log().ifValidationFails() .statusCode(403); 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 1f1f1e9b3..846ff397b 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 @@ -76,7 +76,7 @@ void findById_notAuthorized() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) - .get("/v1/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) + .get("/v1alpha/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) .then() .log().ifValidationFails() .statusCode(403) @@ -95,7 +95,7 @@ void findById() { .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) - .get("/v1/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) + .get("/v1alpha/participants/%s/keypairs/%s".formatted(toBase64(user1), key)) .then() .log().ifValidationFails() .statusCode(200) @@ -122,7 +122,7 @@ void findForParticipant_notAuthorized() { var res = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", user2Token)) - .get("/v1/participants/%s/keypairs".formatted(toBase64(user1))) + .get("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) .then() .log().ifValidationFails() .statusCode(200) @@ -143,7 +143,7 @@ void findForParticipant() { .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) - .get("/v1/participants/%s/keypairs".formatted(toBase64(user1))) + .get("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) .then() .log().ifValidationFails() .statusCode(200) @@ -167,7 +167,7 @@ void addKeyPair() { .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) - .put("/v1/participants/%s/keypairs".formatted(toBase64(user1))) + .put("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) .then() .log().ifValidationFails() .statusCode(204) @@ -198,7 +198,7 @@ void addKeyPair_notAuthorized() { .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) - .put("/v1/participants/%s/keypairs".formatted(toBase64(user1))) + .put("/v1alpha/participants/%s/keypairs".formatted(toBase64(user1))) .then() .log().ifValidationFails() .statusCode(403) @@ -233,7 +233,7 @@ void rotate() { .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) - .post("/v1/participants/%s/keypairs/%s/rotate".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/rotate".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(204) @@ -275,7 +275,7 @@ void rotate_notAuthorized() { .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) - .post("/v1/participants/%s/keypairs/%s/rotate".formatted(user1, keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/rotate".formatted(user1, keyId)) .then() .log().ifValidationFails() .statusCode(403) @@ -305,7 +305,7 @@ void revoke() { .contentType(JSON) .header(new Header("x-api-key", t)) .body(keyDesc) - .post("/v1/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(204) @@ -332,7 +332,7 @@ void revoke_notAuthorized() { .contentType(JSON) .header(new Header("x-api-key", token2)) .body(keyDesc) - .post("/v1/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(403) @@ -350,7 +350,7 @@ void getAll() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/keypairs") + .get("/v1alpha/keypairs") .then() .log().ifValidationFails() .statusCode(200) @@ -369,7 +369,7 @@ void getAll_withPaging() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/keypairs?offset=2&limit=4") + .get("/v1alpha/keypairs?offset=2&limit=4") .then() .log().ifValidationFails() .statusCode(200) @@ -388,7 +388,7 @@ void getAll_withDefaultPaging() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/keypairs") + .get("/v1alpha/keypairs") .then() .log().ifValidationFails() .statusCode(200) @@ -408,7 +408,7 @@ void getAll_notAuthorized() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) - .get("/v1/keypairs") + .get("/v1alpha/keypairs") .then() .log().ifValidationFails() .statusCode(403); @@ -426,7 +426,7 @@ void activate() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", t)) - .post("/v1/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(204) @@ -448,7 +448,7 @@ void activate_notAuthorized() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) - .post("/v1/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(403) @@ -469,7 +469,7 @@ void activate_illegalState() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token)) - .post("/v1/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/revoke".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(204) @@ -479,7 +479,7 @@ void activate_illegalState() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", token)) - .post("/v1/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) + .post("/v1alpha/participants/%s/keypairs/%s/activate".formatted(toBase64(user1), keyId)) .then() .log().ifValidationFails() .statusCode(400) 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 92d10e2da..798b37f27 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 @@ -56,7 +56,7 @@ void getUserById() { var su = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .header(new Header("x-api-key", apikey)) - .get("/v1/participants/" + toBase64(SUPER_USER)) + .get("/v1alpha/participants/" + toBase64(SUPER_USER)) .then() .statusCode(200) .extract().body().as(ParticipantContext.class); @@ -85,7 +85,7 @@ void getUserById_notOwner_expect403() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .header(new Header("x-api-key", apiToken1)) .contentType(ContentType.JSON) - .get("/v1/participants/" + toBase64(user2)) + .get("/v1alpha/participants/" + toBase64(user2)) .then() .log().ifValidationFails() .statusCode(403); @@ -103,7 +103,7 @@ void createNewUser_principalIsSuperser() { .header(new Header("x-api-key", apikey)) .contentType(ContentType.JSON) .body(manifest) - .post("/v1/participants/") + .post("/v1alpha/participants/") .then() .log().ifError() .statusCode(anyOf(equalTo(200), equalTo(204))) @@ -134,7 +134,7 @@ void createNewUser_verifyKeyPairActive(boolean isActive) { .header(new Header("x-api-key", apikey)) .contentType(ContentType.JSON) .body(manifest) - .post("/v1/participants/") + .post("/v1alpha/participants/") .then() .log().ifError() .statusCode(anyOf(equalTo(200), equalTo(204))) @@ -168,7 +168,7 @@ void createNewUser_principalIsNotSuperuser_expect403() { .header(new Header("x-api-key", apiToken)) .contentType(ContentType.JSON) .body(manifest) - .post("/v1/participants/") + .post("/v1alpha/participants/") .then() .log().ifError() .statusCode(403) @@ -190,7 +190,7 @@ void createNewUser_principalIsKnown_expect401() { .header(new Header("x-api-key", createTokenFor(principal))) .contentType(ContentType.JSON) .body(manifest) - .post("/v1/participants/") + .post("/v1alpha/participants/") .then() .log().ifError() .statusCode(401) @@ -217,7 +217,7 @@ void activateParticipant_principalIsSuperser() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) - .post("/v1/participants/%s/state?isActive=true".formatted(toBase64(participantId))) + .post("/v1alpha/participants/%s/state?isActive=true".formatted(toBase64(participantId))) .then() .log().ifError() .statusCode(204); @@ -243,7 +243,7 @@ void deleteParticipant() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) - .delete("/v1/participants/%s".formatted(toBase64(participantId))) + .delete("/v1alpha/participants/%s".formatted(toBase64(participantId))) .then() .log().ifError() .statusCode(204); @@ -261,7 +261,7 @@ void regenerateToken() { .allSatisfy(t -> RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .header(new Header("x-api-key", t)) .contentType(ContentType.JSON) - .post("/v1/participants/%s/token".formatted(toBase64(participantId))) + .post("/v1alpha/participants/%s/token".formatted(toBase64(participantId))) .then() .log().ifError() .statusCode(200) @@ -278,7 +278,7 @@ void updateRoles() { .header(new Header("x-api-key", superUserKey)) .contentType(ContentType.JSON) .body(List.of("role1", "role2", "admin")) - .put("/v1/participants/%s/roles".formatted(toBase64(participantId))) + .put("/v1alpha/participants/%s/roles".formatted(toBase64(participantId))) .then() .log().ifError() .statusCode(204); @@ -296,7 +296,7 @@ void updateRoles_whenNotSuperuser(String role) { .header(new Header("x-api-key", userToken)) .contentType(ContentType.JSON) .body(List.of(role)) - .put("/v1/participants/%s/roles".formatted(toBase64(participantId))) + .put("/v1alpha/participants/%s/roles".formatted(toBase64(participantId))) .then() .log().ifError() .statusCode(403); @@ -313,7 +313,7 @@ void getAll() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/participants") + .get("/v1alpha/participants") .then() .log().ifValidationFails() .statusCode(200) @@ -332,7 +332,7 @@ void getAll_withPaging() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/participants?offset=2&limit=4") + .get("/v1alpha/participants?offset=2&limit=4") .then() .log().ifValidationFails() .statusCode(200) @@ -351,7 +351,7 @@ void getAll_withDefaultPaging() { var found = RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", superUserKey)) - .get("/v1/participants") + .get("/v1alpha/participants") .then() .log().ifValidationFails() .statusCode(200) @@ -371,7 +371,7 @@ void getAll_notAuthorized() { RUNTIME_CONFIGURATION.getManagementEndpoint().baseRequest() .contentType(JSON) .header(new Header("x-api-key", attackerToken)) - .get("/v1/participants") + .get("/v1alpha/participants") .then() .log().ifValidationFails() .statusCode(403); diff --git a/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java b/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java new file mode 100644 index 000000000..fd635adac --- /dev/null +++ b/extensions/api/management-api/api-configuration/src/main/java/org/eclipse/edc/identityhub/api/Versions.java @@ -0,0 +1,21 @@ +/* + * 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.api; + +public interface Versions { + String UNSTABLE = "/v1alpha"; + // Once /v1 has become stable, there will be a String STABLE = "/v1" + // Once /v2 has become stable, there will be a String DEPRECATED = "/v1", and STABLE = "/v2" +} diff --git a/extensions/api/management-api/did-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 index 39f0fcad2..460b2faad 100644 --- a/extensions/api/management-api/did-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 @@ -16,8 +16,8 @@ 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.api.didmanagement.v1.unstable.DidManagementApiController; +import org.eclipse.edc.identityhub.api.didmanagement.v1.unstable.GetAllDidsApiController; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; import org.eclipse.edc.runtime.metamodel.annotation.Extension; diff --git a/extensions/api/management-api/did-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/unstable/DidManagementApi.java similarity index 93% rename from extensions/api/management-api/did-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/unstable/DidManagementApi.java index 3bc9330ff..6b8c989fd 100644 --- a/extensions/api/management-api/did-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/unstable/DidManagementApi.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.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; @@ -41,7 +41,7 @@ public interface DidManagementApi { @Operation(description = "Publish an (existing) DID document. The DID is expected to exist in the database.", operationId = "publishDid", - parameters = {@Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH)}, + parameters = { @Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH) }, requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = DidRequestPayload.class), mediaType = "application/json")), responses = { @ApiResponse(responseCode = "200", description = "The DID document was successfully published."), @@ -55,7 +55,7 @@ public interface DidManagementApi { @Operation(description = "Un-Publish an (existing) DID document. The DID is expected to exist in the database.", operationId = "unpublishDid", - parameters = {@Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH)}, + parameters = { @Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH) }, requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = DidRequestPayload.class), mediaType = "application/json")), responses = { @ApiResponse(responseCode = "200", description = "The DID document was successfully un-published."), @@ -71,7 +71,7 @@ public interface DidManagementApi { @Operation(description = "Query for DID documents.", operationId = "queryDids", - parameters = {@Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH)}, + parameters = { @Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH) }, requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = QuerySpec.class), mediaType = "application/json")), responses = { @ApiResponse(responseCode = "200", description = "The list of DID Documents.", @@ -86,7 +86,7 @@ public interface DidManagementApi { @Operation(description = "Get state of a DID document", operationId = "getDidState", - parameters = {@Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH)}, + parameters = { @Parameter(name = "participantId", description = "Base64-Url encode Participant Context ID", required = true, in = ParameterIn.PATH) }, requestBody = @RequestBody(content = @Content(schema = @Schema(implementation = DidRequestPayload.class), mediaType = "application/json")), responses = { @ApiResponse(responseCode = "200", description = "The DID state was successfully obtained"), diff --git a/extensions/api/management-api/did-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/unstable/DidManagementApiController.java similarity index 95% rename from extensions/api/management-api/did-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/unstable/DidManagementApiController.java index a0a42ed5a..3ac6db640 100644 --- a/extensions/api/management-api/did-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/unstable/DidManagementApiController.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.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -29,6 +29,7 @@ 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.api.Versions; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.spi.result.ServiceResult; @@ -40,7 +41,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/participants/{participantId}/dids") +@Path(Versions.UNSTABLE + "/participants/{participantId}/dids") public class DidManagementApiController implements DidManagementApi { private final DidDocumentService documentService; diff --git a/extensions/api/management-api/did-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/unstable/DidRequestPayload.java similarity index 78% rename from extensions/api/management-api/did-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/unstable/DidRequestPayload.java index 772f3c653..9cc4aeb85 100644 --- a/extensions/api/management-api/did-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/unstable/DidRequestPayload.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.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; /** * JSON container for a DID diff --git a/extensions/api/management-api/did-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/unstable/GetAllDidsApi.java similarity index 96% rename from extensions/api/management-api/did-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/unstable/GetAllDidsApi.java index 0978d3cd4..446ffc409 100644 --- a/extensions/api/management-api/did-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/unstable/GetAllDidsApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; @@ -38,7 +38,7 @@ public interface GetAllDidsApi { operationId = "getAllDids", 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 DID Documents.", content = @Content(array = @ArraySchema(schema = @Schema(implementation = DidDocument.class)))), diff --git a/extensions/api/management-api/did-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/unstable/GetAllDidsApiController.java similarity index 92% rename from extensions/api/management-api/did-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/unstable/GetAllDidsApiController.java index dbb884089..ab682ab3d 100644 --- a/extensions/api/management-api/did-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/unstable/GetAllDidsApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.Consumes; @@ -24,6 +24,7 @@ import jakarta.ws.rs.core.MediaType; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; import org.eclipse.edc.spi.query.QuerySpec; import org.eclipse.edc.web.spi.exception.InvalidRequestException; @@ -34,7 +35,7 @@ @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -@Path("/v1/dids") +@Path(Versions.UNSTABLE + "/dids") public class GetAllDidsApiController implements GetAllDidsApi { private final DidDocumentService documentService; diff --git a/extensions/api/management-api/did-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/unstable/DidManagementApiControllerTest.java similarity index 98% rename from extensions/api/management-api/did-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/unstable/DidManagementApiControllerTest.java index 08a36c19f..7eceaf290 100644 --- a/extensions/api/management-api/did-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/unstable/DidManagementApiControllerTest.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,13 +12,14 @@ * */ -package org.eclipse.edc.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; 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.spi.did.DidDocumentService; import org.eclipse.edc.identithub.spi.did.model.DidResource; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.junit.annotations.ApiTest; import org.eclipse.edc.spi.query.Criterion; @@ -33,7 +34,7 @@ import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.identityhub.api.didmanagement.v1.TestFunctions.createDidDocument; +import static org.eclipse.edc.identityhub.api.didmanagement.v1.unstable.TestFunctions.createDidDocument; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.mockito.ArgumentMatchers.any; @@ -64,7 +65,7 @@ protected DidManagementApiController controller() { private RequestSpecification baseRequest() { return given() .contentType("application/json") - .baseUri("http://localhost:" + port + "/v1/participants/test-participant/dids") + .baseUri("http://localhost:" + port + Versions.UNSTABLE + "/participants/test-participant/dids") .when(); } diff --git a/extensions/api/management-api/did-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/unstable/GetAllDidsApiControllerTest.java similarity index 85% rename from extensions/api/management-api/did-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/unstable/GetAllDidsApiControllerTest.java index 9330db61f..8966fabe4 100644 --- a/extensions/api/management-api/did-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/unstable/GetAllDidsApiControllerTest.java @@ -12,10 +12,11 @@ * */ -package org.eclipse.edc.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.identithub.spi.did.DidDocumentService; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.spi.result.ServiceResult; import org.eclipse.edc.web.jersey.testfixtures.RestControllerTestBase; import org.junit.jupiter.api.Test; @@ -24,7 +25,7 @@ import static io.restassured.RestAssured.given; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.edc.identityhub.api.didmanagement.v1.TestFunctions.createDidDocument; +import static org.eclipse.edc.identityhub.api.didmanagement.v1.unstable.TestFunctions.createDidDocument; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -41,7 +42,7 @@ void getAll() { var docs = given() .when() .contentType("application/json") - .baseUri("http://localhost:" + port + "/v1/dids") + .baseUri("http://localhost:" + port + Versions.UNSTABLE + "/dids") .get() .then() .statusCode(200) diff --git a/extensions/api/management-api/did-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/unstable/TestFunctions.java similarity index 94% rename from extensions/api/management-api/did-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/unstable/TestFunctions.java index 2db3b1b54..b341936c9 100644 --- a/extensions/api/management-api/did-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/unstable/TestFunctions.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.didmanagement.v1; +package org.eclipse.edc.identityhub.api.didmanagement.v1.unstable; import org.eclipse.edc.iam.did.spi.document.DidDocument; import org.eclipse.edc.iam.did.spi.document.Service; diff --git a/extensions/api/management-api/keypair-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 index 68d2592e7..66158387d 100644 --- a/extensions/api/management-api/keypair-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 @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.api.keypair; -import org.eclipse.edc.identityhub.api.keypair.v1.GetAllKeyPairsApiController; -import org.eclipse.edc.identityhub.api.keypair.v1.KeyPairResourceApiController; +import org.eclipse.edc.identityhub.api.keypair.v1.unstable.GetAllKeyPairsApiController; +import org.eclipse.edc.identityhub.api.keypair.v1.unstable.KeyPairResourceApiController; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; diff --git a/extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApi.java similarity index 97% rename from extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApi.java index 5e788f111..0baca876b 100644 --- a/extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.keypair.v1; +package org.eclipse.edc.identityhub.api.keypair.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; diff --git a/extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApiController.java similarity index 92% rename from extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApiController.java index a365b72da..4c4ad4c96 100644 --- a/extensions/api/management-api/keypair-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/unstable/GetAllKeyPairsApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.keypair.v1; +package org.eclipse.edc.identityhub.api.keypair.v1.unstable; import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.Consumes; @@ -21,6 +21,7 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; import org.eclipse.edc.identityhub.spi.keypair.model.KeyPairResource; @@ -33,7 +34,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/keypairs") +@Path(Versions.UNSTABLE + "/keypairs") public class GetAllKeyPairsApiController implements GetAllKeyPairsApi { private final KeyPairService keyPairService; diff --git a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApi.java similarity index 99% rename from extensions/api/management-api/keypair-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/unstable/KeyPairResourceApi.java index 8314552ee..3e2576e29 100644 --- a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.keypair.v1; +package org.eclipse.edc.identityhub.api.keypair.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; diff --git a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiController.java similarity index 97% rename from extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiController.java index ca73d3453..9bd171b48 100644 --- a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.keypair.v1; +package org.eclipse.edc.identityhub.api.keypair.v1.unstable; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.GET; @@ -24,6 +24,7 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.SecurityContext; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; @@ -47,7 +48,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/participants/{participantId}/keypairs") +@Path(Versions.UNSTABLE + "/participants/{participantId}/keypairs") public class KeyPairResourceApiController implements KeyPairResourceApi { private final AuthorizationService authorizationService; diff --git a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiControllerTest.java similarity index 98% rename from extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiControllerTest.java index 833d62cd6..b00f71d72 100644 --- a/extensions/api/management-api/keypair-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/unstable/KeyPairResourceApiControllerTest.java @@ -12,10 +12,11 @@ * */ -package org.eclipse.edc.identityhub.api.keypair.v1; +package org.eclipse.edc.identityhub.api.keypair.v1.unstable; import io.restassured.http.ContentType; import io.restassured.specification.RequestSpecification; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.api.v1.validation.KeyDescriptorValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.keypair.KeyPairService; @@ -362,7 +363,7 @@ private KeyPairResource.Builder createKeyPair() { private RequestSpecification baseRequest() { return given() .contentType("application/json") - .baseUri("http://localhost:" + port + "/v1/participants/%s/keypairs".formatted(PARTICIPANT_ID_ENCODED)) + .baseUri("http://localhost:" + port + Versions.UNSTABLE + "/participants/%s/keypairs".formatted(PARTICIPANT_ID_ENCODED)) .when(); } } \ No newline at end of file diff --git a/extensions/api/management-api/participant-context-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 index 95cabda45..9ff270ac4 100644 --- a/extensions/api/management-api/participant-context-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 @@ -14,7 +14,7 @@ package org.eclipse.edc.identityhub.api.participantcontext; -import org.eclipse.edc.identityhub.api.participantcontext.v1.ParticipantContextApiController; +import org.eclipse.edc.identityhub.api.participantcontext.v1.unstable.ParticipantContextApiController; import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; diff --git a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApi.java similarity index 99% rename from extensions/api/management-api/participant-context-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/unstable/ParticipantContextApi.java index c2adf2ae0..0d0588402 100644 --- a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.participantcontext.v1; +package org.eclipse.edc.identityhub.api.participantcontext.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; diff --git a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiController.java similarity index 97% rename from extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiController.java index 95a62b7fa..270837012 100644 --- a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.participantcontext.v1; +package org.eclipse.edc.identityhub.api.participantcontext.v1.unstable; import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.Consumes; @@ -27,6 +27,7 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.SecurityContext; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; @@ -46,7 +47,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/participants") +@Path(Versions.UNSTABLE + "/participants") public class ParticipantContextApiController implements ParticipantContextApi { private final ParticipantManifestValidator participantManifestValidator; diff --git a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiControllerTest.java similarity index 98% rename from extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiControllerTest.java index 54f74e3aa..c5603eb12 100644 --- a/extensions/api/management-api/participant-context-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/unstable/ParticipantContextApiControllerTest.java @@ -12,13 +12,14 @@ * */ -package org.eclipse.edc.identityhub.api.participantcontext.v1; +package org.eclipse.edc.identityhub.api.participantcontext.v1.unstable; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.Curve; import com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator; import io.restassured.http.ContentType; import io.restassured.specification.RequestSpecification; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.api.v1.validation.ParticipantManifestValidator; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextService; @@ -286,7 +287,7 @@ private ParticipantContext.Builder createParticipantContext() { private RequestSpecification baseRequest() { return given() .contentType("application/json") - .baseUri("http://localhost:" + port + "/v1/participants") + .baseUri("http://localhost:" + port + Versions.UNSTABLE + "/participants") .when(); } diff --git a/extensions/api/management-api/participant-context-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/unstable/model/KeyDescriptorTest.java similarity index 94% rename from extensions/api/management-api/participant-context-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/unstable/model/KeyDescriptorTest.java index be92290f6..2d6c8ef38 100644 --- a/extensions/api/management-api/participant-context-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/unstable/model/KeyDescriptorTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.participantcontext.v1.model; +package org.eclipse.edc.identityhub.api.participantcontext.v1.unstable.model; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/extensions/api/management-api/participant-context-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/unstable/model/ParticipantManifestTest.java similarity index 95% rename from extensions/api/management-api/participant-context-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/unstable/model/ParticipantManifestTest.java index fcdd3bb4e..177eebaf3 100644 --- a/extensions/api/management-api/participant-context-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/unstable/model/ParticipantManifestTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.participantcontext.v1.model; +package org.eclipse.edc.identityhub.api.participantcontext.v1.unstable.model; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/extensions/api/management-api/verifiable-credentials-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 index b2c8f68f9..030114198 100644 --- a/extensions/api/management-api/verifiable-credentials-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 @@ -14,8 +14,8 @@ package org.eclipse.edc.identityhub.api.verifiablecredentials; -import org.eclipse.edc.identityhub.api.verifiablecredentials.v1.GetAllCredentialsApiController; -import org.eclipse.edc.identityhub.api.verifiablecredentials.v1.VerifiableCredentialsApiController; +import org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable.GetAllCredentialsApiController; +import org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable.VerifiableCredentialsApiController; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.ManagementApiConfiguration; import org.eclipse.edc.identityhub.spi.participantcontext.model.ParticipantResource; diff --git a/extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApi.java similarity index 99% rename from extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApi.java index b25d7c9d8..50b9d7cd2 100644 --- a/extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.verifiablecredentials.v1; +package org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; diff --git a/extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApiController.java similarity index 95% rename from extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApiController.java index bbf5231c8..ba1b0a4b6 100644 --- a/extensions/api/management-api/verifiable-credentials-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/unstable/GetAllCredentialsApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.verifiablecredentials.v1; +package org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable; import jakarta.annotation.security.RolesAllowed; import jakarta.ws.rs.Consumes; @@ -21,6 +21,7 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.QueryParam; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.spi.authentication.ServicePrincipal; import org.eclipse.edc.identityhub.spi.store.CredentialStore; import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; @@ -34,7 +35,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/credentials") +@Path(Versions.UNSTABLE + "/credentials") public class GetAllCredentialsApiController implements GetAllCredentialsApi { private final CredentialStore credentialStore; diff --git a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApi.java similarity index 99% rename from extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApi.java index 3f06663ed..254ec0d44 100644 --- a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApi.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.verifiablecredentials.v1; +package org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.Operation; diff --git a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiController.java similarity index 96% rename from extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiController.java index 1f2d88ee2..9fb66fb2b 100644 --- a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiController.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.verifiablecredentials.v1; +package org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -23,6 +23,7 @@ import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.SecurityContext; +import org.eclipse.edc.identityhub.api.Versions; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.store.CredentialStore; import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; @@ -39,7 +40,7 @@ @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) -@Path("/v1/participants/{participantId}/credentials") +@Path(Versions.UNSTABLE + "/participants/{participantId}/credentials") public class VerifiableCredentialsApiController implements VerifiableCredentialsApi { private final CredentialStore credentialStore; diff --git a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiControllerTest.java similarity index 97% rename from extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiControllerTest.java index eea1a9bed..929d96882 100644 --- a/extensions/api/management-api/verifiable-credentials-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/unstable/VerifiableCredentialsApiControllerTest.java @@ -12,7 +12,7 @@ * */ -package org.eclipse.edc.identityhub.api.verifiablecredentials.v1; +package org.eclipse.edc.identityhub.api.verifiablecredentials.v1.unstable; import io.restassured.specification.RequestSpecification; import org.eclipse.edc.iam.verifiablecredentials.spi.model.CredentialFormat; @@ -20,6 +20,7 @@ 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.api.Versions; import org.eclipse.edc.identityhub.spi.AuthorizationService; import org.eclipse.edc.identityhub.spi.store.CredentialStore; import org.eclipse.edc.identityhub.spi.verifiablecredentials.model.VerifiableCredentialResource; @@ -214,7 +215,7 @@ private VerifiableCredentialResource.Builder createCredential(String... types) { private RequestSpecification baseRequest() { return given() .contentType("application/json") - .baseUri("http://localhost:" + port + "/v1/participants/test-participant/credentials") + .baseUri("http://localhost:" + port + Versions.UNSTABLE + "/participants/test-participant/credentials") .when(); } } \ No newline at end of file