Code Monkey home page Code Monkey logo

wxpusher-docs's People

Contributors

zas4exd avatar zjiecode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wxpusher-docs's Issues

回调/上行消息能否增加签名?

我们(记为A)接收上行消息时,为了保证安全,有时需要确保该消息是wxpusher(记为B)推送的。
比如“发送指令重启服务”的情况,不仅要保证该用户是已知的管理员用户,还要保证该POST的请求来源是wxpusher,而不是第三方。

建议wxpusher后台回调时增加一个签名(使用消息内容和appToken),这样只要第三方拿不到token,就无法伪造请求来源。
具体的实现方法,个人想法是:

  • B回调A时,在POST请求头中增加一个sign字段,该字段为整条JSON内容 + "-" + appToken用某种散列算法(MD5或者SHA1或者其他的算法)(记为hash(...))进行签名
  • A收到请求时,分两种情况:
    • 如果该回调地址只有一个app使用,则直接计算hash(整条JSON内容 + "-" + appToken)sign比较,如果不相同则丢弃消息,相同则继续处理;
    • 如果有多个app使用同一个回调地址,则先解析消息内容得到appId,然后查得相应的appToken,再进行上面的处理
  • 如果要防止重放攻击,A要进行额外的判断,如:
    • 整条消息是否在之前的x分钟内重复过?(只需判断sign是否重复过)
    • time字段和本地时间之差,是否在合理区间内?(小于x分钟)

这样既不会破坏旧的协议,也可以增加回调的安全性。希望这个建议能被采纳。

删除用户接口Error

接口 [/api/fun/remove] 出现异常:Optional long parameter 'id' is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

几个疑惑

1.用户扫描带参数的二维码,关注关注之后,没有用户关注提示 ,后台已设置
2.可否一次关注多个topic,并增加回调
3.怎样获取主题的订阅状态

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.