We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a env : wolf --> ext-plugin-post-req (decrypt the request)-> my upstream (python) ---> ext-plugin-post-resp (encrypt the response)
but when I check the content in my upstream, the body is still encrypted.
my post-req filter: logger.info("input headers:{}, raw input:{}", request.getHeaders(), request.getBody()); User user = userService.tryFindUser(request.getHeader(Constants.HEADER_USER_ID)); if (user == null) { response.setStatusCode(403); response.setBody(ERROR_NOT_FOUND); logger.warn("未找到用户:{}", request.getHeaders()); } else { try { String decryptedBody = userService.decryptBody(request.getBody(), user); request.setBody(decryptedBody); request.setHeader(HEADER_REQUESTBODY_ENCRYPTED_FLAG, "true"); logger.info("DecryptRequestFilter:request:{}, user:{},{}", request.getRequestId(), user.getUserid(), decryptedBody); } catch (Exception e) { logger.error("decrypt request failure", e); response.setStatusCode(400); response.setBody(ERROR_DECRYPT_REQUEST_FAILURE); } }
and related log(you can see the request body is decrypted successfully.)
but the log in my python code(it says it's still encrypted )
my post-resp filter: String userId = request.getUpstreamHeaders().get(Constants.HEADER_USER_ID); logger.info("Current user id : {}, {}, body from upstream:{}", userId, request.getUpstreamHeaders(), request.getBody()); User user = userService.tryFindUser(userId); if (user == null) { response.setStatusCode(403); response.setBody(Constants.ERROR_NOT_FOUND); logger.warn("not found the user, maybe disabled. wolfuserid: {}", userId); } else { String encryptedBody = userService.encryptBody(request.getBody(), user); response.setBody(encryptedBody); response.setHeader(Constants.HEADER_RESPONSEBODY_ENCRYPTED_FLAG, "true"); response.setStatusCode(request.getUpstreamStatusCode()); logger.info("EncryptResponseFilter success:user(wolf):{},{}", user.getUserid(), encryptedBody); }
runner:0.0.4
the post-req filter should change the body sent to upstream.
The text was updated successfully, but these errors were encountered:
I found the apisix supports rewrite the request body since 3.6.0. apache/apisix#9990 Does the java plugin runner need any changes to support this?
Sorry, something went wrong.
The source code has to be changed to make it work. Some reference: #254 I have a fully working example at: https://github.com/gaoxingliang/apisix-java-plugin-runner/blob/encrypt-response/readme-new.md
Would you like to create a pr?
No branches or pull requests
Issue description
I have a env :
wolf --> ext-plugin-post-req (decrypt the request)-> my upstream (python) ---> ext-plugin-post-resp (encrypt the response)
but when I check the content in my upstream, the body is still encrypted.
and related log(you can see the request body is decrypted successfully.)
but the log in my python code(it says it's still encrypted )
Environment
runner:0.0.4
Minimal test code / Steps to reproduce the issue
What's the actual result? (including assertion message & call stack if applicable)
What's the expected result?
the post-req filter should change the body sent to upstream.
The text was updated successfully, but these errors were encountered: