Skip to content

Commit

Permalink
Merge pull request #31 from Ferlab-Ste-Justine/ferload2
Browse files Browse the repository at this point in the history
fix: CQDG-369 Add realm into ferload client config
  • Loading branch information
jecos authored Oct 12, 2023
2 parents 9801da4 + 166c2e5 commit d473084
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object ConfigEndpoint:

def configServerEndpoint(config: Config): ServerEndpoint[Any, IO] = configEndpoint.serverLogicSuccess(_ => {
if (config.ferloadClientConfig.method == FerloadClientConfig.TOKEN) {
val tokenConfig = TokenConfig(config.ferloadClientConfig.clientId, config.ferloadClientConfig.tokenLink.get, config.ferloadClientConfig.tokenHelper)
val tokenConfig = TokenConfig(config.auth.realm, config.ferloadClientConfig.clientId, config.ferloadClientConfig.tokenLink.get, config.ferloadClientConfig.tokenHelper)
IO.pure(FerloadConfig(config.ferloadClientConfig.method, None, Some(tokenConfig)))
} else if (config.ferloadClientConfig.method == FerloadClientConfig.PASSWORD) {
val kc = KeycloakConfig(config.auth.authUrl, config.auth.realm, config.ferloadClientConfig.clientId, config.auth.clientId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ case class FerloadConfig(method: String, keycloak: Option[KeycloakConfig], token

case class KeycloakConfig(url: String, realm: String, `client-id`: String, audience: String)

case class TokenConfig(`client-id`: String, link: String, helper: Option[String])
case class TokenConfig(realm:String, `client-id`: String, link: String, helper: Option[String])
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ class ConfigEndpointsSpec extends AnyFlatSpec with Matchers with EitherValues:
.response(asJson[FerloadConfig])
.send(backendStub)

val expected = FerloadConfig(FerloadClientConfig.TOKEN, None, Some(TokenConfig("ferloadClientId","https://ferload.ferlab.bio/token", Some("Please copy / paste this url in your browser to get a new authentication token."))))
val expected = FerloadConfig(FerloadClientConfig.TOKEN, None, Some(TokenConfig("realm", "ferloadClientId", "https://ferload.ferlab.bio/token", Some("Please copy / paste this url in your browser to get a new authentication token."))))
response.map(_.body.value shouldBe expected).unwrap
}

0 comments on commit d473084

Please sign in to comment.