Skip to content

Commit

Permalink
feat(prism-agent): make didcomm service url configurable (#173)
Browse files Browse the repository at this point in the history
allows didcomm communications in other networks
for example, between docker containers in proprietary network
  • Loading branch information
abalias committed Nov 28, 2022
1 parent 56cc1c3 commit b162172
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -43,6 +43,12 @@ object Main extends ZIOAppDefault {
}
_ <- ZIO.logInfo(s"REST Service port => $restServicePort")

didCommServiceUrl <- System.env("DIDCOMM_SERVICE_URL").map {
case Some(s) => s
case _ => "http://localhost"
}
_ <- ZIO.logInfo(s"DIDComm Service URL => $didCommServiceUrl")

didCommServicePort <- System.env("DIDCOMM_SERVICE_PORT").map {
case Some(s) if s.toIntOption.isDefined => s.toInt
case _ => 8090
Expand All @@ -61,7 +67,7 @@ object Main extends ZIOAppDefault {
.provide(RepoModule.connectDbConfigLayer >>> ConnectMigrations.layer)

agentDID <- for {
peer <- ZIO.succeed(PeerDID.makePeerDid(serviceEndpoint = Some(s"http://localhost:$didCommServicePort")))
peer <- ZIO.succeed(PeerDID.makePeerDid(serviceEndpoint = Some(s"$didCommServiceUrl:$didCommServicePort")))
_ <- ZIO.logInfo(s"New DID: ${peer.did}") *>
ZIO.logInfo(s"JWK for KeyAgreement: ${peer.jwkForKeyAgreement.toJSONString}") *>
ZIO.logInfo(s"JWK for KeyAuthentication: ${peer.jwkForKeyAuthentication.toJSONString}")
Expand Down

0 comments on commit b162172

Please sign in to comment.