Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

refactor: credential manifest enhancements to match wallet-rendering specs #3309

Conversation

HeidiHan0000
Copy link
Contributor

Summary:

  • Refactored credentialmanifest.go
    • moved everything related to resolving the different types into a separate file called resolve.go to make it clearer as to what is coming from the credential manifest and wallet rendering specs and what is needed for displaying
    • moved common functions to common.go
  • Changes to match specs:
    • Fixed display mapping object to use text property if paths is empty
      • validateDisplayMappingObject to check for if both the text field and the paths field is empty
      • update unit tests for this
    • ValidateCredentialApplication
      • Added check for case where manifest's format is empty but credential application's is not (credential application's formats should be a subset of credential manifest's)
      • Removed duplicate code for checking credential application against credential manifest
      • update unit tests
    • Added missing optional property to CredentialFulfillment
    • Added missing optional properties to schema format

Closes #3304
Closes #3274
Closes #3280
Closes #3281

@HeidiHan0000 HeidiHan0000 force-pushed the credential-manifest-enhancements branch from 6fa3083 to 827d786 Compare July 29, 2022 18:28
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #3309 (729f5e8) into main (d134910) will increase coverage by 0.00%.
The diff coverage is 89.65%.

@@           Coverage Diff           @@
##             main    #3309   +/-   ##
=======================================
  Coverage   88.18%   88.19%           
=======================================
  Files         317      318    +1     
  Lines       42945    42967   +22     
=======================================
+ Hits        37872    37894   +22     
  Misses       3727     3727           
  Partials     1346     1346           
Impacted Files Coverage Δ
pkg/doc/cm/credentialfulfillment.go 86.36% <ø> (ø)
pkg/doc/cm/credentialapplication.go 92.68% <82.35%> (-1.99%) ⬇️
pkg/doc/cm/common.go 94.33% <87.50%> (+15.02%) ⬆️
pkg/doc/cm/resolve.go 90.96% <90.96%> (ø)
pkg/doc/cm/credentialmanifest.go 92.59% <100.00%> (+1.23%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

pkg/doc/cm/common.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
pkg/doc/cm/resolve.go Outdated Show resolved Hide resolved
Copy link
Contributor

@DRK3 DRK3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor grammar comments. I don't see any code issues. The comments I left were all on code that you just moved from somewhere else rather than new code, so it's up to you if you think it's worth fixing!

@HeidiHan0000
Copy link
Contributor Author

@DRK3 I'll make those grammar changes, thanks for reviewing!

@HeidiHan0000 HeidiHan0000 force-pushed the credential-manifest-enhancements branch from 827d786 to 48c284c Compare August 2, 2022 16:24
@HeidiHan0000
Copy link
Contributor Author

@sudeshrshetty Could you please approve the CI tests again?

@HeidiHan0000 HeidiHan0000 force-pushed the credential-manifest-enhancements branch 2 times, most recently from 56743d2 to 48c284c Compare August 2, 2022 19:29
…specs

Signed-off-by: heidihan0000 <daeun.han@avast.com>
@HeidiHan0000 HeidiHan0000 force-pushed the credential-manifest-enhancements branch from 8ac5149 to 729f5e8 Compare August 2, 2022 19:34
@sudeshrshetty sudeshrshetty merged commit 0b9948c into hyperledger-archives:main Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants