Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Refactor entry points #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JaceHensley
Copy link
Contributor

Ultimate Problem

It was sort of confusing what the entry points for this library are. There was validateVerifiablePresentation, isValidVerifiablePresentation, and validateUntypedResponseData for VP validation and validateVerifiableAuth, isValidVerifiableAuth for auth validation.

Solution

  • Replace those with validateVerifiablePresentationResponse and validateVerifiableAuthResponse
  • Rename the various functions that create VP/VC and related data structures (in the util.ts file) from get* to build*
    • They weren't really "getting" anything, they were building out the rest of the structure given a few key bits
  • Simplify the API for creating a validation function
    • Instead of taking an array for config, it just takes a key-value map where the key is the key of the obj to validate and the value is a function (or list of functions) to validate the key against

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.

1 participant