-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
feature_requestNew feature request, awaiting triageNew feature request, awaiting triage
Milestone
Description
Feature Request
Credential requests for the same holder PID should be gracefully handled on the issuer side.
The issuer service should check if an IssuanceProcess
already exists for that same holder PID, and if it does, it simply returns successfully.
Which Areas Would Be Affected?
DcpIssuerServiceImpl
Why Is the Feature Desired?
credential requests should be idempotent
Who will sponsor this feature?
Please @-mention the committer that will sponsor your feature.
Solution Proposal
in DcpIssuerServiceImpl#initiateCredentialsIssuance
add something like:
@Override
public ServiceResult<CredentialRequestMessage.Response> initiateCredentialsIssuance(String participantContextId, CredentialRequestMessage message, DcpRequestContext context) {
if (message.getCredentials().isEmpty()) {
return ServiceResult.badRequest("No credentials requested");
}
// add this:
var existingIssuanceProcess = findByHolderPid(message.holderPid());
if(existingIssuanceProcess != null){
return new CredentialRequestMessage.Response(existingIssuanceProcess()))
}
// ...
}
note that this snippet is just pseudo-code, because the check must happen within the same transaction!
Metadata
Metadata
Assignees
Labels
feature_requestNew feature request, awaiting triageNew feature request, awaiting triage