安心无认证

Rest heart without authentication

我正在使用 Rest Heart,我想:

1) 禁用 Rest Heart 的身份验证。在执行 crud 操作时,我不想提供 admin:changeit 之类的任何凭据。 2) 使用 Mongo 禁用 Rest Heart 的身份验证,因为我的 Mongo 没有启用身份验证(我不想启用它)

我认为这可以通过编辑 yml 文件来完成,但即使阅读文档我也不清楚。

提前致谢。

要在 RESTHeart 中禁用安全性,您只需在 restheart.yml 配置文件

中注释掉以下行
#idm:
#  implementation-class: org.restheart.security.impl.SimpleFileIdentityManager
#  conf-file: {{{idm.conf-file}}}

#access-manager:
#  implementation-class: org.restheart.security.impl.SimpleAccessManager
#  conf-file: {{{access-manager.conf-file}}}

MongoDb 的凭据在 mongo-uri 中指定,例如:

mongo-uri: mongodb://user:secret@127.0.0.1/?authSource=authdb

如果你想 运行 MongoDb 没有安全性,只需设置以下内容:

mongo-uri: mongodb://127.0.0.1/

作为该主题的更新,RESTHeart 的最新主要版本 v4 于 2019 年 6 月发布,将安全层移到了另一个组件中。

所以现在如果你 运行 普通的 RESTHeart v4 你没有任何身份验证机制,所以根本没有什么可以禁用的。

RESTHeart v3 has been growing over the last 5 years featuring a REST API for MongoDB and a strong security layer. The code got complex to update and maintain, so that RESTHeart Platform v4 is now split in modules clued together in a micro-service architecture.

This resulted in two projects that do one thing and do it well. Each of them can also be reused alone in different architectures.

The two micro-services are:

您可以阅读 here 了解更多信息。