Open aljones15 opened 2 years ago
The bedrock configuration is meant to be JSON, i.e., no functions. Additionally, bedrock-did-io's current design is to be an audited and approved list of acceptable DID methods for any bedrock application, not for general purpose. That doesn't mean it needs to remain that way (be non-extensible), but if we are to add extensions, I would think we'd need to do so via methods we expose on the library rather than directly via mixing code into the configuration.
cc: @davidlehn, @mattcollier
If that is the case then currently adding new methods like this:
import {didIo} from '@bedrock/did-io';
didIo.use(experimentalMethodDriver);
Works.
Currently this library is configured to only allow the
did:v1
anddid:key
drivers, but we might need to include more did drivers in the future or allow variants of adid:method
driver with a different identifier and driver options.So I am proposing something like this for the config:
This would allow the use of other
did:method
drivers just by adding a function to thecfg
section for the driver. This would also allow projects that use this library to extend thedid:method
drivers thatdid-io
has access to.