-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change the versioning of the endpoints from v2 to v1. * Update CHANGELOG.md * ADD dynamic VP expiration * FIX application yaml * FIX test * ADD tests * FIX version and ADD changelog * CHANGE version to v1.1.1 * changes * Update application.yml * Update VerifiablePresentationController.java * return an empty list instead of an error * changes * Update build.gradle * Update VerifiablePresentationControllerTest.java * update zoneTIme * Update status code to 404 when user don't have credentials * Solve requested changes * dome changes * Test * test * Added a exception to ExceptionHandler * Rename exception * rename property * Update exception * Update DEFAULT_VC_TYPES_FOR_DOME_VERIFIER * Return the available format without modifiying the original vc_json * Tests * Test for patterns * test * Revert "test" This reverts commit 5331044. * test * Add again the LearCredential type because we will be able to login on Dome portal with the LEAR, and added error management for authorisation response dome * Changes * Update UserDataServiceImpl.java * Use only one model of credentialBasicInfo * Update application.yml * added todo --------- Co-authored-by: AzureAD\JiaboWang <jiabo.wang@in2.es>
- Loading branch information
1 parent
3a3620d
commit 9017978
Showing
37 changed files
with
776 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ plugins { | |
} | ||
|
||
group = 'es.in2' | ||
version = '1.1.1' | ||
version = '1.1.2' | ||
|
||
java { | ||
sourceCompatibility = '17' | ||
|
5 changes: 4 additions & 1 deletion
5
src/main/java/es/in2/wallet/application/service/DomeAttestationExchangeService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package es.in2.wallet.application.service; | ||
|
||
import es.in2.wallet.domain.model.VcSelectorRequest; | ||
import es.in2.wallet.domain.model.VcSelectorResponse; | ||
import reactor.core.publisher.Mono; | ||
|
||
|
||
public interface DomeAttestationExchangeService { | ||
Mono<Void> getSelectableCredentialsRequiredToBuildThePresentation(String processId, String authorizationToken, String qrContent); | ||
Mono<VcSelectorRequest> getSelectableCredentialsRequiredToBuildThePresentation(String processId, String authorizationToken, String qrContent); | ||
public Mono<Void> buildAndSendVerifiablePresentationWithSelectedVCsForDome(String processId, String authorizationToken, VcSelectorResponse vcSelectorResponse); | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/es/in2/wallet/application/service/UserDataUseCaseService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package es.in2.wallet.application.service; | ||
|
||
import es.in2.wallet.domain.model.CredentialsBasicInfoWithExpirationDate; | ||
import es.in2.wallet.domain.model.CredentialsBasicInfo; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.util.List; | ||
|
||
public interface UserDataUseCaseService { | ||
public Mono<List<CredentialsBasicInfoWithExpirationDate>> getUserVCs(String processId, String userId); | ||
public Mono<List<CredentialsBasicInfo>> getUserVCs(String processId, String userId); | ||
Mono<Void> deleteVerifiableCredentialById(String processId,String credentialId, String userId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 13 additions & 5 deletions
18
src/main/java/es/in2/wallet/application/service/impl/DomeAttestationExchangeServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
package es.in2.wallet.application.service.impl; | ||
|
||
import es.in2.wallet.application.service.DomeAttestationExchangeService; | ||
import es.in2.wallet.domain.model.VcSelectorRequest; | ||
import es.in2.wallet.domain.model.VcSelectorResponse; | ||
import es.in2.wallet.domain.service.AuthorizationRequestService; | ||
import es.in2.wallet.domain.service.DidKeyGeneratorService; | ||
import es.in2.wallet.domain.service.AuthorizationResponseService; | ||
import es.in2.wallet.domain.service.DomeVpTokenService; | ||
import es.in2.wallet.domain.service.PresentationService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.util.Map; | ||
|
||
@Slf4j | ||
@Service | ||
@RequiredArgsConstructor | ||
public class DomeAttestationExchangeServiceImpl implements DomeAttestationExchangeService { | ||
private final AuthorizationRequestService authorizationRequestService; | ||
private final DomeVpTokenService domeVpTokenService; | ||
private final DidKeyGeneratorService didKeyGeneratorService; | ||
private final PresentationService presentationService; | ||
private final AuthorizationResponseService authorizationResponseService; | ||
|
||
|
||
@Override | ||
public Mono<Void> getSelectableCredentialsRequiredToBuildThePresentation(String processId, String authorizationToken, String qrContent) { | ||
public Mono<VcSelectorRequest> getSelectableCredentialsRequiredToBuildThePresentation(String processId, String authorizationToken, String qrContent) { | ||
log.info("ProcessID: {} - Processing a Verifiable Credential Login Request", processId); | ||
// Get Authorization Request executing the VC Login Request | ||
return authorizationRequestService.getAuthorizationRequestFromAuthorizationRequestClaims(processId, qrContent) | ||
// Check which Verifiable Credentials are selectable | ||
.flatMap(authorizationRequest -> domeVpTokenService.getVpRequest(processId,authorizationToken,authorizationRequest)); | ||
} | ||
@Override | ||
public Mono<Void> buildAndSendVerifiablePresentationWithSelectedVCsForDome(String processId, String authorizationToken, VcSelectorResponse vcSelectorResponse) { | ||
// Get the Verifiable Credentials which will be used for the Presentation from the Wallet Data Service | ||
return presentationService.createEncodedVerifiablePresentationForDome(processId,authorizationToken,vcSelectorResponse) | ||
.flatMap(vpToken -> authorizationResponseService.sendDomeAuthorizationResponse(vpToken,vcSelectorResponse)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/es/in2/wallet/domain/exception/InvalidPinException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package es.in2.wallet.domain.exception; | ||
|
||
public class InvalidPinException extends Exception { | ||
public InvalidPinException(String message) { | ||
super(message); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
src/main/java/es/in2/wallet/domain/model/CredentialsBasicInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
package es.in2.wallet.domain.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import lombok.Builder; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.List; | ||
|
||
import static es.in2.wallet.domain.util.MessageUtils.*; | ||
|
||
@Builder | ||
public record CredentialsBasicInfo( | ||
@JsonProperty("id") String id, | ||
@JsonProperty("vcType") List<String> vcType, | ||
@JsonProperty("credentialSubject") JsonNode credentialSubject | ||
@JsonProperty("type") List<String> vcType, | ||
@JsonProperty(AVAILABLE_FORMATS) List<String> availableFormats, | ||
@JsonProperty(CREDENTIAL_SUBJECT) JsonNode credentialSubject, | ||
@JsonProperty(EXPIRATION_DATE) | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = ISO_8601_DATE_PATTERN) | ||
ZonedDateTime expirationDate | ||
) { | ||
} |
22 changes: 0 additions & 22 deletions
22
src/main/java/es/in2/wallet/domain/model/CredentialsBasicInfoWithExpirationDate.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/es/in2/wallet/domain/model/CredentialsBasicInfoWithExpiredDate.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/java/es/in2/wallet/domain/service/DomeVpTokenService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package es.in2.wallet.domain.service; | ||
|
||
import es.in2.wallet.domain.model.AuthorizationRequest; | ||
import es.in2.wallet.domain.model.VcSelectorRequest; | ||
import reactor.core.publisher.Mono; | ||
|
||
public interface DomeVpTokenService { | ||
Mono<Void> getVpRequest(String processId, String authorizationToken, AuthorizationRequest authorizationRequest); | ||
Mono<VcSelectorRequest> getVpRequest(String processId, String authorizationToken, AuthorizationRequest authorizationRequest); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.