-
1. Re: IP address filtering in fuse proxy web service
ffang May 21, 2014 9:54 AM (in response to joby.kj)Hi,
Please take a look at the faq here[1], this should help.
Freeman
-
2. Re: IP address filtering in fuse proxy web service
joby.kj May 22, 2014 5:08 AM (in response to ffang)Hi Freeman,
Thanks a lot . It is working now.
Now coming to our actual requirement , we need to allow access to the camel web service only for specific IP address range set. Request from other IP address should reject .
For achieving this we can extract the IP address from the request header and compare . Is there any other configuration in camel route for mentioning the allowed/dis allowed IP addresses ?
Thank You
Joby
-
3. Re: IP address filtering in fuse proxy web service
ffang May 22, 2014 5:18 AM (in response to joby.kj)Hi,
I can propose a pure CXF way, that said you can add a cxf in interceptor where you maintain a allowed IP table and extract the remote IP and compare.
Freeman
-
4. Re: IP address filtering in fuse proxy web service
joby.kj May 23, 2014 12:28 AM (in response to ffang)Hi Freeman,
I have one more doubt . From the above camel route , I need to execute the to uri endpoint based on some conditions in "process" method in SimpleProcessor class.
Eg :
---------------------------------------------------
public void process(Exchange exchange) {
String IP=127.0.0.1;
int flag =0;
Message cxfMessage = exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE, org.apache.cxf.message.Message.class);
ServletRequest request = (ServletRequest) cxfMessage.get("HTTP.REQUEST");
String remoteAddress = request.getRemoteAddr();
if(remoteAddress,equals(IP)){
flag=1;
}
}
---------------------
if flag==0 , then we needn't to execute the second end point (<to uri="cxf:http://localhost:8080/services/myService?serviceClass=com.test.MyService"/> ).
Thank You