Megatron9
Feb 16, 2022Nimbostratus
IRule to pass/inject "URL in Header" with "API Key" for authentication
Hi,
I am working on an IRule to inject a URL in the header and passing an API Key for authentication.
daxalerts-api.daxch.com/interfiling
us-east-1 configuration
◦ URL: https://eastdax-api.us-east-1.amazonaws/interfiling
◦ API Key: rbvMCKTq47ncSZuxrmUN4yWnfRaSFfzz
◦ Example:
wget https://eastdax-api.us-east-1.amazonaws/interfiling --header='x-api-key:rbvMCKTq47ncSZuxrmUN4yWnfRaSFfzz' --header='Content-Type:text/plain' --post-data '{ }' -d
-------------------
when HTTP_REQUEST {
if { HTTP::header insert [HTTP::host] equals"https://eastdax-api.us-east-1.amazonaws/interfiling"} {
set key "rbvMCKTq47ncSZuxrmUN4yWnfRaSFfzz"
}
-----------------------------
The above does not work and its basically become a pass-thru.
Thanks