aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

Leave credentialStatus element in the LD credential

Open tsabolov opened this issue 3 years ago • 9 comments

During the implementation we stumbled upon inability of a recipient to validate a credential offer. That happens because the credentialStatus fields is popped from the credential offer (see here). Later, the two entities (one from credential request, and another from the offer) are being compared, and naturally the comparison fails, which leads to inability to receive the credential offer. This change makes sure that the comparison of the provided reference data is comparable with the credential content, by replacing the pop method with get to leave the credentialStatus intact in the offer object.

tsabolov avatar Aug 30 '22 12:08 tsabolov

@shaangill025 @andrewwhitehead -- please review. Thanks!

Thanks for the PR.

swcurran avatar Aug 30 '22 14:08 swcurran

See #1864 for some prior discussion on a similar change.

dbluhm avatar Aug 31 '22 02:08 dbluhm

Shoot -- just noticed that there is no DCO on the commit (DCO - Developer Certificate of Origin - https://github.com/apps/dco) and I clicked to merge from main, which probably means the DCO can't be fixed.

@tsabolov -- could you try to fix the commit, or close this PR, create a new branch, commit with the "-s" option (DCO) and create a new PR. Sorry to be a pain...DCO is required for all Hyperledger contributions.

swcurran avatar Aug 31 '22 19:08 swcurran

If you haven't pulled changes from your remote branch and just have your original commit locally still, you can run:

git commit --amend -s
git push -f

If you have pulled the merge commit, I recommend resetting back to the original commit, amending and force pushing.

git reset --hard HEAD~1  # reset to before the merge commit
git commit --amend -s
git push -f

dbluhm avatar Aug 31 '22 21:08 dbluhm

Codecov Report

Merging #1921 (e1c1713) into main (84fcfdc) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1921   +/-   ##
=======================================
  Coverage   93.60%   93.60%           
=======================================
  Files         539      539           
  Lines       34456    34456           
=======================================
  Hits        32251    32251           
  Misses       2205     2205           

codecov-commenter avatar Sep 02 '22 10:09 codecov-commenter

We finally have our SonarCloud check working reasonably well, and I think it would be worth looking at the identified code smell so that check will pass.

In the meantime -- @dbluhm -- could you please review the PR? Or suggest someone else?

Thanks!

swcurran avatar Sep 10 '22 04:09 swcurran

So I think some of the same concerns raised in #1864 apply here. Namely, by permitting credentialStatus, there might be some implication that ACA-Py will verify the credentialStatus when in reality it is not. Our thoughts for #1864 was that this could be delegated to the controller with minimal changes required to ACA-Py (and it's even been done here in this PR with fewer lines than our go at it lol). After the discussion on that PR, I am in agreement with @TimoGlastra's thoughts expressed in this comment:

Having it available but not checked is something the user should know about before using ACA-Py. as with crypto libraries it should be as hard as possible to use it wrong.

Probably the best approach for now would be to at least support verifying it on the verifier side, which is a lot easier than issuance.

As Timo suggests, I think it would be wise to implement the verification of credentialStatus to make it as hard as possible to misuse ACA-Py "supporting" the credentialStatus feature of W3C credentials.

dbluhm avatar Sep 12 '22 14:09 dbluhm

Looking for input on this either here or we will discuss on the ACA-Pug call next Tuesday.

Based on my understanding, I think the right thing to do is merge this so verifications work, but with a big notice that says ACA-Py does not support setting or checking Credential Status with W3C credentials. And we add an Issue to see if anyone wants to add Credential Status support -- starting with a design document and moving into implementation.

swcurran avatar Sep 14 '22 10:09 swcurran

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Oct 14 '22 00:10 sonarqubecloud[bot]