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!
Feature Request
Credential requests for the same holder PID should be gracefully handled on the issuer side.
The issuer service should check if an
IssuanceProcessalready exists for that same holder PID, and if it does, it simply returns successfully.Which Areas Would Be Affected?
DcpIssuerServiceImplWhy 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#initiateCredentialsIssuanceadd something like:note that this snippet is just pseudo-code, because the check must happen within the same transaction!