Hi
I have this Scenario
class IssueWebhook extends Simulation {
//val session : Session
val httpProtocol = http.baseURL(CONNECT_APP)
val paramsMutableMapHack = collection.mutable.MapString, Array[String]
val fireIssueWebhookScenario = scenario(s"Register ${NUM_TENANTS} Tenants")
.feed(tenantKeyFeeder.random)
.feed(userKeyFeeder.random)
.feed(issueKeyFeeder.random)
.exec(http(“update-issue-webhook-request”)
.post("/jira-issue_updated")
.body(ELFileBody(“webhook-template.json”)).asJSON
.queryParam(“jwt”,JwtSigner.generateSignature(“POST”,"/jira-issue_updated", paramsMutableMapHack.toMap,"${tenant}","${user}",“mock-tenant-shared-secret”))
.check(status.is(200)))
.pause(1 second)
setUp(fireIssueWebhookScenario.inject(ramp(NUM_TENANTS users) over (10 seconds)))
.protocols(httpProtocol)
.assertions(global.successfulRequests.percent.is(100))
}
I need to do Post Request with JWT. Gatling-jwt only supports GET. So what I try to do is call to JwtSigner.generateSignature (from Gatling-jwt) to Generate the JWT token and pass it as parameter. The problem is that JwtSigner.generateSignature is generating the Token with exactly “${tenant}” and “${user}”. I though both “${tenant}” and “${user}” are replaced by the current tentant an user of session. Obviusly I am doing something wrong. Pls Help me.
This is the code of JWTSigner.generateSignature
This is an example of what is generating:
Header
{ “alg”: “HS256”, “typ”: “JWT” }
Claims
{ “iss”: “${tenant}”, “iat”: 1423749763, “qsh”: “17cf901e7574ec13905582237c2741dece664398dcb6fdc32384b25d4a8fcfa9”, “sub”: “${user}”, “exp”: 1423749943 }
Signature (encoded)
BAGCDK0uHXvS_Ijv3JEsl5fQXCLNKvI61NOqAItXCmU
Thanks a lot!