Skip to content

Commit

Permalink
feat: Support all types presentaton wth VCFormat auto #2779
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Aug 15, 2024
1 parent 356a506 commit 4b35f33
Showing 1 changed file with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,31 @@ List<CredentialModel> filterCredenialListByFormat({
credentialsToBePresented: credentials,
);

if (vcFormatType != VCFormatType.auto) {
credentials.removeWhere(
(CredentialModel credentialModel) {
/// remove ldpVc
if (presentLdpVc) {
return credentialModel.getFormat != VCFormatType.ldpVc.vcValue;
}

/// remove jwtVc
if (presentJwtVc) {
return credentialModel.getFormat != VCFormatType.jwtVc.vcValue;
}

/// remove JwtVcJson
if (presentJwtVcJson) {
return credentialModel.getFormat != VCFormatType.jwtVcJson.vcValue;
}

/// remove vcSdJwt
if (presentVcSdJwt) {
return credentialModel.getFormat != VCFormatType.vcSdJWT.vcValue;
}

return false;
},
);
}
credentials.removeWhere(
(CredentialModel credentialModel) {
/// remove ldpVc
if (presentLdpVc) {
return credentialModel.getFormat != VCFormatType.ldpVc.vcValue;
}

/// remove jwtVc
if (presentJwtVc) {
return credentialModel.getFormat != VCFormatType.jwtVc.vcValue;
}

/// remove JwtVcJson
if (presentJwtVcJson) {
return credentialModel.getFormat != VCFormatType.jwtVcJson.vcValue;
}

/// remove vcSdJwt
if (presentVcSdJwt) {
return credentialModel.getFormat != VCFormatType.vcSdJWT.vcValue;
}

return false;
},
);
}
return credentials;
}

0 comments on commit 4b35f33

Please sign in to comment.