如何设置快速网关以安全地连接我的服务

How do I set up express gateway to securely connect with my services

我目前已经专门为此配置了 express-gateway to communicate with a service on my backend exposed on a unique port on my machine and it's working fine. The gateway serves as a proxy to the services and currently does some security checks and jwt authentication. Then, only authorized request (through jwt validation) gets sent to services as configured. However, I'm concerned that if I don't put some sort of authentication on my service, then anyone who knows the port (or URL) my service runs on can directly access it and bypass the gateway directly. I'm looking for a way I can set up a sort of auth between the gateway and the service (maybe through keys) so that only the gateway can communicate with the services and not any other client. I currently can't find anything in the docs。另外,如果我的架构有问题,如果您能指出来,我将不胜感激。谢谢。

Express Gateway 和您的后端之间的路径应该位于专用的加密网络上,因此任何人都无法绕过网关。

使用这种架构,您不需要在服务器端进行身份验证,如果您使用 Express Gateway 作用域,您甚至不需要检查用户是否有权执行请求的操作。