@mihai-chiorean and I chatted and figured out how to restructure the dids package 4 hipster vibes (a.k.a subjectively simpler API surface) and to set us up for some upcoming features
this should be the last chonker PR in this repo as the updated structure hopefully sets us up for the long haul.
[!IMPORTANT]
most of the changes in this repo are moving files around and adjusting method names to accommodate new package names
[!WARNING]
dids/resolver.go will be refactored / cleaned up in a subsequent PR but the API surface will remain the same. Currently it feels kinda weird in the sense that the file is a bit hard to read and quickly figure out what's going on
Notable Changes
Each did method is now self contained in it's own package, so did creation now looks like:
didjwk.Create()
instead of
dids.NewDIDJWK()
dids.NewDIDDHT()
BearerDID now has access to the DID's Document. This is necessary for did:web
types representing data models defined in the did core spec now live in didcore
types used for different representations of DIDs e.g. DID (the string), BearerDID (did + key manager), PortableDID (literally portable representation of a DID, keys, and metadata) now live in the did package
added READMEs to each directory with usage examples. check out README for dids pkg
Overview
@mihai-chiorean and I chatted and figured out how to restructure the
dids
package 4 hipster vibes (a.k.a subjectively simpler API surface) and to set us up for some upcoming featuresthis should be the last chonker PR in this repo as the updated structure hopefully sets us up for the long haul.
Notable Changes
Each did method is now self contained in it's own package, so did creation now looks like:
instead of
BearerDID
now has access to the DID's Document. This is necessary fordid:web
types representing data models defined in the did core spec now live in
didcore
types used for different representations of DIDs e.g.
DID
(the string),BearerDID
(did + key manager),PortableDID
(literally portable representation of a DID, keys, and metadata) now live in thedid
packageadded READMEs to each directory with usage examples. check out README for dids pkg
New Directory Structure
did
didcore
did<method>
dids
Rationale
The primary goals for the api surface for is:
didjwk.Create()
,diddht.Create
etc.Resolve
method capable of resolving all did methods in this module without any configuration or registrationThe directory/package structure is a result of achieving both goals in a way that hopefully makes logical sense and prevents cyclic imports.
Internal Dependency Diagram: