Hello, I have a question, can we create hmac 256 a...
# help
s
Hello, I have a question, can we create hmac 256 algorithm signature in wiremock? without using java! The creation should be using an id (which is created randomly), timestamp (always current time) and webhook secret Thank you
l
Hi, when you say without using java, do you mean without creating a custom extension to do the hmac?
s
Yes.! I know it's silly, but is it possible?
l
I don't think there is anything that would help here out of the box given the dynamic nature of the hmac generation. An extension would probably be the most robust way to go
s
Yes I agree with you! Thank you so much.
l
No worries. If you decide to implement we are here to help
ty2 1
s
Hi @Lee Turner In the latest wiremock version, it supports graaljs, so I have written the code in JS for hmac256 signature generation, I have placed the js file in extensions folder, but upon starting my wriremock service it is not picking my js file. Any help here would be appreciated. Thank you
l
Hi, where did you see that the latest version of WireMock supports graaljs ?
I haven't seen any WireMock extensions written in JS and WireMock wouldn't know what to do with the JS file. I don't really have any experience with graaljs so not sure where this comes into the picture but I am pretty sure there is nothing natively in WireMock that supports graal
s
WireMock 3.x (latest) includes GraalVM JavaScript support out of the box. This means JS helpers (.js files) can run if the environment is configured correctly. I got this in gpt when I was looking for alternatives.
l
I think that might have been an AI hallucination unfortunately.
😅 1
I could be missing something so maybe worth asking GPT for the references as to where it got that information. Other than that, maybe a good use case for AI is to get it to convert your js to java for the WireMock extension ?