简体   繁体   English

了解 Express Gateway 和微服务(或 Monolithic API)之间的用户创建

[英]Understanding user creation between Express Gateway & Microservices ( or Monolithic API )

I'm in the process of learning and experimenting with Express Gateway and some simple services ( or even just a small monolithic api that sits behind the gateway )我正在学习和试验 Express Gateway 和一些简单的服务(甚至只是网关后面的一个小型单片 api)

I have gone through Express Gateway 'Getting Started' examples and have read through documentation.我浏览了 Express Gateway 的“入门”示例并通读了文档。

Right now I'm trying to grasp how a user of the system, client/customer, will be created.... The confusion lies in the area where the 'Getting Started' tutorials had me create a user WITHIN Express Gateway.现在,我正试图了解如何创建系统用户(客户/客户)......混乱在于“入门”教程让我在 Express Gateway 内创建用户的区域。

But coming from a monolithic RESTful API viewpoint... the system may have its own DB schema for what a User is.但是来自一个单一的 RESTful API 观点......系统可能有自己的用户数据库模式。 Client app calls an API endpoint for user creation, goes through its own process, makes the record, returns to the client a successful creation ( or not ).客户端应用程序调用 API 端点来创建用户,通过自己的过程,制作记录,向客户端返回成功创建(或不成功)。 Then getting the user authorized ( JWT / OAuth / etc.. )然后让用户授权( JWT / OAuth / etc..)

So using Express Gateway, do we need to create a user, then pass that ID down to a UserService to save in its own dB, linking this newly created id with the express gateway id ?那么使用 Express Gateway,我们是否需要创建一个用户,然后将该 ID 传递给 UserService 以保存在它自己的 dB 中,将这个新创建的id与 express gateway id链接起来?

That is correct;那是对的; usually what you want to do when you are creating a new user is to make a call both your database/service and to Express Gateway as well with some of the details so they stay in sync.通常,当您创建新用户时,您想要做的是调用您的数据库/服务和 Express Gateway 以及一些详细信息,以便它们保持同步。

If you do not really want to do that it's advised to use a thirty party service such as Auth0 to keep the identity users decoupled from the user details.如果您真的不想这样做,建议使用 Auth0 等三十方服务来保持身份用户与用户详细信息的分离。

Does that explain/clarify?这是否解释/澄清?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 NodeJS/Express 中的 API 网关进行微服务 API 身份验证 - Microservices API Authentication with API Gateway in NodeJS/Express API网关和微服务通信 - API gateway and microservices communication 微服务之间如何使用不同的交互协议,连接API网关? - How to use different interaction protocols between microservices and to connect API Gateway? 带有快速网关的微服务:路由返回 404 错误 - Microservices with express gateway : routes return 404 error 使用Express.js和docker了解微服务 - Understanding microservices using Express.js and docker Express-gateway 为快速微服务应用程序创建新的插件/策略 - Express-gateway create new plugin / policy for express microservices application Express-Gateway - 带有 docker-compose Nodejs 微服务架构的 502 错误网关 - Express-Gateway - 502 Bad Gateway with docker-compose Nodejs Microservices Architecture 微服务和api-gateway架构中的输入和身份验证验证 - input and authentication validation in microservices and api-gateway architecture 如何在微服务世界中使用 api-gateway 处理负载均衡器? - How to handle load balancer with api-gateway in microservices world? 使用 API 网关的 AWS ECS 中微服务的基于路径的路由 - Path based routing for Microservices in AWS ECS with API Gateway
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM