Forum Discussion
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
1 Reply
- JRahm
Admin
great stuff, Jason! Looks like the json format output isn't 12.0 compatible yet: FLD-ML-RAHM:downloads rahm$ python cl.py -j -f protocol=tcp admin@172.16.44.15 Password: Traceback (most recent call last): File "cl.py", line 255, in main() File "cl.py", line 138, in main conns, patterns = process_short_conns(ctext, ver) File "cl.py", line 211, in process_short_conns if SHORT_DEF[ver]['chs-indc'] in ctext[1]: KeyError: u'12.0.0' I'll debug when I get a chance.
Recent Discussions
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com