apache / incubator-milagro-dta

Apache Milagro Decentralized Trust Authority
https://milagro.apache.org/
Apache License 2.0
11 stars 8 forks source link

Refactor CreateIdentity Method #39

Closed howardkitto closed 4 years ago

howardkitto commented 4 years ago

I want to be able to create an identity document from another Go application. Ideally I would simply import the the defaultService package and call the CreateIdentity method.

Unfortunately this is not possible because:

  1. I have to create a new service which involves lots of unnecessary coding.
  2. It depends on the "common" package which has a dependency on IPFS, publishing the document to IPFs should be a separate call e.g.
    
    import (
    "github.com/apache/incubator-milagro-dta/pkg/identity"
    "github.com/apache/incubator-milagro-dta/pkg/ipfs"
    "someStorageThing"
    )

myFunc() hashddress { identityDoc, identitySecrets := identity.CrateIdentity("name") hashAddress := ipfs.Put(identityDoc) store.Put(identitySecrets) return hashAddress }



The end result is that I have rewrite all the business logic for creating an identity document.