I'd like to test an API that is protected by Hawk auth. After some reading tonight, I believe the best approach is to inject my custom Authorization
header using a global karate.configure('headers', function () {...})
in my karate-config.js
. I tried this and my function is invoked for every request but I don't seem to have any access to the request info necessary to create my custom auth header (e.g. hawk requires access to the request method, host, port, path, body, etc... to calculate a hash for the auth header). I believe I can handle the creation of the auth header if I can just get access to the request details.
Any advice on how to implement a custom auth scheme would be greatly appreciated.