-
Notifications
You must be signed in to change notification settings - Fork 55
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
Refactor verification, integrity, parsing #404
Conversation
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.
Seems like multiple string replacements happened that shouldn't have happened. Can you confirm?
assert.Error(tt, err) | ||
assert.Contains(tt, err.Error(), "credential must have a proof") | ||
assert.Contains(tt, err.Error(), "cred must have a proof") |
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.
Is this intentional?
assert.Error(tt, err) | ||
assert.Contains(tt, err.Error(), "credential must have a proof") | ||
assert.Contains(tt, err.Error(), "cred must have a proof") |
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.
Here as well
@@ -184,7 +182,7 @@ func TestVerifyJWTCredential(t *testing.T) { | |||
jwtCred := getTestJWTCredential(tt, *signer) | |||
_, err = VerifyJWTCredential(jwtCred, resolver) | |||
assert.Error(tt, err) | |||
assert.Contains(tt, err.Error(), "has no verification methods with kid: missing") | |||
assert.Contains(tt, err.Error(), "has no validation methods with kid: missing") |
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.
I think this should stay as verification
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.
yes
credential/status/statuslist2021.go
Outdated
@@ -250,7 +250,7 @@ func bitstringExpansion(compressedBitstring string) ([]string, error) { | |||
|
|||
// ValidateCredentialInStatusList determines whether a credential is contained in a status list 2021 credential | |||
// https://w3c-ccg.github.io/vc-status-list-2021/#validate-algorithm | |||
// NOTE: this method does not perform credential signature/proof block verification | |||
// NOTE: this method does not perform credential signature/proof block validation |
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.
verification?
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.
yes
type Option struct { | ||
ID OptionKey | ||
Option any | ||
} |
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.
Using any
is discouraged unless there is a very good reason to do so. Can this be updated to received typed params?
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.
yes I have a separate ticket to refactor this #352
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.
Why are we doing credential validation? I thought we should only be doing verification
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.
we'll need both - for checking status, schema, etc
@@ -231,7 +231,7 @@ type JSONWebKeyVerifier struct { | |||
jwx.Verifier | |||
} | |||
|
|||
// Verify attempts to verify a `signature` against a given `message`, returning nil if the verification is successful | |||
// Verify attempts to verify a `signature` against a given `message`, returning nil if the validation is successful |
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.
verification?
@@ -142,7 +142,7 @@ func (b BBSPlusSignatureSuite) Verify(v cryptosuite.Verifier, p cryptosuite.With | |||
// make sure we set it back after we're done verifying | |||
defer p.SetProof(proof) | |||
|
|||
// remove the proof value in the proof before verification | |||
// remove the proof value in the proof before validation |
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.
verification?
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.
Should keep verification?
@@ -153,7 +153,7 @@ func TestCredentialLDProof(t *testing.T) { | |||
}, | |||
} | |||
|
|||
// create a copy for value verification later | |||
// create a copy for value validation later |
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.
seems like it shouldn't change
Codecov Report
@@ Coverage Diff @@
## main #404 +/- ##
==========================================
- Coverage 57.28% 56.86% -0.42%
==========================================
Files 67 67
Lines 7297 7304 +7
==========================================
- Hits 4180 4153 -27
- Misses 2380 2415 +35
+ Partials 737 736 -1
|
@andresuribe87 should have addressed all |
Small refactors / moving / renames before implementing generic data integrity verification