We are increasingly in need of multiple endpoints that are not necessarily issuers and verifiers.
For instance we need to call on did-resolvers, status list, and in the near future vc-refesh endpoints.
There for I propose that we abstract the Issuer and Verifier classes into an Endpoint class.
This also condenses redundant code from Issuer and Verifier into a single class that does more than the existing classes do now.
It also allows people to add new endpoints to their implementation config file with out us having to explicitly cast it to an Issuer or Verifier class.
The new flow would look for properties in the implementation config and then would wrap each element of a property that is an Array into an Array of Endpoint classes.
Example:
{
"name": "Example Implementation",
"implementation": "example",
"issuers": [{
"id": "did:key:Example",
"endpoint": "https://example.com/1.0/credentials/issue",
"options": {
"type": "Ed25519Signature2018"
},
"tags": ["VC-API"]
}],
"verifiers": [{
"id": "urn:uuid:not-a-uuid",
"endpoint": "https://example.com/1.0/credentials/verify",
"tags": ["VC-API", "Ed25519Signature2020"]
}],
"didResolvers": [{
"id": "",
"endpoint": "https://dev.uniresolver.io/1.0/identifiers",
"tags": ["Did-Key"]
}],
"some-new-endpoint": [{
"id": "",
"endpoint": "https://www.example.com/some-new-endpoint",
"tags": ["new-test"]
}]
}
// all of the Arrays are cast to `Class Endpoint`
// so we now filter like this
const {implemented, notImplemented} = filterByTag({property: 'some-new-endpoint', tags: ['new-test']})
// each entry in implemented already has all HTTP methods set up so we're good to go for testing
So basically:
Create a new higher level Class that combines Issuer & Verifier code into a single class
Use that higher level Class to deal with new endpoint automatically
DRY up some of the request logic
Makes this package better able to handle future tests and endpoints
We are increasingly in need of multiple endpoints that are not necessarily
issuers
andverifiers
. For instance we need to call ondid-resolvers
,status list
, and in the near futurevc-refesh
endpoints. There for I propose that we abstract theIssuer
andVerifier
classes into anEndpoint
class.That class would look like something this:
This also condenses redundant code from
Issuer
andVerifier
into a single class that does more than the existing classes do now. It also allows people to add new endpoints to their implementation config file with out us having to explicitly cast it to anIssuer
orVerifier
class.The new flow would look for properties in the implementation config and then would wrap each element of a property that is an Array into an Array of
Endpoint
classes.Example:
So basically:
Issuer
&Verifier
code into a single class