Skip to content

Commit

Permalink
fix: remove hard code did:example:* (#882)
Browse files Browse the repository at this point in the history
Signed-off-by: FabioPinheiro <[email protected]>
  • Loading branch information
FabioPinheiro authored Feb 7, 2024
1 parent 441f878 commit 321faf5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package io.iohk.atala.resolvers

import io.iohk.atala.resolvers.AliceDidDoc.didDocAlice
import io.iohk.atala.resolvers.BobDidDoc.didDocBob
import io.iohk.atala.resolvers.MediatorDidDoc.didDocMediator
import org.didcommx.didcomm.diddoc._

import java.util.Optional
Expand Down Expand Up @@ -30,20 +27,11 @@ object UniversalDidResolver extends DIDDocResolver with DIDResolver {
case Some(value) => ZIO.succeed(value)
}

val diddocs = Map(
"did:example:alice" -> didDocAlice,
"did:example:mediator" -> didDocMediator,
"did:example:bob" -> didDocBob
).asJava

override def resolve(did: String): Optional[DIDDoc] = {
val regex = "(did:peer:.+)".r
did match {
case regex(peer) =>
// val peerDidResolver = PeerDidResolverImpl()
// val didDocJson = peerDidResolver.resolveDidAsJson(peer)
Some(PeerDidResolver.getDIDDoc(peer)).toJava
case anydid: String => new DIDDocResolverInMemory(diddocs).resolve(anydid)
case regex(peer) => Some(PeerDidResolver.getDIDDoc(peer)).toJava
case anydid: String => None.toJava // new DIDDocResolverInMemory(diddocs.asJava).resolve(anydid)
}
}

Expand Down

0 comments on commit 321faf5

Please sign in to comment.