diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/IssuersCredentialControllerApiDocs.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/IssuersCredentialControllerApiDocs.java index 6686478b..fd3cd081 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/IssuersCredentialControllerApiDocs.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/IssuersCredentialControllerApiDocs.java @@ -1,10 +1,5 @@ package org.eclipse.tractusx.managedidentitywallets.apidocs; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; @@ -15,6 +10,11 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + public class IssuersCredentialControllerApiDocs { /** * The constant API_TAG_VERIFIABLE_CREDENTIAL_ISSUER. @@ -1178,7 +1178,6 @@ public class IssuersCredentialControllerApiDocs { public @interface IssueVerifiableCredentialUsingBaseWalletApiDocs { } - @Parameter(description = "Specifies whether the VC (Verifiable Credential) should be created as a JWT (JSON Web Token). " + "If set to true, the VC will be generated in JWT format" diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/HoldersCredentialController.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/HoldersCredentialController.java index 98cdcbeb..4e6452fa 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/HoldersCredentialController.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/HoldersCredentialController.java @@ -22,6 +22,9 @@ package org.eclipse.tractusx.managedidentitywallets.controller; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.constraints.Max; import jakarta.validation.constraints.Min; import lombok.RequiredArgsConstructor; @@ -38,10 +41,11 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.media.ExampleObject; -import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import java.security.Principal; import java.util.List; @@ -122,6 +126,6 @@ public ResponseEntity issueCredential(@RequestBody Map allowedVehicleBrands = Set.of(); - @JsonProperty("asJwt") - private boolean asJwt; } diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java index f0b48bf3..6c1b4b01 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/dto/IssueFrameworkCredentialRequest.java @@ -55,7 +55,6 @@ public class IssueFrameworkCredentialRequest { @NotBlank(message = "Please provide contract-template") @JsonProperty("contract-version") private String contractVersion; - @JsonProperty("asJwt") private boolean asJwt; diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/HoldersCredentialService.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/HoldersCredentialService.java index faef7995..4e6ade13 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/HoldersCredentialService.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/HoldersCredentialService.java @@ -163,7 +163,6 @@ public CredentialsResponse issueCredential(Map data, String call if (verifiableCredential.getExpirationDate() != null) { expiryDate = Date.from(verifiableCredential.getExpirationDate()); } - // Create Credential HoldersCredential credential = CommonUtils.getHoldersCredential(verifiableCredential.getCredentialSubject().get(0), verifiableCredential.getTypes(), issuerWallet.getDidDocument(), diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletKeyService.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletKeyService.java index 3f9a5933..a403c582 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletKeyService.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/service/WalletKeyService.java @@ -105,7 +105,7 @@ public Object getPrivateKeyByWalletIdAndAlgorithm(long walletId, SupportedAlgori } /** - * Gets wallet key by wallet identifier. + * Gets wallet key by wallet id. * * @param walletId the wallet id * @return the wallet key by wallet identifier @@ -115,5 +115,4 @@ public String getWalletKeyIdByWalletId(long walletId) { return walletKeyRepository.getByWalletId(walletId).getKeyId(); } - } diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/utils/CommonUtils.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/utils/CommonUtils.java index 8e09f600..487a9865 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/utils/CommonUtils.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/utils/CommonUtils.java @@ -196,7 +196,6 @@ public static String vcAsJwt(Wallet issuerWallet, Wallet holderWallet, Verifiabl SignedJWT vcJWT = vcFactory.createVCJwt(issuerDid, holderDid, vc, privateKey, walletKeyService.getWalletKeyIdByWalletId(issuerWallet.getId()) - ); return vcJWT.serialize(); }