protected void checkRemoteClientTrusted() { RemoteClientInfo remoteClientInfo = RemoteClientInfo.get(); if (remoteClientInfo != null) { String address = remoteClientInfo.getAddress(); if (!trustedLoginHandler.checkAddress(address)) { throw new TrustedAccessRequiredException(); } } } }
/** * Check if the client is permitted to call the service method. * * @param ctx context */ protected void checkTrustedAccess(ProceedingJoinPoint ctx) { RemoteClientInfo remoteClientInfo = RemoteClientInfo.get(); if (remoteClientInfo != null && ctx instanceof MethodInvocationProceedingJoinPoint) { if (!trustedLoginHandler.checkAddress(remoteClientInfo.getAddress())) { log.warn("Client is not allowed to call '{}' since IP '{}' is not trusted", ctx.getSignature().toShortString(), remoteClientInfo.getAddress()); throw new TrustedAccessRequiredException(); } } } }