ActiveMQ:将 Django Auth 与 Stomp 结合使用

发布于 2024-08-07 15:41:12 字数 1034 浏览 4 评论 0原文

我正在研究 电源监控 并希望发送实时电力数据仅提供给授权用户。一些用户选择在家里安装功率传感器,其他用户正在查看这些传感器。每个传感器将样本发送到 Twisted 后端 - 目标是让该后端将数据转发到浏览器中运行的 Javascript 。

我当前转发数据的解决方案是 Orbited 服务器和 MorbidQ (MorbidQ 是一个 Stomp 服务器)。我的系统中的每个建筑物(示例)都有自己的更新渠道。扭曲的后端通过 MorbidQ 通道向任何观看者广播数据,但任何人都可以观看。我的博客上有一个关于 的条目从传感器到站点的数据流

对于许多建筑物,我只希望少数用户能够查看给定建筑物中的实时数据。如果可能的话,我想使用 Django Auth,如果没有的话,我想使用某种解决方法。

保护每个用户的这些通道的最简单方法是什么? 我可以使用 Django Auth 吗? 我应该使用 RabbitMQ 或 ActiveMQ 而不是 MorbidQ 吗? 我可以采取哪些措施来保证该解决方案的安全?

对于编码,我对 C++ 和 Python 最有信心。

谢谢!

I am working on power monitoring and want to send live power data to authorised users only. Some users have opted to install power sensors in their houses, others are viewing those sensors. Each sensor sends samples to a Twisted backend - the goal is to have this backend forward the data to Javascript running in the browser.

My current solution to forwarding the data is an Orbited server and an instance of MorbidQ (MorbidQ is a Stomp server). Each building in my system (example here) has its own channel for updates. The twisted backend broadcasts the data through the MorbidQ channel to anyone watching, but anyone can watch. There is an entry on my blog about the data flow from sensor to site

For many buildings, I only want a couple of users to be able to see live data in a given building. I would like to use Django Auth if possible, or some sort of workaround if not.

What is the easiest way to secure these channels per user?
Can I use Django Auth?
Should I use RabbitMQ or ActiveMQ instead of MorbidQ?
What measures can I take to keep this solution secure?

For coding I am most confident in C++ and Python.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晨与橙与城 2024-08-14 15:41:12

如果您使用 morbidq 的 Restq 扩展,则可以让它在每次用户尝试连接时向您的应用程序发送 http 回调。 (请参阅http://www.morbidq.com/trac/wiki/RestQ) 。然后,您的 django 应用程序可以对连接尝试返回“是”或“否”(在它运行一些身份验证过程之后)。

If you use the restq extensions for morbidq, you can have it send an http callback to your application every time the user attempts to connect. (See http://www.morbidq.com/trac/wiki/RestQ ). Your django app can then just return yes or no to the connect attempt (after it runs though some auth procedure.)

追星践月 2024-08-14 15:41:12

恢复旧线程:MorbidQ 不适用于生产用途 AFAIK。 ActiveMQ 是一个更强大的野兽,提供了更好的方法来处理基于用户的身份验证。我早在 2010 年就写过这篇,其中涉及静态用户身份验证 - 但 ActiveMQ 允许您传递动态用户列表进行身份验证,该列表可以来自应用程序可用的任何后端。我上面提到的帖子没有涉及它,但是稍微深入一下 ActiveMQ 身份验证/安全手册部分(加上一些 Java 知识)可以为此类使用启用相当令​​人讨厌的设置。如果 LDAP 可用,那就更好了。

Reviving an old thread: MorbidQ is not meant for production use AFAIK. ActiveMQ is a much more robust beast and provides much better ways to handle user-based authentication. I wrote this back in 2010 which deals with static user authentication - but ActiveMQ allows you to pass a dynamic list of users for authentication, which can come from whichever backend the application has available. The post I mentioned above does not deal with it, but a little digging into the ActiveMQ authentication/security manual section (plus some Java knowledge) can enable a pretty nasty setup for such use. If LDAP is available, even better.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文