嗨,我正在使用 java 拦截器,想确定调用 api 的客户端 IP 地址
开放 API 规范
paths:
/test:
get:
description: ""
operationId: PING
x-wso2-disable-security: true
x-wso2-throttling-tier: 6PerMin
x-wso2-request-interceptor: java:org.mgw.interceptor.IDSAuthInterceptor
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/PING"
application/xml:
schema:
$ref: "#/components/schemas/PING"
security:
- basicAuthentication: []
Java 拦截器
public class IDSAuthInterceptor implements Interceptor {
public boolean interceptRequest(Caller caller, Request request) {
// How to determine client ip. Not able to fetch using {Caller caller, Request request}
}
}