服务到服务认证、服务身份和访问权限管理
我目前正在使用 Ruby、Ruby on Rails、Sinatra 和纯 Rack Web 服务开发分布式应用程序。
我将有很少的服务(RESTful,不是基于 SOAP)使用 JSON 进行通信,并且我需要一种方法来在这些服务之间的通信过程中保护和验证每个服务的身份,因此没有人可以假装是服务并且向其他服务提出请求。
核心思想是将其他服务视为“用户”,并能够验证其身份并在必要时限制其对数据的访问。
所以问题是如何仅使用 Ruby 来做到这一点以及如何有效管理服务身份及其访问权限。
我应该构建一些可供服务使用的附加身份验证服务吗?
我应该构建内部 gems 来提供一些带有密钥/共享秘密的连接中间件吗?
是否还有其他方法可以做到这一点?
I am currently developing a distributed application using Ruby, Ruby on Rails, Sinatra and pure Rack web services.
I will have few services (RESTful , not SOAP based) which will communicate using JSON and I would need a way to secure and verify the identity of each of those services during the communication between them, so no one could pretend to be a service and make requests to the other services.
The core idea is to treat other services as "users" and be able to verify their identity and limit their access to data if necessary.
So the question is how to do this using only Ruby and how to manage effectively the service identities and their access rights.
Should I build some additional authentication service usable by the services ?
Should I build internal gems to provide some connection middleware with keys/shared secrets ?
Is there maybe some other way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将生成一个应用程序 ID 和秘密,您可以在每个请求中传递它们。由于您不与其他用户打交道,而只是与应用程序打交道,因此请尝试使用设备来查找身份验证令牌。
I would generate an application id and secret that you could pass with each request. Since you are not dealing with other users and just applications try looking into authentication tokens with devise.
我认为 OAuth 是一种常用于 Web 服务到 Web 服务运行时身份验证的协议,尤其是使用 RESTful API 时。
I think OAuth is a protocol that is commonly used for web service - to - web service runtime authentication, especially with RESTful APIs.