-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
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
Forward Client RemoteIP #3940
Comments
There is no "forwarding" mechanism in GraphQL Mesh because GraphQL Mesh gives you a gateway schema that is served with a GraphQL Server. So in GraphQL, the execution is seperated from the HTTP pipeline. sources:
- name: MyGRPC
...
metaData:
someHeaderInfo: ["headers", "some-header"] I will create a PR to add this to our docs :) I'll also add support for interpolation syntax like below; sources:
- name: MyGRPC
...
metaData:
someHeaderInfo: "{context.req.headers['some-header']}" Thank you for reminding us for missing documentation :) |
Documents have been added! Let us know if it doesn't work for you! |
Well, I understand why this is a problem but our application needs the client IP to work. Using headers to do so is risky that it can be tempered with. Do you think there is any way or hack to get this done? |
|
So here is the setup request comes from user then to GraphQL server and then hits out backend server . I used your method , I added new header in mesh config. like When I log this header in grpcserver it shows 127.0.0.1 I am expecting user ip |
If you are testing this by calling the local server, it is expected to get 127.0.0.1. |
So our service is deployed on AWS App mesh. There is Virtual Gateway and envoy proxy infront of graphql mesh. |
Mesh basically uses Node.js, Express.js and Yoga. Hmm maybe |
I think I tried with ['req', 'connection', 'remoteAddress']. I will test your recommendation today. I hope it will work. |
Well, It did not work I think because of envoy proxy as a side car, the output of ['req', 'socket', 'remoteAddress'] comes out to be 127.0.0.1. Well, my only hope is to get X-Forward-For header from envoy proxy at this time. If you have any other recommendations. Please let me know. |
IP information depends on the environment. There is no standard way to get the remote ip. If you are behind a proxy, you can get it from |
Hello There,
We are using GraphQL Mesh in front of GRPC. We want to forward request remote ip (customer ip) to the backend. Seems like there is no way to do it with GraphQL Mesh at this point, please correct me if I am wrong.
The text was updated successfully, but these errors were encountered: