Delfy Haridhas Pushpa
06/19/2024, 1:20 PM{{{jwt org_jwks_endpoint=request.requestLine.baseUrl+"test"}}}
Is it possible to append strings to url parameter used in jwt ?Lee Turner
06/19/2024, 4:03 PMjoin
helper that might work for you. You can find the implementation of that helper here - https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java#L144
/**
* Joins an array, iterator or an iterable with a string. For example:
*
* <pre>
* {{join value " // " [prefix=""] [suffix=""]}}
* </pre>
*
* <p>If value is the list ['a', 'b', 'c'], the output will be the string "a // b // c". Or:
*
* <pre>
* {{join "a" "b" "c" " // " [prefix=""] [suffix=""]}}
* Join the "a", "b", "c", the output will be the string "a // b // c".
* </pre>
*/
Delfy Haridhas Pushpa
06/20/2024, 9:38 AM{{join request.requestLine.baseUrl '/0014H00003ARnWpQAL/0014H00003ARnWpQAL.jwks' }}
@Lee Turner I tried this but in the output I am getting only url in the output and do not see the path attached /0014H00003ARnWpQAL/0014H00003ARnWpQAL.jwks
Lee Turner
06/20/2024, 10:14 AM{{join request.requestLine.baseUrl '/0014H00003ARnWpQAL/0014H00003ARnWpQAL.jwks' ''}}
Should generate:
<http://localhost:8080/0014H00003ARnWpQAL/0014H00003ARnWpQAL.jwks>
Or you could get a little more fancy and provide the path separator as the string to join and separate out the different components of the url:
{{join request.requestLine.baseUrl '0014H00003ARnWpQAL' '0014H00003ARnWpQAL.jwks' '/'}}
Should generate the same resultDelfy Haridhas Pushpa
06/20/2024, 10:18 AMDelfy Haridhas Pushpa
06/20/2024, 10:52 AM"organisation_competent_authority_claims": {
"authority_id": "PAYUKGBR",
"registration_id": "110000",
"status": "Active",
"authorisations": [
{
"member_state": "GB",
"roles": [
"COPRequester",
"COPResponder"
]
}
]
}
"software_roles": [
"COPRequester"
]
Should I use val
helper to assign or do we have any other option ?Lee Turner
06/20/2024, 10:53 AMval
helper first i thinkDelfy Haridhas Pushpa
06/20/2024, 11:34 AMDelfy Haridhas Pushpa
06/20/2024, 12:24 PMDelfy Haridhas Pushpa
06/20/2024, 8:50 PMorganisation_competent_authority_claims=(jsonPath '{\"outer\":{\"inner\":\"Stuff\"}}' '$.outer.inner')
@Lee Turner Value retrieved is empty string. Am I missing something here ?Lee Turner
06/21/2024, 8:55 AMjsonPath
helper needs a JSON object instead of a string to be passed in. This seems to work for me - {{jsonPath (parseJson '{"outer":{"inner":"Stuff"}}') '$.outer.inner'}}
Delfy Haridhas Pushpa
06/21/2024, 9:10 AMDelfy Haridhas Pushpa
06/21/2024, 9:10 AMDelfy Haridhas Pushpa
06/21/2024, 9:30 AMDelfy Haridhas Pushpa
06/21/2024, 9:31 AM{"outer":{"inner":{"authority_id":"PAYUKGBR"}}}
Lee Turner
06/21/2024, 9:32 AMDelfy Haridhas Pushpa
06/21/2024, 9:35 AMinner
keyDelfy Haridhas Pushpa
06/21/2024, 9:43 AM{{jsonPath (parseJson '{"outer":{"inner":"Stuff"}}') '$.outer.inner'}
👆This returns Stuff
{{jsonPath (parseJson '{"outer":{"inner":{"authority_id":"PAYUKGBR"}}}') '$.outer.inner'}
👆This is not returning {"authority_id":"PAYUKGBR"}
Lee Turner
06/21/2024, 9:46 AM{
"request": {
"method": "GET",
"urlPath": "/endpoint"
},
"response": {
"status": 200,
"body": "{{jsonPath (parseJson '{\"outer\":{\"inner\":{\"authority_id\":\"PAYUKGBR\"}}}') '$.outer.inner'}}",
"transformers": [
"response-template"
]
}
}
When I make a request to the stub it returns :
{
"authority_id": "PAYUKGBR"
}
Lee Turner
06/21/2024, 9:47 AM}
off the end of your handlebars expressionDelfy Haridhas Pushpa
06/21/2024, 9:48 AMDelfy Haridhas Pushpa
06/21/2024, 10:12 AMLee Turner
06/21/2024, 10:28 AMDelfy Haridhas Pushpa
06/21/2024, 10:32 AM