neo4j graphql 与多个用户
我们开始使用 @neo4j/graphql 来构建 graphql我们的 Neo4j 图形数据库。
唯一的问题是,根据 入门 示例只能使用单个用户(驱动程序)来初始化 Apollo 服务器。
const driver = neo4j.driver(
"bolt://localhost:7687",
neo4j.auth.basic("neo4j", "password")
);
const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
当我们尝试为每个租户创建一个用户并拒绝交叉读取时,这会导致我们的 RBAC 方法出现问题。
有没有办法使用多个驱动程序(每个用户),以便我们可以将每个请求映射到不同的用户?
We started using @neo4j/graphql to have a graphql over our neo4j graph db.
The only problem is that according to the getting started example it is only possible to init the Apollo Server with a single user (driver).
const driver = neo4j.driver(
"bolt://localhost:7687",
neo4j.auth.basic("neo4j", "password")
);
const neoSchema = new Neo4jGraphQL({ typeDefs, driver });
This causes an issue with our RBAC approach as we try to create a user per tenant and deny cross-reads.
Is there a way to use multiple drivers (per user) so that we can map each request to a different user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了我的问题的答案...
我们可以使用 驱动程序上下文方法
看起来像这样
I think I found an answer to my question...
Instead of supplying a driver (user) for the server initialization, we can use a driver in context approach
Which will look something like this