Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jsonld credential format identifier version #1412

Merged

Conversation

NB-MikeRichardson
Copy link
Contributor

  1. Fix the JSONLD_VC format string (it was missing a "v" character).

  2. Remove the check credential proofType === request proofType. I believe this check is unnecessary (and always fails when testing with aca-py)

Signed-off-by: Mike Richardson <mike.richardson@ontario.ca>
Signed-off-by: Mike Richardson <mike.richardson@ontario.ca>
@NB-MikeRichardson NB-MikeRichardson requested a review from a team as a code owner March 30, 2023 13:47
@NB-MikeRichardson NB-MikeRichardson changed the title fix: Jsonld fixes fix: Issue Credential V2 Minor JsonLd fixes Mar 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2023

Codecov Report

Merging #1412 (24032fd) into main (7459509) will increase coverage by 0.04%.
The diff coverage is 90.62%.

@@            Coverage Diff             @@
##             main    #1412      +/-   ##
==========================================
+ Coverage   85.34%   85.38%   +0.04%     
==========================================
  Files         788      795       +7     
  Lines       19435    19612     +177     
  Branches     3159     3170      +11     
==========================================
+ Hits        16587    16746     +159     
- Misses       2841     2859      +18     
  Partials        7        7              
Impacted Files Coverage Δ
packages/core/src/error/index.ts 100.00% <ø> (ø)
packages/indy-sdk/src/wallet/IndySdkWallet.ts 46.69% <0.00%> (-0.39%) ⬇️
...kages/indy-vdr/src/dids/IndyVdrIndyDidRegistrar.ts 94.50% <ø> (ø)
packages/askar/src/wallet/AskarWallet.ts 65.71% <33.33%> (-0.32%) ⬇️
...re/src/wallet/error/WalletExportPathExistsError.ts 50.00% <50.00%> (ø)
...ages/core/src/storage/migration/UpdateAssistant.ts 86.32% <60.00%> (-3.20%) ⬇️
...e/src/storage/migration/updates/0.3.1-0.4/cache.ts 87.50% <87.50%> (ø)
...ages/anoncreds/src/updates/0.3.1-0.4/linkSecret.ts 89.47% <89.47%> (ø)
...reds/src/updates/0.3.1-0.4/credentialDefinition.ts 93.10% <93.10%> (ø)
packages/anoncreds/src/AnonCredsModule.ts 100.00% <100.00%> (ø)
... and 14 more

... and 11 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

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

the v prefix changes makes sense, but I think we need to keep the proof type check

Comment on lines 359 to 361
if (credential.proof.type !== request.options.proofType) {
throw new AriesFrameworkError('Received credential proof type does not match proof type from credential request')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this check makes sense, and if it's different the issuer needs to use another type for the proof, or you need request another proof type.

What's the proof.type you're requesting and what the proof.type you're receiving?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are getting "assertionMethod" in the credential but the request proof type is undefined. I can't see anywhere in our code were we set proof type for an outgoing credential request, hence why I was thinking the test is superfluous. Unless I've missed something

Copy link
Contributor Author

@NB-MikeRichardson NB-MikeRichardson Mar 30, 2023

Choose a reason for hiding this comment

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

The other possibility is that the incoming test data is wrong on the issued credential, and credential proof type should not be set which would imply a problem somewhere else than AFJ code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that seems unlikely

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to dig a bit deeper on this. The RFC mentions that the proofType is required for the request, so if it's not there, we're not adhering to the spec: https://github.com/hyperledger/aries-rfcs/blob/main/features/0593-json-ld-cred-attach/README.md#ld-proof-vc-detail-attachment-format

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you get some data on the different messages that are exchanged (e.g. by calling getFormatData after the exchange) so we can see what's up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do some investigation and see what I can find.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK so I discovered we copy proof type and proof puprose from the offer to the request so I guess that means there is something wrong on the incoming offer message that needs investigating.

I've put the check back in. This PR can now be merged with just the one fix.

Signed-off-by: Mike Richardson <mike.richardson@ontario.ca>
@TimoGlastra TimoGlastra changed the title fix: Issue Credential V2 Minor JsonLd fixes fix: jsonld credential format identifier version Mar 31, 2023
@TimoGlastra TimoGlastra enabled auto-merge (squash) March 31, 2023 14:12
@TimoGlastra TimoGlastra merged commit c46a6b8 into openwallet-foundation:main Apr 3, 2023
TimoGlastra added a commit that referenced this pull request May 16, 2023
Co-authored-by: Karim Stekelenburg <karim@animo.id>
Co-authored-by: Ariel Gentile <gentilester@gmail.com>
Co-authored-by: Timo Glastra <timo@animo.id>
Co-authored-by: Jim Ezesinachi <ezesinachijim@gmail.com>
Co-authored-by: Ry Jones <ry@linux.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kim Ebert <kim@developmint.work>
Co-authored-by: Grammatopoulos Athanasios Vasileios <GramThanos@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Victor Anene <62852943+Vickysomtee@users.noreply.github.com>
Co-authored-by: Jim Ezesinachi <jim@animo.id>
Co-authored-by: KolbyRKunz <KolbyKunz@yahoo.com>
Co-authored-by: Berend Sliedrecht <61358536+blu3beri@users.noreply.github.com>
Co-authored-by: Jason C. Leach <jason.leach@fullboar.ca>
Co-authored-by: Martin Auer <martin.auer97@gmail.com>
Co-authored-by: Niall Shaw <100220424+niall-shaw@users.noreply.github.com>
Co-authored-by: Pritam Singh <43764373+Zzocker@users.noreply.github.com>
Co-authored-by: Mo <10432473+morrieinmaas@users.noreply.github.com>
Co-authored-by: NB-MikeRichardson <93971245+NB-MikeRichardson@users.noreply.github.com>
Co-authored-by: Amit-Padmani <106090107+Amit-Padmani@users.noreply.github.com>
Co-authored-by: DaevMithran <61043607+DaevMithran@users.noreply.github.com>
Co-authored-by: Alexander Shenshin <93187809+AlexanderShenshin@users.noreply.github.com>
fix(openid4vc-client): set package to private (#1210)
fix: fix typing issues with typescript 4.9 (#1214)
Fixes #1205
resolver (#1247)
fix: set updateAt on records when updating a record (#1272)
fix(transport)!: added docs moved connection to connectionId (#1222)
fix(indy-vdr): export relevant packages from root (#1291)
fix(askar): generate nonce suitable for anoncreds (#1295)
resolver and registrar for did:indy (#1253)
fix: imports from core (#1303)
fix: thread id improvements (#1311)
fix: loosen base64 validation (#1312)
fix(samples): dummy module response message type (#1321)
fix: seed and private key validation and return type in registrars (#1324)
fix!: don't emit legacy did:sov prefix for new protocols (#1245)
fix(askar): anoncrypt messages unpacking (#1332)
fix: expose indy pool configs and action menu messages (#1333)
fix: create new socket if socket state is 'closing' (#1337)
fix(anoncreds): include prover_did for legacy indy (#1342)
fix(indy-sdk): import from core (#1346)
fix(anoncreds-rs): save revocation registry index (#1351)
fix: isNewSocket logic (#1355)
fix(tenant): Correctly configure storage for multi tenant agents (#1359)
Fixes hyperledger#1353
fix(anoncreds): Buffer not imported from core (#1367)
fix(core): repository event when calling deleteById (#1356)
fix(askar): custom error handling (#1372)
fix: return HTTP 415 if unsupported content type (#1313)
fix: remove named capture groups (#1378)
fix example usage of indy-sdk-react-native package (#1382)
fix: connection id in sessions for new connections (#1383)
fix: did cache key not being set correctly (#1394)
fix: incorrect type for anoncreds registration (#1396)
fix: reference to indyLedgers in IndyXXXNotConfiguredError (#1397)
fix: add reflect-metadata (#1409)
fix: various anoncreds revocation fixes (#1416)
fix: jsonld credential format identifier version (#1412)
fix: remove `deleteOnFinish` and added documentation (#1418)
fix(askar): default key derivation method (#1420)
fix(anoncreds): make revocation status list inline with the spec (#1421)
fix(anoncreds-rs): revocation status list as JSON (#1422)
fix: issuance with unqualified identifiers (#1431)
fix(connections): store imageUrl when using DIDExchange (#1433)
fix(indy-vdr): do not force indy-vdr version (#1434)
fix: small issues with migration and WAL files (#1443)
fix: migration of link secret (#1444)
fix: Emit RoutingCreated event for mediator routing record (#1445)
fix: small updates to cheqd module and demo (#1439)
fix: remove scope check from response (#1450)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants