go-zero
go-zero copied to clipboard
Please advise on the respective responsibilities of api and rpc services.
参考了几个项目,但发现RPC的职责都比较重,大部分业务都是在RPC中完成,api完全充当了网关。对此我产生了疑惑,他们为什么会把大部分的职责都给了RPC,api和RPC的职责到底如何很好的划分呢,希望跟大家讨论讨论。
用户登录,生成token的逻辑是放在RPC服务,还是在API呢?
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Is the logic of user login and token generation placed in the RPC service or in the API?
我现在要对接一个第三方SSO登录,我去获取SSOToken时,会有一个重定向的回调,通过重定向回调获取SSOToken,然后在通过SSO的Token获取用户信息。获取用户信息的接口,我写在了RPC服务中,但是回调又需要API。所以我在想要不要把获取用户信息的逻辑也写在API服务,当然也可以把这个重定向的接口,继续从API调到RPC,只不过让API当了一次网关,但是会加长流程的时长。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Now I want to connect to a third-party SSO login. When I go to get the SSOToken, there will be a redirection callback. The SSOToken is obtained through the redirection callback, and then the user information is obtained through the Token of SSO. I wrote the interface for obtaining user information in the RPC service, but the callback requires an API. So I am wondering whether to write the logic of obtaining user information in the API service. Of course, I can also transfer the redirected interface from the API to the RPC. It just makes the API a gateway, but it will lengthen the process. .
usually in rpc,but there are exception,result by the project
我现在要对接一个第三方SSO登录,我去获取
SSOToken时,会有一个重定向的回调,通过重定向回调获取SSOToken,然后在通过SSO的Token获取用户信息。获取用户信息的接口,我写在了RPC服务中,但是回调又需要API。所以我在想要不要把获取用户信息的逻辑也写在API服务,当然也可以把这个重定向的接口,继续从API调到RPC,只不过让API当了一次网关,但是会加长流程的时长。
Jwt生成是同时支持api和rpc端生成的。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Now I want to connect to a third-party SSO login. When I go to get the
SSOToken, there will be a redirection callback. I get theSSOTokenthrough the redirection callback, and then get the user information through theTokenofSSO. I wrote the interface for obtaining user information in the RPC service, but the callback requires an API. So I am wondering whether to write the logic of obtaining user information in the API service. Of course, I can also transfer the redirected interface from the API to the RPC. It just makes the API a gateway, but it will lengthen the process. .
Jwt generation supports both api and rpc side generation.
我现在要对接一个第三方SSO登录,我去获取
SSOToken时,会有一个重定向的回调,通过重定向回调获取SSOToken,然后在通过SSO的Token获取用户信息。获取用户信息的接口,我写在了RPC服务中,但是回调又需要API。所以我在想要不要把获取用户信息的逻辑也写在API服务,当然也可以把这个重定向的接口,继续从API调到RPC,只不过让API当了一次网关,但是会加长流程的时长。
Jwt生成是同时支持api和rpc端生成的。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Now I want to connect to a third-party SSO login. When I go to get the
SSOToken, there will be a redirection callback. I get theSSOTokenthrough the redirection callback, and then get the user information through theTokenofSSO. I wrote the interface for obtaining user information in the RPC service, but the callback requires an API. So I am wondering whether to write the logic of obtaining user information in the API service. Of course, I can also transfer the redirected interface from the API to the RPC. It just makes the API a gateway, but it will lengthen the process. .
Jwt generation supports both api and rpc side generation.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.