Skip to content

Commit

Permalink
Fixed build issue after updating the branch with the latest changes f…
Browse files Browse the repository at this point in the history
…rom the branch `release/os/5.3`
  • Loading branch information
filipesoliveira committed Jul 16, 2024
1 parent ed7f1af commit f1088d0
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package net.corda.restclient.generated

import io.javalin.Javalin
import io.javalin.http.ContentType
import io.javalin.http.Header
import io.javalin.http.servlet.getBasicAuthCredentials
import net.corda.restclient.CordaRestClient
import net.corda.restclient.generated.infrastructure.ApiClient
import org.assertj.core.api.AssertionsForClassTypes.assertThat
Expand All @@ -22,12 +24,12 @@ class TestClientAuthHeader {
app = Javalin.create().start(0)
app.get("api/v5_3/mgm/1234/info") { ctx ->

assertThat(ctx.basicAuthCredentialsExist()).isTrue()
val basicAuthCredentials = getBasicAuthCredentials(ctx.header(Header.AUTHORIZATION))
assertThat(basicAuthCredentials).isNotNull()

// Respond with the credentials from the basic auth header
val (user, password) = ctx.basicAuthCredentials()
ctx.contentType(ContentType.APPLICATION_JSON)
.result("$user:$password")
.result("${basicAuthCredentials?.username}:${basicAuthCredentials?.password}")
}
}

Expand Down

0 comments on commit f1088d0

Please sign in to comment.