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

[OSE-170][OSE-169] Create Submission Implementation #183

Merged

Conversation

andresuribe87
Copy link
Contributor

@andresuribe87 andresuribe87 commented Nov 28, 2022

  • Refactored DID verification to a a new package called jwt.
  • Implemented the submission.
  • Refactored test utils so creation of test services take the ServiceStorage interface.
  • Added a test for the creation of a presentation submission. This also includes introducing a ErrSubmissionNotFound error type.
  • Implemented the bolt storage related to the Operation objects.

@andresuribe87 andresuribe87 force-pushed the ose-170-create-submission-impl branch from c003c51 to 318ae8d Compare November 28, 2022 17:52
@andresuribe87 andresuribe87 changed the title [OSE-170] Create Submission Implementation [OSE-170][OSE-169] Create Submission Implementation Nov 28, 2022
Comment on lines +72 to +79
parsed, parseErr := jwk.ParseKey(jwkBytes)
if parseErr != nil {
err = parseErr
return
}
if err = parsed.Raw(&pubKey); err != nil {
return
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Across the board, we expect crypto.PublicKey to be a type from go's crypto package. This new bit of code ensure's that's the case.

@andresuribe87 andresuribe87 marked this pull request as ready for review November 29, 2022 17:24
Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

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

may want to uptake the latest sdk that was just merged, commit here - TBD54566975/ssi-sdk@92be548

if err := s.verifier.VerifyJWTCredential(*cred.CredentialJWT); err != nil {
return nil, errors.Wrapf(err, "verifying jwt credential %s", cred.CredentialJWT)
}
} else {
Copy link
Member

Choose a reason for hiding this comment

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

can get rid of this else here and have the same behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I'm keeping since cred might have both CredentialJWT and Credential populated, so having the else would avoid doing double validation in that case.

@andresuribe87 andresuribe87 merged commit 9166a2e into TBD54566975:main Nov 29, 2022
return nil, errors.Wrapf(err, "verifying jwt credential %s", cred.CredentialJWT)
}
} else {
if cred.Credential != nil && cred.Credential.Proof != nil {
Copy link
Member

Choose a reason for hiding this comment

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

this can be cred.HasDataIntegrityCredential()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants