-
Notifications
You must be signed in to change notification settings - Fork 102
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
Single signer check #152
Single signer check #152
Conversation
@@ -99,6 +99,8 @@ export async function authenticate(jws: GeneralJws, didResolver: DidResolver): P | |||
// TODO: should we add an explicit check to ensure that there's only 1 signer?, Issue #65 https://github.com/TBD54566975/dwn-sdk-js/issues/65 | |||
const verifier = new GeneralJwsVerifier(jws); | |||
const { signers } = await verifier.verify(didResolver); | |||
if (signers.length!=1) |
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.
style: should wrap all if
statements with {... }
, looks like a linting rule needs to be added, feel free to add the rule, but that's optional, I can add it in later.
@@ -99,6 +99,8 @@ export async function authenticate(jws: GeneralJws, didResolver: DidResolver): P | |||
// TODO: should we add an explicit check to ensure that there's only 1 signer?, Issue #65 https://github.com/TBD54566975/dwn-sdk-js/issues/65 | |||
const verifier = new GeneralJwsVerifier(jws); | |||
const { signers } = await verifier.verify(didResolver); | |||
if (signers.length!=1) | |||
throw new Error('There must be just 1 signer'); |
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.
A test needs to be added for this new line.
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.
@rajakash-dev, thanks for the PR, a couple of comments to address.
c4789dc
to
3687f94
Compare
Upon further inspection of the code, the issue is already fix by this line of code: Thus closing! |
No description provided.