Skip to content

Commit

Permalink
chore(prism-agent): move public 'restServiceUrl' config param under h…
Browse files Browse the repository at this point in the history
…ttp endpoint config

Signed-off-by: Benjamin Voiturier <benjamin.voiturier@iohk.io>
  • Loading branch information
bvoiturier committed Oct 13, 2023
1 parent 503dd39 commit 2975641
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ agent {
port = 8085
port =${?AGENT_HTTP_PORT}
}
publicEndpointUrl = "https://host.docker.internal:8080/prism-agent"
publicEndpointUrl = ${?REST_SERVICE_URL}
}
didCommEndpoint {
http {
Expand Down Expand Up @@ -122,8 +124,6 @@ agent {
autoProvisioning = ${?API_KEY_AUTO_PROVISIONING}
}
}
restServiceUrl = "https://host.docker.internal:8080/prism-agent"
restServiceUrl = ${?REST_SERVICE_URL}
database {
host = "localhost"
host = ${?AGENT_DB_HOST}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ final case class AgentConfig(
httpEndpoint: HttpEndpointConfig,
didCommEndpoint: DidCommEndpointConfig,
authentication: AuthenticationConfig,
restServiceUrl: String,
database: DatabaseConfig,
verification: VerificationConfig,
secretStorage: SecretStorageConfig,
Expand All @@ -141,7 +140,7 @@ final case class AgentConfig(
}
}

final case class HttpEndpointConfig(http: HttpConfig)
final case class HttpEndpointConfig(http: HttpConfig, publicEndpointUrl: String)

final case class DidCommEndpointConfig(http: HttpConfig, publicEndpointUrl: String)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ class IssueControllerImpl(
claims = jsonClaims,
validityPeriod = request.validityPeriod,
automaticIssuance = request.automaticIssuance.orElse(Some(true)), {
val publicEndpointUrl = appConfig.agent.httpEndpoint.publicEndpointUrl
val urlSuffix =
s"credential-definition-registry/definitions/${credentialDefinitionGUID.toString}/definition"
val urlPrefix =
if (appConfig.agent.restServiceUrl.endsWith("/")) appConfig.agent.restServiceUrl
else appConfig.agent.restServiceUrl + "/"
val urlPrefix = if (publicEndpointUrl.endsWith("/")) publicEndpointUrl else publicEndpointUrl + "/"
s"$urlPrefix$urlSuffix"
}
)
Expand Down

0 comments on commit 2975641

Please sign in to comment.