Hi all, I want to mock some geo-fencing based on I...
# wiremock-java
i
Hi all, I want to mock some geo-fencing based on IP and return an error response when a request comes in from a specific IP address. I was hoping that there would be something like
withClientIpMatching
but that doesn't seem to exist so I am using
X-Forwarded-For
request header. Wondering if there is a more robust way to handle this
r
wiremock doesn't currently have a native client ip matcher, but the client ip of a request is available on wiremock's Request model, so a custom matcher could be made trivially
seems like something that could be a good addition to wiremock's native matchers if you feel like submitting a pr
i
Thanks @Rafe Arnold, I'll try to carve out some time to work on it.
l
Hey, I was looking for ways to contribute to the repository and came across this message. @Iwan are you still planning to take this one up? If you are not, I could give it a try. Thanks!
i
Hoi @Luis Copetti I can’t spare the time at the moment, so be my guest.
👍 1
l
Hey @Iwan @Rafe Arnold, I have opened a pull request. Please, let me know if this is what you had in mind. I will appreciate any feedback. Thanks! PR: https://github.com/wiremock/wiremock/pull/3014
i
It does what I was looking for. Thanks for taking the time @Luis Copetti
🙌 1