Giter Site home page Giter Site logo

权限验证怎么做? about gatewayclient HOT 3 CLOSED

walkor avatar walkor commented on July 30, 2024
权限验证怎么做?

from gatewayclient.

Comments (3)

walkor avatar walkor commented on July 30, 2024

GatewayClient 和 GatewayWorker是在一个内网里使用,start_gateway.php里$gateway->lanIp设置成内网ip,register服务监听内网ip即可。
例如GatewayClient 和 GatewayWorker在同一台服务器的话$gateway->lanIp设置127.0.0.1,start_register.php里0.0.0.0改成127.0.0.0.1。
这样外部网络就无法通过GatewayClient连接你的Gateway服务了。

from gatewayclient.

tim1020 avatar tim1020 commented on July 30, 2024

GatewayClient 和 GatewayWorker是在一个内网里使用,start_gateway.php里$gateway->lanIp设置成内网ip,register服务监听内网ip即可。
例如GatewayClient 和 GatewayWorker在同一台服务器的话$gateway->lanIp设置127.0.0.1,start_register.php里0.0.0.0改成127.0.0.0.1。
这样外部网络就无法通过GatewayClient连接你的Gateway服务了。

这个我知道,但问题是内网也是有不同的业务划分的,也不是在同一个内网就有权。

甚至更复杂的是,同一个gateway跑多个业务,不同的client只能给各自的业务发消息。

from gatewayclient.

walkor avatar walkor commented on July 30, 2024

Gateway和GatewayClient支持设置secretKey,secretKey类似密码的作用,用法是
start_gateway.php start_businessworker.php start_register.php 里分别加上

$gateway->secretKey='yourpassword';
$worker->secretKey='yourpassword';
$register->secretKey='yourpassword';

GatewayClient调用前设置secretKey类似如下

Gateway::$secretKey='yourpassword';

保证所有地方secretKey都设置一致,这样外部没有正确的secretKey时就无法调用了。

from gatewayclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.