-
Notifications
You must be signed in to change notification settings - Fork 55
[OSE-170][OSE-169] Create Submission Implementation #183
[OSE-170][OSE-169] Create Submission Implementation #183
Conversation
* The simplest scaffolding possible * rename Co-authored-by: Gabe <[email protected]>
c003c51
to
318ae8d
Compare
parsed, parseErr := jwk.ParseKey(jwkBytes) | ||
if parseErr != nil { | ||
err = parseErr | ||
return | ||
} | ||
if err = parsed.Raw(&pubKey); err != nil { | ||
return | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
return nil, errors.Wrapf(err, "verifying jwt credential %s", cred.CredentialJWT) | ||
} | ||
} else { | ||
if cred.Credential != nil && cred.Credential.Proof != nil { |
There was a problem hiding this comment.
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()
jwt
.ServiceStorage
interface.ErrSubmissionNotFound
error type.Operation
objects.