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

Alternate interface for checking signer of email credentials #1795

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

artwyman
Copy link
Collaborator

I started out just trying to update the documentation, but then decided to experiment with how to change the interface so it's harder to forget to check the signing key on the email PCD. @robknight let me know if you think is a good direction to go.

I updated the PODBox code to use the new optional arg. It should be backward-compatible for any callers who aren't doing so, though I think it would be good to update ZuAuth to use the new arg as well so it becomes an example of proper usage.

*/
export async function verifyCredential(
credential: Credential
credential: Credential,
isTrustedEmailPCDSigner?: (emailPCDSigner: EdDSAPublicKey) => boolean
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A simpler version of this would be to pass an array of keys to accept, which might be more obvious how to use correctly. The function gives the caller more flexibility, including to throw their own exception (which I did in the CredentialSubservice) or to accept anything.

@artwyman
Copy link
Collaborator Author

Ping @robknight for feedback here. This is draft in that I'm not sure we want to go with this approach, but I would like to get thoughts on whether or not to proceed.

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

Successfully merging this pull request may close these issues.

1 participant